The ZTP process starts when a device with base configuration is powered on. Automatic deployment is implemented through the Dynamic Host Configuration Protocol (DHCP). ZTP supports the application of both IPv4 and IPv6 addresses through DHCP.
Figure 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 INICFG or Intermediate Files in the Python Format 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 the system software, configuration file, and patch file. A version file server and an intermediate file server can be deployed on the same server that supports TFTP, FTP, or SFTP.
DNS server: stores mapping between domain names and IPv4/IPv6 addresses. A DNS server can provide a ZTP-enabled device with the IPv4/IPv6 address that maps the domain name of an IPv4/IPv6 file server, so that the ZTP-enabled device can obtain files from the IPv4/IPv6 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/IPv6 address through DHCP, select the DHCP server, DHCP relay agent, intermediate file server, version file server, and DNS server that support IPv4/IPv6. In addition, the server address in the intermediate file must be an IPv4/IPv6 address.
After the device is powered on, if the device has a configuration file, the device starts with the configuration file. If the device has only base configuration and a pre-configuration script is available, the pre-configuration script is executed. If the device has only base configuration and no pre-configuration script is available, the ZTP process is started.
Obtaining information through DHCP
The device broadcasts DHCP Request packets through its management network interface and Ethernet interfaces. After acknowledging the request, a DHCP server replies with a packet in which the Option fields contain the IP address of the DHCP server, 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 Intermediate File in the INI Formator Intermediate File in the CFG 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 Intermediate Files in the Python Format, the ZTP-enabled device automatically executes the script to download the version files from the version file server.
The device automatically sets the version files (system software, configuration file, and patch file) downloaded from the server as the next startup files. Then the device restarts, and automatic deployment is complete. The configuration file must exist. Otherwise, the ZTP process will be executed again after the device restarts.