Installation¶
Requirements¶
Server:
- Python 2.7 or later (https://www.python.org/download/releases)
- routes 2.0 or later (https://pypi.python.org/pypi/Routes)
- webob 1.3 or later (http://webob.org/)
- PyYaml 3.0 or later (http://pyyaml.org/)
Client:
Note
We recommend using a Linux distribution which has Python 2.7 as its standard Python install (e.g. yum in Centos requires Python 2.6 and a dual Python install can be fairly tricky and buggy). This guide was written based ZTPServer v1.1.0 installed on Fedora 20.
Installation Options¶
Turn-key VM Creation¶
The turn-key VM option leverages Packer to auto generate a VM on your local system. Packer.io automates the creation of the ZTPServer VM. All of the required packages and dependencies are installed and configured. The current Packer configuration allows you to choose between VirtualBox or VMWare as your hypervisor and each can support Fedora 20 or Ubuntu Server 12.04.
VM Specification:
- 7GB Hard Drive
- 2GB RAM
- Hostname ztps.ztps-test.com
- eth0 (NAT) DHCP
- eth1 (hostonly) 172.16.130.10
- Firewalld/UFW disabled
- Users
- root/eosplus
- ztpsadmin/eosplus
- Python 2.7.5 with PIP
- DHCP installed with Option 67 configured (eth1 only)
- BIND DNS server installed with zone ztps-test.com
- wildcard forwarding rule passing all other queries to 8.8.8.8
- SRV RR for im.ztps-test.com
- rsyslog-ng installed; Listening on UDP and TCP (port 514)
- ejabberd (XMPP server) configured for im.ztps-test.com
- XMPP admin user: ztpsadmin/eosplus
- httpd installed and configured for ZTPServer (mod_wsgi)
- ZTPServer installed
- ztpserver-demo repo files pre-loaded
See the Packer VM code and documentation as well as the ZTPServer demo files for the Packer VM.
PyPI Package (pip install)¶
ZTPServer may be installed as a PyPI package.
This option assumes you have a server with Python and pip pre-installed. See installing pip.
Once pip is installed, type:
bash-3.2$ pip install ztpserver
The pip install process will install all dependencies and run the install script, leaving you with a ZTPServer instance ready to configure.
Manual installation¶
Download source:
Once the above system requirements are met, you can use the following git command to pull the develop branch into a local directory on the server where you want to install ZTPServer:
bash-3.2$ git clone https://github.com/arista-eosplus/ztpserver.git
Or, you may download the zip or tar archive and expand it.
bash-3.2$ wget https://github.com/arista-eosplus/ztpserver/tarball/master
bash-3.2$ tar xvf <filename>
or
bash-3.2$ unzip <filename>
Change in to the ztpserver directory, then checkout the release desired:
bash-3.2$ cd ztpserver
bash-3.2$ git checkout v1.1.0
Execute setup.py
to build and then install ZTPServer:
[user@localhost ztpserver]$ sudo python setup.py build
running build
running build_py
...
[root@localhost ztpserver]# sudo python setup.py install
running install
running build
running build_py
running install_lib
...
Upgrading¶
Upgrading ZTP Server is based on the method of installation:
PyPI (pip):
sudo pip install --upgrade ztpserver
Manual, Packer-VM, GitHub installs:
cd ztpserver/ sudo ./utils/refresh_ztps -b <branch>
The ztpserver/ directory, above, should be a git repository (where the files were checked out). The
branch
identifier may be any version identifier (1.3.2, 1.1), or an actual branch on github such asmaster
(released), ordevelop
(development).RPM:
sudo rpm -Uvh ztpserver-<version>.rpm
Additional services¶
Note
If using the Turn-key VM Creation, all of the steps, below, will have been completed, please reference the VM documentation.
Allow ZTPServer Connections In Through The Firewall¶
Be sure your host firewall allows incoming connections to ZTPServer. The standalone server runs on port TCP/8080 by default.
Firewalld examples:
- Open TCP/<port> through firewalld
bash-3.2$ firewall-cmd --zone=public --add-port=<port>/tcp [--permanent]
- Stop firewalld
bash-3.2$ systemctl stop firewalld
- Disable firewalld
bash-3.2$ systemctl disable firewalld
Note
If using the Turn-key VM Creation, all the steps from below will be been completed automatically.
Configure the DHCP Service¶
Set up your DHCP infrastructure to server the full path to the ZTPServer bootstrap file via option 67. This can be performed on any DHCP server. Below you can see how you can do that for ISC dhcpd.
Get dhcpd:
- RedHat:
bash-3.2$ sudo yum install dhcp
- Ubuntu:
bash-3.2$ sudo apt-get install isc-dhcp-server
Add a network (in this case 192.168.100.0/24) for servicing DHCP requests for ZTPServer:
subnet 192.168.100.0 netmask 255.255.255.0 {
range 192.168.100.200 192.168.100.205;
option routers 192.168.100.1;
option domain-name-servers <ipaddr>;
option domain-name "<org>";
# Only return the bootfile-name to Arista devices
class "Arista" {
match if substring(option vendor-class-identifier, 0, 6) = "Arista";
# Interesting bits:
# Relay agent IP address
# Option-82: Agent Information
# Suboption 1: Circuit ID
# Ex: 45:74:68:65:72:6e:65:74:31 ==> Ethernet1
option bootfile-name "http://<ztp_hostname_or_ip>:<port>/bootstrap";
}
}
Enable and start the dhcpd service¶
RedHat (and derivative Linux implementations)
bash-3.2# sudo /usr/bin/systemctl enable dhcpd.service
bash-3.2# sudo /usr/bin/systemctl start dhcpd.service
Ubuntu (and derivative Linux implementations)
bash-3.2# sudo /usr/sbin/service isc-dhcp-server start
Check that /etc/init/isc-dhcp-server.conf is configured for automatic startup on boot.
Edit the global configuration file located at /etc/ztpserver/ztpserver.conf
(if needed). See the Global configuration file options for more information.