Currently Empty: 0.00 €
Module 2 – Lab 4 – Zero Touch Provisioning
The network team was tasked with configuring SONIC on multiple devices using ZTP. They created a configuration file and used a DHCP server. The switches automatically downloaded the configuration file and uploaded the new configuration file to the devices using ZTP. The ZTP saved the Network Team time and effort to prepare the switch to run.
Your task is to configure SONIC to use ZTP. Check DHCP configuration on SW1 switch and upload configuration to the device.
Step 1: Update DHCP server configuration on SERVER1 to use ZTP service:
There is an existing HTTP/DHCP server SERVER1 in your management network.
The DHCP/HTTP configuration and ZTP json file is already there. Log in to the SERVER1
(login credentials: stordis / route2open), and update DHCP configuration to use ZTP service.
Step 2: Enable ZTP service on SW1 switch:
Enable ZTP service on switch SW1 to start ZTP process. All necessary files to run ZTP are on SERVER1 in directory /etc/www/html/ztp.
Step 3: Check results of ZTP service on SW1 switch:
Verify config.db configuration has been downloaded correctly by SW1 from server SERVER1.
- Default authentication is login: admin passwords: YourPaSsWoRdÂ
- ZTP in SONIC is enabled by default after installation. In our lab, ZTP on the switch SW1 is disabled. Â
- You need to use DHCP server to run ZTP.  Â
- ZTP will start when no startup configuration file (/etc/sonic/config_db.json) is found on the switch.Â
- Â
The purpose of this lab is to practice setting up the configuration using the ZTP service on a SONIC NOS switch. Through the exercise, you will learn how to change the DHCP server configuration for the ZTP service, and how to enable the ZTP service on the switch.Â
Below is an example of the flow of this lab.Â
Â
Step 1: Configuration and activation of the ZTP service on SW1 switch:
Check that the startup configuration file (/etc/sonic/config_db.json) is on the switch. If the configuration file existed, then remove it.Â
1. admin@sonic:~$ ls /etc/sonic/config_db.jsonÂ
2. /etc/sonic/config_db.jsonÂ
3. admin@sonic:~$ sudo rm /etc/sonic/config_db.jsonÂ
4. admin@sonic:~$Â
Â
To enable ZTP use command below:Â
1. admin@sonic:~$ sudo ztp enable –yÂ
Â
To save the changes and start the SW1 switch with ZTP service, restart the device.Â
1. admin@sonic:~$ sudo rebootÂ
Â
Step 2: Check result of ZTP service on SW1 switch:Â
Verify the new configuration on the switch SW1Â
Â
Check the ZTP status of process. Â
1. admin@r2o–sw1:~$ sonic–cliÂ
2. r2o–sw1# show ztp-statusÂ
Â
Below are logs from the SW1 with output of show ztp-status command Â
 1. Apr 23 18:55:50.173214 System is readyÂ
 2.  Â
 3. r2o–sw1 login: adminÂ
 4. Password:Â
 5. Last login: Fri Apr 22 23:49:11 UTC 2022 on ttyS0Â
 6. Linux r2o–sw1 4.19.0–9–2–amd64 #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07) x86_64Â
 7. You are onÂ
 8.  ____  ___ _  _ _ ____Â
 9. / ___| / _ \| \ | (_)/ ___|Â
10. \___ \| | | |Â \| | | |Â
11.  ___) | |_| | |\ | | |___Â
12. |____/ \___/|_| \_|_|\____|Â
13.  Â
14. — Software for Open Networking in the Cloud —Â
15.  Â
16. Unauthorized access and/or use are prohibited.Â
17. All access and/or use are subject to monitoring.Â
18.  Â
19. Help: http://azure.github.io/SONiC/Â
20.  Â
21. admin@r2o–sw1:~$ sonic–cliÂ
22. r2o–sw1# show ztp-statusÂ
23. ========================================Â
24. ZTPÂ
25. ========================================Â
26. ZTP Admin Mode     : TrueÂ
27. ZTP Service        : InactiveÂ
28. ZTP Status         : SUCCESSÂ
29. ZTP Source         : dhcp–opt67 (eth0)Â
30. ZTP Runtime        : 08m 58sÂ
31. ZTP Timestamp      : 2023–04–23 18:55:36 UTCÂ
32. ZTP JSON Version   : 1.0Â
33.  Â
34.  Â
35. ———————————————Â
36. 01–configdb–jsonÂ
37. ———————————————Â
38. Status             : SUCCESSÂ
39. Runtime            : 03m 12sÂ
40. Timestamp          : 2023–04–23 18:51:34 UTCÂ
41. Ignore Result      : FalseÂ
42. Halt on Failure    : FalseÂ
43.  Â
44. ———————————————Â
45. 02–connectivity–checkÂ
46. ———————————————Â
47. Status             : SUCCESSÂ
48. Runtime            : 03sÂ
49. Timestamp          : 2023–04–23 18:55:36 UTCÂ
50. Ignore Result      : FalseÂ
51. Halt on Failure    : FalseÂ
52. r2o–sw1#  Â
Â
Verify the IP address configuration on port eth0 on switch SW1 after uploading a new configuration by ZTP.Â
1. admin@r2o–sw1:~$ sonic–cli Â
2. r2o–sw1# configure terminal Â
 3. r2o–sw1(config)# interface Management 0Â
 4. sonic(conf–if–eth0)# show configurationÂ
5. !Â
6. interface Management 0Â
7. description Management0Â
8. mtu 1500Â
9. autoneg onÂ
10. speed 1000Â
11. ip address 10.10.1.66/24Â
12. r2o–sw1(conf–if–eth0)#Â
Â
In this step, you can also use the show ip interfaces command to display the IP configuration information of the network interfaces. You will see what address has been assigned by the DHCP server. In this case it is 10.10.1.66Â
Â
1. r2o–sw1# show ip interfacesÂ
2. Flags: U–Unnumbered interface, A–Anycast IPÂ
3. —————————————————————————————————————-Â
4. Interface IP address/mask VRFÂ Admin/Oper FlagsÂ
5. —————————————————————————————————————-Â
6. eth0 10.10.1.66/24 up/upÂ
7. sonic#Â