- By default, when a new Juniper switch's management interface is plugged in, it attempts to go through the ZTP process.
- It requests an IP address.
- It attempts to download and upgrade the Junos OS.
- It attempts to download and install a configuration.
- A user scans/enters the MAC address of each switch's management interface into a CSV file, along with other device-specific data (i.e. host name, IP addressing, VLANs, etc.).
- This CSV file is then placed on a server somewhere on the network where python, jinja2, apache2, the required Junos OS version, and a DHCP server are installed/loaded.
- Two jinja templates exist on this server that allow for the generation of device-specific configuration files.
- A configuration template that contains variables for all data that differs per device.
- A DHCP reservation template that contains variables for certain device-specific information (i.e MAC address of a switch's management interface).
- A single python script exists on this server, which when executed, analyzes the CSV file, generates configuration files, as well as creates DHCP reservations for each switch.
- Upon plugging each switch into the network, the ZTP process is triggered, and switches are deployment-ready in minutes.
Discussing my constraints with Vince and other team members, we came to the conclusion that a small, portable mini-computer just might work for this type of scenario. Enter Raspberry Pi!
Together we were able to validate that a Raspberry Pi gets the job done. It is super cheap and can be powered via a USB port on a switch. Once everything is loaded and the python script is executed, it is very plug and play. The Raspberry Pi can then be shipped from site to site to perform OS upgrades and provision configuration data.
In effort to make things a little simpler for network engineers that would like to try this out, I have taken a snapshot of my 8GB microSD with all the necessary applications installed and configured. It even has a sample CSV file, and generated samples from the python script. If you would like a copy just let me know. If you would like to build your own, here is what I installed:
- Snappy Ubuntu Core - https://wiki.ubuntu.com/ARM/RaspberryPi
- apache2 - used to transfer files via http
- python - used to generate files
- jinja2 - used to create templates
- isc-dhcp-server - used to serve IP addresses
- openssh-server - used to allow SSH access