ZTP Fundamentals
Automatic Deployment and Typical Networking
The ZTP process starts when an unconfigured device is powered on. Automatic deployment is implemented through the Dynamic Host Configuration Protocol (DHCP).
Figure 8-1 shows the typical networking for automatic deployment in DHCP mode.
DHCP server: assigns the following addresses to a ZTP-enabled device: temporary management IP address, default gateway address, DNS server address, and intermediate file server address.
DHCP relay agent: forwards DHCP packets between the ZTP-enabled device and DHCP server that reside on different network segments.
Intermediate file server: stores the intermediate INI or Python script file required by the ZTP process. The intermediate file contains the version file server address and information about version files, which the ZTP-enabled device can learn by parsing the intermediate file. An intermediate file server can be a TFTP, FTP, or SFTP server.
Version file server: stores version files, including system software, configuration files, and patch files. A version file server and an intermediate file server can be deployed on the same file server that supports TFTP, FTP, or SFTP.
DNS server: stores mapping between domain names and IP addresses. A DNS server can provide a ZTP-enabled device with the IP address that maps the domain name of a file server, so that the ZTP-enabled device can obtain files from the file server.
File transfer through TFTP or FTP is prone to security risks, and therefore the SFTP file transfer mode is recommended.
To enable ZTP to apply for an IPv4 address through DHCP, you must select the DHCP server, DHCP relay agent, intermediate file server, version file server, and DNS server that support IPv4. In addition, the server address in the intermediate file must be an IPv4 address.
ZTP Process
Powering on and starting the device
After the device is powered on: if the device has a configuration file, the device properly starts with the configuration file; if the device has no configuration file, the ZTP process starts.
In the power-on and start process on an unconfigured device, a prompt will be displayed allowing the user who logged in on the console interface to determine whether to terminate the ZTP process. If the ZTP process is terminated, the device starts with no configurations.
Obtaining information through DHCP
In DHCP automatic deployment mode, the device broadcasts a DHCP request on management interfaces, high-bandwidth Ethernet interfaces, and then low-bandwidth Ethernet interfaces. After acknowledging the request, a DHCP server replies with a packet in which the Option fields contain the IP address assigned to the ZTP-enabled device, default gateway address, intermediate file server address, and intermediate file name.
Obtaining the intermediate file and version files
The ZTP-enabled device downloads the intermediate file from the server address specified in the DHCP response, and then downloads version files from the version file server address specified in the intermediate file.
If the intermediate file is in the INI format, the ZTP-enabled device accesses the version file server address specified in the intermediate file, and then downloads the version files whose names are specified in the intermediate file. If the intermediate file is in the Python format, the ZTP-enabled device automatically executes the script to download the version files from the version file server.
Restarting the device
The ZTP-enabled device specifies the downloaded version files as those for the next start, and restarts. Automatic deployment is then complete.