Currently Empty: 0.00 €
Module 3 Lab 2 - Klish (The Management Framework CLI)
As a young IT technician, one of your tasks is to ensure the continuous operation of your network. To achieve this, it is important to back up your switch configurations to prevent data loss and reduce downtime in case of failure.Â
The purpose of the task in question will be to perform a backup on the working switch and transfer it to SERVER1 to secure the configuration. In the event of a failure of switch SW1, the saved backup of the configuration will make it very easy to open it on a new switch. Â
There is an existing server SERVER1 in your management network with static ip address 192.168.1.200/24.Â
 Step 1 Log to the SW1 using Klish.Â
Log into the switch and switch to the EXEC mode using Klish.Â
- Step 2: Configuring a static IP address and bringing up the interface:Â
Configure the IP address of the eth0 interface and bring it up of the SW1 switch with correct address sub. Â
Verify the configuration. Execute a ping command to the server to validate the connection. Â
- Step 3: Backup configuration and send it to the SERVER1Â
Make a backup of the SW1 configuration. Upload a copy of the configuration to the server. Â
- Step 4: Check on the SERVER1 if you see saved configuration from SW1.Â
Log on the SERVER1, check if there is a configuration file from SW1 on the SERVER1Â
- The switch starts automatically into SONiC NOS.
- Default authentication is login: admin passwords: YourPaSsWoRd
- The netmask is represented as a prefix after the IP address in SONiC NOS.
To set the netmask to 255.255.255.0, use the prefix 24. For example, 192.168.1.10/24.
The purpose of this lab is to practice the manual method of configuring a network switch with SONiC. Â
Backup configuration and send it to the SERVER1. Â
Below you will find an example of this lab.Â
Â
Step 1: Log to the SW1 using Klish and start configuration mode.Â
 1. sonic login: adminÂ
 2. Password:Â
 3. Last login: Fri Apr 14 09:20:01 UTC 2023 on ttyS0Â
 4. Linux sonic 4.19.0–9–2–amd64 #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07) x86_64Â
 5. You are onÂ
 6.  ____  ___ _  _ _ ____Â
 7. / ___| / _ \| \ | (_)/ ___|Â
 8. \___ \| | | | \| | | |Â
 9.  ___) | |_| | |\ | | |___Â
10. |____/ \___/|_| \_|_|\____|Â
11.  Â
12. — Software for Open Networking in the Cloud —Â
13.  Â
14. Unauthorized access and/or use are prohibited.Â
15. All access and/or use are subject to monitoring.Â
16.  Â
17. Help:Â Â Â http://azure.github.io/SONiC/Â
18.  Â
19. admin@r2o–sw1:~$ sonic–cliÂ
20. r2o–sw1# configure terminalÂ
Â
Step 2: Configuration of a static IP address and activation of the interface:Â
1. r2o–sw1(config)# interface Management 0Â Â
2. r2o–sw1(conf–if–Ethernet0)# ip address 192.168.1.10/24 // IP address configurationÂ
3. r2o–sw1(conf–if–Ethernet0)# no shutdown               // setting port activationÂ
4. r2o–sw1(conf–if–Ethernet0)# exitÂ
Â
Verify the IP address configuration on port eth0 on switch SW1Â
1. r2o–sw1(conf–if–eth0)# show configurationÂ
2. !Â
3. interface Management 0Â
4. description Management0Â
5. mtu 1500Â
6. autoneg onÂ
7. speed 1000Â
8. ip address 192.168.1.10/24Â
9.  sonic(conf–if–eth0)#Â
Â
Â
You can also use show interfaces management 0Â command to display information about the IP configuration of network interfaces, including the IP addresses assigned to them, their status, and other relevant details.Â
 1. r2o–sw1# show interface Management 0Â
 2. eth0 is up, line protocol is upÂ
 3. Hardware is MGMT, address is 0c:f8:92:bc:00:00Â
 4. Description: Management0Â
 5. IPV4 address is 192.168.1.10/24Â
 6. Mode of IPV4 address assignment: MANUALÂ
 7. IPV6 address is fe80::ef8:92ff:febc:0/64Â
 8. Mode of IPV6 address assignment: DHCPÂ
 9. IP MTU 1500 bytesÂ
10. LineSpeed 1GB, Auto–negotiation TrueÂ
11. Input statistics:Â
12.        158 packets, 9480 octetsÂ
13.        0 Multicasts, 0 error, 0 discardedÂ
14. Output statistics:Â
15.        62 packets, 14328 octetsÂ
16.        0 error, 0 discardedÂ
17. Time since last interface status change: 00:16:36Â
Â
Execute a ping command to the server to validate the connection.Â
1. r2o–sw1# ping 192.168.1.200Â
2. PING 192.168.1.200 (192.168.0.200) 56(84) bytes of data.Â
3. 64 bytes from 192.168.1.200: icmp_seq=1 ttl=64 time=1.65 msÂ
4. 64 bytes from 192.168.1.200: icmp_seq=2 ttl=64 time=0.928 msÂ
Â
Step 3: Backup configuration and send it to SERVER1.Â
Make a backup of the SW1 configuration by using the command below.Â
1. admin@r2o–sw1:~$ sudo cp /etc/sonic/config_db.json /etc/sonic/config_db.json.backup Â
Ping Â
Check if the config_db.json.backup was saved successfully. Â
1. admin@r2o–sw1:~$ cd /etc/sonic/Â
2. admin@r2o–sw1:/etc/sonic$ ls –l | grep config_db.jsonÂ
3. –rw——- 1 root root 28163 Apr 27 10:21 config_db.jsonÂ
4. –rw——- 1 root root 28163 Apr 27 12:37 config_db.json.backupÂ
5. admin@r2o–sw1:/etc/sonic$Â
Â
We will use the SCP (secure copy) protocol for copying the configuration to the server. SCP allows files to be transferred securely between a local and remote host or between two remote hosts. It uses the same authentication and security as the Secure Shell Protocol (SSH) on which it is based. SCP is loved for its simplicity, security and pre-installed availability.Â
Upload a copy of the configuration to the server by using the command below.Â
1. admin@r2o–sw1:~$ sudo scp config_db.json.backup stordis@192.168.1.200:/home/stordis Â
Â
Step 4: Check on the SERVER1 if you see saved configuration from SW1.Â
Log on the SERVER1, check if there is a configuration file from SW1 on the SERVER1Â
1. stordis@stordis:~$ ls –lÂ
3. –rw——- 1 stordis stordis 28163 kwi 27 12:43 config_db.json.backupÂ
Â
To compare the saved configuration backup on SW1, use the Klish command: show running-configuration to display the currently active configuration. On the SERVER1 use the cat command with file name. Â
Â
SW1Â Â
1. admin@r2o–sw1:~$ sonic–cliÂ
2. r2o–sw1# show running-configurationÂ
Â
SERVER1Â
1. stordis@stordis:~$ cat config_db.json.backupÂ
Â