The CLI facilitates the management of the ZTP service. The CLI can be used to do the following activities:
In this section, sample configurations and show commands for ZTP are provided.
Use the ztp enable command to administratively enable ZTP.
Note: By default, the ZTP service is enabled. The ztp enable command reenables the ZTP after a user disables it.
Enable ZTP on the Leaf-3 switch by running the Leaf-3(config)# ztp enable command.
Use the show ztp-status command to view the current ZTP configuration of the switch and thorough information about the current state of a ZTP session.
On the SONiC switch, the ZTP status is viewable:
Leaf-3 # show ztp-status
========================================
ZTP
========================================
ZTP Admin Mode : True
ZTP Service : Inactive
ZTP Status : SUCCESS
ZTP Source : dhcp-opt67 (eth0)
Runtime : 05m 31s
Timestamp : 2019-09-11 19:12:16 UTC
ZTP JSON Version : 1.0
ZTP Service is not running
----------------------------------------
01-configdb-json
----------------------------------------
Status : SUCCESS
Runtime : 02m 48s
Timestamp : 2019-09-11 19:11:55 UTC
Exit Code : 0
Ignore Result : False
----------------------------------------
02-connectivity-check
----------------------------------------
Status : SUCCESS
Runtime : 04s
Timestamp : 2019-09-11 19:12:16 UTC
Exit Code : 0
Ignore Result : False
To disable ZTP, a provision is available to stop and disable the ZTP service. Once the ZTP service is disabled, you must manually reenable the service when rebooting or if the startup configuration file is not present.
To accomplish this, use the no ztp enable command.
On the Leaf-1 switch, ZTP can be disabled by running the Leaf-3(config)# no ztp enable command.