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.
Note: When ZTP is disabled by the user, the switch boots the default configuration available on the 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.
Figure 15: Sections of ZTP JSON file run
Note: For more information, see https://github.com/Azure/SONiC/blob/master/doc/ztp/ztp.md.