Enterprise SONiC Bootcamp Register Now

SONiC Course Deals! Black Friday
Sign Up

Module 3 Lab 3 - Basic Interface Configuration

You are a network engineer tasked with configuring a new switch. The switch will be connected to a few devices such as servers and workstations. To enable communication between these devices, you need to configure basic interface settings on the switch. This involves configuring IP addresses, setting port speeds, and bringing the port up to ensure it is active. Your goal is to configure the interfaces on the switch so that all devices can communicate with each other seamlessly

  • Step 1: Check the default port settings.  

Log in to the switches (SW1, SW2) using the default credentials, use the Klish CLI and view the port settings. 

  • Step 2: Check portgroup 

Please verify if there is a port group configured on the switches. If a port group exists, please check how many ports belong to the group and what speeds are supported by the group. 

  • Step 3: Set the port speed to 10G 

Set the speed of the Ethernet0 port to SW1 and SW2 to 10G. 

  • Step 4: Set the IP address and enable the ports. 

Configure the IP address on Ethernet0 port of SW1 device to 1.0.0.1 with subnet mask 255.255.255.0. Similarly, configure the IP address on Ethernet0 port of SW2 device to 1.0.0.2 with subnet mask 255.255.255.0 

  • Step 5: Check that everything is working using the PING command. 

Use the ping command to mutually ping the devices SW1 and SW2

switch1 switch2
  • Default credentials: admin / YourPaSsWoRd 
  • Some platforms (mainly 25G switches) require a group of ports to have the “same” speed (1G/10G or 25G)​ 
  • Our switch has a portgroup of 4 ports each i.e. Ethernet0-3, Ethernet4-7 etc. 
  • In SONiC, the subnet mask 255.255.255.0 is represented in the format of x.x.x.x/24. This is because the number 24 represents the number of bits set to 1 in the subnet mask, which is equivalent to 255.255.255.0 in dotted decimal notation.

Step 1: Check the default port settings. 

SW1: 

 1. sonic# show interface status 

 2. ————————————————————————————————————————- 

 3. Name                Description                   Oper           Reason         AutoNeg   Speed          MTU            Alternate Name 

 4. ————————————————————————————————————————- 

 5. Ethernet0                                        down           admindown     off       25000          9100           Eth1/1 

 6. Ethernet1                                        down           admindown     off       25000          9100           Eth1/2 

 7. Ethernet2                                        down           admindown     off       25000          9100           Eth1/3 

 8. Ethernet3                                        down           admindown     off       25000          9100           Eth1/4 

 9. Ethernet4                                        down           admindown     off       25000          9100           Eth1/5 

10. ————————————————————————————————————————- 

11. Ethernet60                                       down           admindown     off       100000         9100           Eth1/52 

12. Ethernet64                                       down           admindown     off       100000         9100           Eth1/53 

13. Ethernet68                                       down           admindown     off       100000         9100           Eth1/54 

14. Ethernet72                                       down           admindown     off       100000         9100           Eth1/55 

15. Ethernet76                                       down           admindown     off       100000         9100           Eth1/56 

SW2: 

 1. sonic# show interface status 

 2. ————————————————————————————————————————————– 

 3. Name                Description                   Oper           Reason         AutoNeg   Speed          MTU            Alternate Name 

 4. ————————————————————————————————————————————– 

 5. Ethernet0                                        down           admindown     off       25000          9100           Eth1/1 

 6. Ethernet1                                        down           admindown     off       25000          9100           Eth1/2 

 7. Ethernet2                                        down           admindown     off       25000          9100           Eth1/3 

 8. Ethernet3                                        down           admindown     off       25000          9100           Eth1/4 

 9. Ethernet4                                        down           admindown     off       25000          9100           Eth1/5 

10. ————————————————————————————————————————————– 

11. Ethernet60                                       down           admindown     off       100000         9100           Eth1/52 

12. Ethernet64                                       down           admindown     off       100000         9100           Eth1/53 

13. Ethernet68                                       down           admindown     off       100000         9100           Eth1/54 

14. Ethernet72                                       down           admindown     off       100000         9100           Eth1/55 

15. Ethernet76                                       down           admindown     off       100000         9100           Eth1/56 

 

Step 2: Check portgroup 

SW1: 

 1. admin@sonic:~$ soniccli 

 2. sonic# show port-group 

 3. ————————————————————————————- 

 4. Portgroup  Interface range            Valid speeds      Default Speed Current Speed 

 5. ————————————————————————————- 

 6. 1           Ethernet0 Ethernet3      10G, 25G          25G           25G 

 7. 2           Ethernet4 Ethernet7      10G, 25G          25G           25G 

 8. 3           Ethernet8 Ethernet11     10G, 25G          25G           25G 

 9. 4           Ethernet12 Ethernet15    10G, 25G          25G           25G 

10. 5           Ethernet16 Ethernet19    10G, 25G          25G           25G 

11. 6           Ethernet20 Ethernet23    10G, 25G          25G           25G 

12. 7           Ethernet24 Ethernet27    10G, 25G          25G           25G 

13. 8           Ethernet28 Ethernet31    10G, 25G          25G           25G 

14. 9           Ethernet32 Ethernet35    10G, 25G          25G           25G 

15. 10          Ethernet36 Ethernet39    10G, 25G          25G           25G 

16. 11          Ethernet40 Ethernet43    10G, 25G          25G           25G 

17. 12          Ethernet44 Ethernet47    10G, 25G          25G           25G 

 

SW2: 

 1. admin@sonic:~$ soniccli 

 2. sonic# show port-group 

 3. ————————————————————————————- 

 4. Portgroup  Interface range            Valid speeds      Default Speed Current Speed 

 5. ————————————————————————————- 

 6. 1           Ethernet0 Ethernet3      10G, 25G          25G           25G 

 7. 2           Ethernet4 Ethernet7      10G, 25G          25G           25G 

 8. 3           Ethernet8 Ethernet11     10G, 25G          25G           25G 

 9. 4           Ethernet12 Ethernet15    10G, 25G          25G           25G 

