2 – SONiC Interfaces Configuration

SONiC Interfaces Configuration

In this article we will explore how to configure interfaces on Enterprise SONiC. We will cover:

  • Setting interface speed
  • Shutting and enabling interfaces
  • Assigning IP addresses

1 – Configuring Interface speed

You can configure interface speed manually or allow it to auto-negotiate.

Example Switch 1
Switch-1# configure terminal
Switch-1(config)# interface Ethernet 1
Switch-1(config-if- Ethernet1)# speed 10000
Example Switch 2
Switch-2# configure terminal
Switch-2(config)# interface Ethernet 1
Switch-2(config-if- Ethernet1)# speed 25000

2 – Disabling and Enabling Interfaces

An interface can be administratively disabled (shutdown) or enabled (no shutdown).

Disabling an interface
Switch-1(config)# interface Ethernet 2
Switch-1(config-if-Ethernet2)# shutdown
Enabling an interface
Switch-1(config)# interface Ethernet 2
Switch-1(config-if-Ethernet2)# no shutdown
Verifying interface status

To verify an interface status use the command show interfaces <interface name> 

sonic(config-if-Ethernet2)# show interface Ethernet2
Ethernet2 is up, line protocol is down, reason phy-link-down
Hardware is Eth, address is 0c:64:56:3b:00:0a
IP MTU 9100 bytes
LineSpeed 10G, Auto-negotiation off
 

3 – Assigning IP Address

IP addresses can be assigned to routed interfaces or VLAN interfaces.

Assign IP to a Physical Interface:
Switch-1# configure terminal
Switch-1(config)# interface Ethernet 3
Switch-1(config-if-Ethernet3)# ip address 10.1.1.1/24
Assign IP to a VLAN Interface:
Switch-2# configure terminal
Switch-2(config)# interface Vlan 20
Switch-2(config-if-Vlan20)# ip address 10.1.20.1/24
Verify configuration:
Switch-1# show ip interfaces
Interface   IP Address    Status
Ethernet3   10.1.1.1/24   up
Vlan20      10.1.20.1/24  up
Notes
  • Use show interfaces to confirm speed and admin/operational state.
  • Use show ip interface to confirm IP assignment.
  • Use ping to test connectivity.
  • Speed setting must be supported by both ends of the link.
  • IP addresses can be configured on routed ports or SVIs (Switch Virtual Interfaces).