When a switch boots, the ZTP service starts and checks for the presence of the startup configuration file. The config_db.json startup configuration file is at /etc/sonic/. DHCP discovery is used to get the information about where the ZTP JSON file is located. The JSON file has the configuration needed for the switch. The administrator can define the configurations that are required for a particular switch.
The DHCP discovery process is done on in-band interfaces and also the management interface. DHCPv4 and DHCPv6 address discovery are supported. The first interface that receives a valid DHCP offer determines the URL specifying the location of the ZTP JSON file. At the DHCP server end, the DHCP offer must include the DHCPv4 Option 67 or the DHCPv6 Option 59 to specify the ZTP JSON file URL. See the following figure.
The ZTP service performs the configuration steps, which may cause a switch to reboot multiple times. After the downloaded ZTP JSON file is processed, the SONiC ZTP service exits, as shown in the following figures.