10. 5           Ethernet16 Ethernet19    10G, 25G          25G           25G 

11. 6           Ethernet20 Ethernet23    10G, 25G          25G           25G 

12. 7           Ethernet24 Ethernet27    10G, 25G          25G           25G 

13. 8           Ethernet28 Ethernet31    10G, 25G          25G           25G 

14. 9           Ethernet32 Ethernet35    10G, 25G          25G           25G 

15. 10          Ethernet36 Ethernet39    10G, 25G          25G           25G 

16. 11          Ethernet40 Ethernet43    10G, 25G          25G           25G 

17. 12          Ethernet44 Ethernet47    10G, 25G          25G           25G 

 

Step 3: Set the port speed to 10G 

SW1: 

 1. sonic# configure terminal 

 2. sonic(config)# portgroup 1 speed 10000 

 3. sonic(config)# show portgroup 

 4. ————————————————————————————- 

 5. Portgroup  Interface range            Valid speeds      Default Speed Current Speed 

 6. ————————————————————————————- 

 7. 1           Ethernet0 Ethernet3      10G, 25G          25G           10G 

 8. 2           Ethernet4 Ethernet7      10G, 25G          25G           25G 

 9. 3           Ethernet8 Ethernet11     10G, 25G          25G           25G 

10. 4           Ethernet12 Ethernet15    10G, 25G          25G           25G 

11. 5           Ethernet16 Ethernet19    10G, 25G          25G           25G 

12. 6           Ethernet20 Ethernet23    10G, 25G          25G           25G 

13. 7           Ethernet24 Ethernet27    10G, 25G          25G           25G 

14. 8           Ethernet28 Ethernet31    10G, 25G          25G           25G 

15. 9           Ethernet32 Ethernet35    10G, 25G          25G           25G 

16. 10          Ethernet36 Ethernet39    10G, 25G          25G           25G 

17. 11          Ethernet40 Ethernet43    10G, 25G          25G           25G 

18. 12          Ethernet44 Ethernet47    10G, 25G          25G           25G 

 

 
SW2: 

 1. sonic# configure terminal 

 2. sonic(config)# portgroup 1 speed 10000 

 3. sonic(config)# show portgroup 

 4. ————————————————————————————- 

 5. Portgroup  Interface range            Valid speeds      Default Speed Current Speed 

 6. ————————————————————————————- 

 7. 1           Ethernet0 Ethernet3      10G, 25G          25G           10G 

 8. 2           Ethernet4 Ethernet7      10G, 25G          25G           25G 

 9. 3           Ethernet8 Ethernet11     10G, 25G          25G           25G 

10. 4           Ethernet12 Ethernet15    10G, 25G          25G           25G 

11. 5           Ethernet16 Ethernet19    10G, 25G          25G           25G 

12. 6           Ethernet20 Ethernet23    10G, 25G          25G           25G 

13. 7           Ethernet24 Ethernet27    10G, 25G          25G           25G 

14. 8           Ethernet28 Ethernet31    10G, 25G          25G           25G 

15. 9           Ethernet32 Ethernet35    10G, 25G          25G           25G 

16. 10          Ethernet36 Ethernet39    10G, 25G          25G           25G 

17. 11          Ethernet40 Ethernet43    10G, 25G          25G           25G 

18. 12          Ethernet44 Ethernet47    10G, 25G          25G           25G 

Step 4: Set the IP address and enable the ports. 

SW1: 

1. sonic(config)# interface Ethernet0 

2. sonic(confifEthernet0)# ip address 1.0.0.1/24 

3. sonic(confifEthernet0)# no shutdown 

4. sonic(confifEthernet0)# end 

SW2: 

1. sonic(config)# interface Ethernet0 

2. sonic(confifEthernet0)# ip address 1.0.0.2/24 

3. sonic(confifEthernet0)# no shutdown 

4. sonic(confifEthernet0)# end 

tep 5: Check that everything is working using the PING command. 

SW1: 

 1. sonic# show interface status 

 2. ————————————————————————————————————————————– 

 3. Name                Description                   Oper           Reason         AutoNeg   Speed          MTU            Alternate Name 

 4. ————————————————————————————————————————————– 

 5. Ethernet0                                        up             operup        off       10000          9100           Eth1/1 

 6. Ethernet1                                        down           admindown     off       10000          9100           Eth1/2 

 7. Ethernet2                                        down           admindown     off       10000          9100           Eth1/3 

 8. Ethernet3                                        down           admindown     off       10000          9100           Eth1/4 

 9. Ethernet4                                        down           admindown     off       25000          9100           Eth1/5 

10. Ethernet60                                       down           admindown     off       100000         9100           Eth1/52 

11. Ethernet64                                       down           admindown     off       100000         9100           Eth1/53 

12. Ethernet68                                       down           admindown     off       100000         9100           Eth1/54 

13. Ethernet72                                       down           admindown     off       100000         9100           Eth1/55 

14. Ethernet76                                       down           admindown     off       100000         9100           Eth1/56 

 
1. sonic# show ip interfaces 

2. Flags: UUnnumbered interface, AAnycast IP 

3. —————————————————————————————————————– 

4. Interface            IP address/mask                              VRF                 Admin/Oper     Flags 

5. —————————————————————————————————————– 

6. Ethernet0            1.0.0.1/24                                                       up/up  

1. sonic# ping 1.0.0.2 

2. PING 1.0.0.2 (1.0.0.2) 56(84) bytes of data. 

3. 64 bytes from 1.0.