After entering ZTP mode, the switch sends a DHCP discovery message on its management interface, requesting DHCP offers from the DHCP servers present on the network. The DHCP server replies with a DHCP offer message. When the switch receives the DHCP offer message, it will look for following information in the offer:
An interface IPv4 address
A gateway IPv4 address
A TFTP or HTTP server IP address (using option 66)
Boot file name (using option 67)
The switch completes the DHCP negotiation process (request and acknowledgement) with the DHCP server, which assigns the switch with an IPv4 management address. The switch then uses the acquired TFTP or HTTP server IP address to contact that server to get the boot file, The option 67 contains the complete file path of the boot file on the remote server. The switch then downloads the boot file.
If no DHCP servers reply is received after DHCP discovery message or if the DHCP offer does not meets the ZTP requirements, the switch won't be able to complete the DHCP negotiation and the switch exits ZTP mode and continues the normal boot process.
The interface IPv4 address obtained from the DHCP server is kept and used as management address even after the ZTP process completes
DHCP servers must be configured with options 66 and 67 to ensure that the switch always obtains the TFTP server hostname and the boot file name during the ZTP process. DHCP options 66 and 67 are enabled by default on the OPBNOS. If either of them is disabled, the ZTP process results in a failure.
Zero Touch Provisioning (ZTP) enables a switch to automatically provision itself using the resources available on the network without manual intervention. ZTP is triggered only when it is force-enabled from ISCLI. When OPBNOS with ZTP enabled starts up, it locates a DHCP server which provides the switch with an IPv4 management IP address and a gateway IP address. The switch then obtains the IP address of a TFTP (or HTTP) server from which it downloads the necessary boot file. The switch then runs the boot file.
During the boot process, if the ZTP is enabled, the switch enters ZTP mode. The switch searches for available DHCP servers and requests them to acquire an interface address, a gateway address, the TFTP server address, and the boot file name. After the information from the DHCP server is obtained, ZTP downloads and runs the boot file, and then executes the ZTP process according to the boot file. ZTP automatically handles the process of upgrading the switch firmware image and installing configuration files.
ZTP handles firmware upgrades from ONIE to OPBNOS and OPBNOS to OPBNOS
If ZTP was force enabled and no DHCP server was found during the ZTP process, the switch will remove any management IP that may have been configured previously
Important ZTP events are logged by the switch and are available for display from a console
The following topics provide you with more information on Zero Touch Provisioning(ZTP)
The boot file is written in YAML and contains switch models, and under each switch model are several fields that instruct the ZTP process. The boot file may contain up to four fields under each switch model:
Image - This instructs ZTP to update the switch firmware image to the specified image and configure it as the next boot image on the switch
Configuration - This instructs ZTP to copy the specified configuration file from the TFTP (or HTTP) server and use it as the startup configuration file on the switch. The file should be renamed to iscli_db.cfg
Script - This instructs ZTP to copy the script file and execute it on the switch
Reboot - This instructs whether to reboot the switch after ZTP
ZTP checks the boot file for the switch model and executes it according to the fields under the correct switch model. ZTP supports the execution of Python scripts, If there is a script field under the switch model in the boot file, that field has a higher priority than the other two fields (image and configuration), thus ZTP executes it first. ZTP downloads the Python script file to the switch and executes it. The script can also contain instructions to download and install a switch firmware image and a configuration file. Users can leave some of the fields empty, ZTP will just skip the corresponding options.
The platform or hardware model should be taken from the “show platform summary”
The following example shows a boot file for a TFTP server:
The following example shows a boot file for an HTTP server:
ZTP can be force enabled to start up the ZTP process. After enabling ZTP, reboot the switch which triggers the ZTP process to kick start.
To force enable/disable ZTP on the switch, use the following command:
Command
ztp force <enable/run>
Description
Trigger ZTP process
Parameters
enable,run
Mode
EXEC
When you run the above commands, the switch will:
It will Trigger the ZTP process and download the image, configuration, and script files.
Install the downloaded files.
Reboot the switch.
After rebooting, the switch will come up with the new image.
When you run the above commands, the switch will:
Trigger the ZTP process: The ZTP process will automatically kick in after the switch reboots. ZTP will download the image, configuration, and script files, if any.
Install the image, and configuration, and run any script files.
After the files are installed, the switch will automatically reboot.
Once the switch comes back up, it will be running the new image.
After any of the above methods, the ZTP will not be disabled automatically and will need to be manually enabled if required.