Enterprise SONiC Bootcamp Register Now

Sign Up

Module 2 – Lab 1 – Installing a Switch OS with ONIE 

You are a network engineer at a large cloud provider that has been using proprietary network operating systems on their switches. Recently, the management has decided to move to an open-source network operating system to gain more flexibility and control over their network infrastructure. You have been assigned to install SONiC on a switch in the data center.


There is an existing HTTP server SERVER1 in your management network. The SONiC image is already there with name sonic-lab.bin.
The SERVER1 IP is 192.168.1.200/24

Step 1: Configure and verify the IP address of SW1 and check connection with SERVER1. 

Configure the correct IP address of the switch SW1 to establish the IP connection between both machines and check connection.

Step 2: Install SONiC on a switch SW1 :

Log in to the ONIE at SW1 switch and install SONiC. 

 Step 3: Verify the installed SONiC on SW1 switch:

Log in to the SONiC using the default login credentials. 

  • The switch is starting automatically in ONIE: Install OS mode. 
  • Stopping the ONIE Discovery service can be helpful if the output messages are flooding the console. 
  • Make sure both devices are in the same network and they are pingable. 
  • To configure an IP address for a network interface please standard linux commands. 
  • The SONiC image is available at http://192.168.1.200/sonic-lab.bin

The purpose of this laboratory is practicing the manual method of installing SONiC at the open network switch. You will find below example solution of this laboratory. 

Step 1: Configure and verify the IP address of SW1 and check connection with SERVER1. 

Verify the IP address of SW1 

1. ONIE:/ # ip address show eth0 

2. eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000 

3. link/ether 0c:46:27:2a:00:00 brd ff:ff:ff:ff:ff:ff 

4. inet 169.254.97.194/16 scope global eth0 

5. valid_lft forever preferred_lft forever 

6. inet6 fe80::e46:27ff:fe2a:0/64 scope link  

7. valid_lft forever preferred_lft forever 

8. ONIE:/ # 

 

Configure the correct IP address ( in the same subnet) of SW1 and test connectivity with SERVER1 

 1. ONIE:/ # ifconfig eth0 192.168.1.201 netmask 255.255.255.0 

 

1. ONIE:/ # ip address show eth0 

2. eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000 

3. link/ether 0c:46:27:2a:00:00 brd ff:ff:ff:ff:ff:ff 

4. inet 192.168.1.200/24 brd 192.168.200.255 scope global eth0 

5. valid_lft forever preferred_lft forever 

6. inet6 fe80::e46:27ff:fe2a:0/64 scope link 

7. valid_lft forever preferred_lft forever 

 

1. ONIE:/ # ping 192.168.1.200 

2. PING 192.168.1.200 (192.168.1.200): 56 data bytes 

3. 64 bytes from 192.168.1.200: seq=0 ttl=64 time=0.099 ms 

4. 64 bytes from 192.168.1.200: seq=1 ttl=64 time=0.061 ms 

5. 64 bytes from 192.168.1.200: seq=2 ttl=64 time=0.060 ms 

 

Step 2: Install SONiC on a switch SW1 

 1. Stop the ONIE discovery service and install the SONiC image. 

 2. ONIE:/ # 

 3. ONIE:/ # onie-stop 

 4. discover: installer mode detected. 

 5. Stopping: discover done. 

 6. ONIE:/ # onienos-install http://192.168.1.200/soniclab.bin 

 7. discover: installer mode detected. 

 8. Stopping: discover done. 

 9. Info: Attempting http://192.168.1.200/sonic-lab.bin … 

10. Connecting to 192.168.1.200 (192.168.1.200:80) 

 

Step 3: Verify the installed SONiC on SW1 switch. 

 1. Log in to the SONiC using the default login credentials. 

 2. sonic login: admin 

 3. Password: 

 4. Linux sonic 5.10.082amd64 #1 SMP Debian 5.10.46-4 (2021-08-03) 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@sonic:~$Â