DHCP is a crucial part of the zero touch provisioning process. The DHCP server will need to be configured to send out specific options. These options will be used to instruct the switch on which image to install and what config file to apply.
Depending on the DHCP server that is setup there are a couple of different things that can be done. Options can be setup on a global level for all members in the DHCP scope or per reservation based on the switches mac address. For my test, I setup on installed DHCP on a Linux box running CentOS7. DHCP scopes are configured under /etc/dhcp/dhcpd.conf. An example file can be found in /usr/share/doc/dhcp-your-version/dhcpd.conf.example.
Below is an example file that can be used to test a ZTP setup.
# For this example I had an interface on the Linux server in the 192.168.255.0/24 range subnet 192.168.255.0 netmask 255.255.255.0 { option routers 192.168.255.1; option subnet-mask 255.255.255.0; default-lease-time 3600; max-lease-time 7200; range 192.168.255.180 192.168.255.195; } option space zerop; option zerop-file-server code 150 = { ip-address }; option zerop.config-file-name code 1 = text; option zerop.transfer-mode code 3 = text; option zerop-encapsulation code 43 = encapsulate zerop; option zerop.config-file-name "leaf.config"; ## Location of HTTP server. In this example it's the DHCP server but it could be a separate system. option zerop-file-server 192.168.255.254; ## How files should be transferred. This is set to TFTP by default. option zerop.transfer-mode "http"; group { host SPINE { ## You can specify the MAC address of the switch to give it a specific configuration. hardware ethernet 33:33:33:33:33:33; ## IP address assigned to the switch fixed-address 192.168.255.190; ## This option will be used to specify the config file location option zerop.config-file-name "spine.config"; } }
That's it for a basic deployment of ZTP. At this point you should be able to unbox an EX or QFX switch and pull down a configuration file. Stay tuned for the next update to see how to take it up a notch. In my next post, I will go over how to automate the config file and DHCP reservation process using Python and Jinja2.