Skip to content

Interface Management

The interface contains various information about the interface and the status of the interface. It is worth noting that when viewing interface information, multiple interfaces are displayed, so the command keyword is “interfaces” in plural form; while when configuring interfaces, they are configured one by one, so the keyword “interface” is used in singular form.

[Command]
show interface description

[Purpose]
Display individual interface description information

[View]
System view

[Use Cases]

sonic# show interface description
Interface Oper Admin Alias Description
----------- ------ ------- ---------- -------------
Ethernet1 down up Ethernet1 N/A
Ethernet2 down up Ethernet2 N/A
Ethernet3 down up Ethernet3 N/A
Ethernet4 down up Ethernet4 N/A
Ethernet5 down up Ethernet5 N/A
Ethernet6 down up Ethernet6 N/A

[Command]
show interface transceiver {eeprom|lpmode|presence}

[Purpose]
Display of optical module information

[Parameter]

ParameterDescription
eepromDisplay interface transceiver EEPROM information
lpmodeDisplay interface transceiver low power mode
presenceDisplay module in-position information

[View]
System view

[Use Cases]

sonic# show interface transceiver eeprom
Ethernet48: SFP EEPROM Not detected
Ethernet49: SFP EEPROM detected
Connector: LC
Encoding: 64B/66B
Extended Identifier: GBIC/SFP defined by twowire interface ID
Extended RateSelect Compliance: Unspecified
Identifier: SFP/SFP+/SFP28
LengthOM3(UnitsOf10m): 0
Nominal Bit Rate(100Mbs): 103
Specification compliance:
10GEthernetComplianceCode: 10G Base-LR
FibreChannelLinkLength: Long distance (L)
FibreChannelSpeed: 1200 MBytes/sec
FibreChannelTechnology: Longwave Laser (LC)
FibreChannelTransmissionMedia: Single Mode (SM)
Vendor Date Code(YYYY-MM-DD Lot): 2018-07-21
Vendor Name: OEM
Vendor OUI: 00-00-00
Vendor PN: TSSP31B33CDL10
Vendor Rev: A
Vendor SN: STST31182900045
sonic# show interface transceiver lpmode
Port Low-power Mode
---------- ----------------
Ethernet1 Off
Ethernet2 Off
sonic# show interface transceiver presence
Port Presence
---------- -----------
Ethernet1 Not present
Ethernet2 Not present

[Command]
show interface port ethernet interface_id

[Purpose]
Display interface details

[View]
System view

[Use Cases]

sonic# show interface port
Ethernet1 is up, line protocol is down
Hardware is Eth
Interface index is 1
Description:
Mode of IPV4 address assignment: not-set
Mode of IPV6 address assignment: not-set
IP MTU 9216 bytes
LineSpeed 1G, Auto-negotiation off
Input statistics:
0 packets, 0 octets
0 Multicasts, 0 Broadcasts, 0 Unicasts
0 error, 0 discarded
0 ipv4Packets, 0 ipv4Octets
0 ipv6Packets, 0 ipv6Octets
Output statistics:
0 packets, 0 octets
0 Multicasts, 0 Broadcasts, 0 Unicasts
0 error, 0 discarded
0 ipv4Octets, 0 ipv6Octets

[Command]
show interface status

[Purpose]
Display interface staus

[View]
System view

[Use Cases]

sonic# show interface status
Interface Lanes Speed MTU FEC Alias Oper Admin Type Asym PFC
----------- ----------- ------- ----- ----- ------- ------ ------- -------------- ----------
Ethernet1 0 25G 9216 rs Y1 down up SFP/SFP+/SFP28 N/A
Ethernet2 1 10G 9216 none Y2 up up SFP/SFP+/SFP28 N/A
Ethernet3 2 25G 9216 rs Y3 down up SFP/SFP+/SFP28 N/A
Ethernet4 3 25G 9216 rs Y4 down up N/A N/A
Ethernet5 4 25G 9216 rs Y5 down up N/A N/A
Ethernet6 5 25G 9216 rs Y6 down up N/A N/A
Ethernet7 6 25G 9216 rs Y7 down up N/A N/A
Ethernet8 7 25G 9216 rs Y8 down up N/A N/A
Ethernet9 8 25G 9216 rs Y9 down up N/A N/A
Ethernet10 9 25G 9216 rs Y10 down up N/A N/A
Ethernet46 45 25G 9216 rs Y46 down up N/A N/A
Ethernet47 46 25G 9216 rs Y47 down up N/A N/A
Ethernet48 47 25G 9216 rs Y48 down up N/A N/A
Ethernet49 48,49,50,51 100G 9216 rs C1 down up N/A N/A
Ethernet53 52,53,54,55 100G 9216 rs C2 down up N/A N/A
Ethernet57 56,57,58,59 100G 9216 rs C3 down up N/A N/A
Ethernet61 64,65,66,67 100G 9216 rs C4 down up N/A N/A
Ethernet65 68,69,70,71 100G 9216 rs C5 down up N/A N/A
Ethernet69 72,73,74,75 100G 9216 rs C6 down up N/A N/A
Ethernet73 76,77,78,79 100G 9216 rs C7 down up N/A N/A
Ethernet77 80,81,82,83 100G 9216 rs C8 down up N/A N/A

[Command]
show counters interface ethernet interface_id

[Purpose]
Show interface count

[Parameter]

ParameterDescription
interface_idInterface id

[View]
System view

[Use Cases]

sonic# show counters interface
IFACE STATE RX_OK RX_BPS RX_UTIL RX_ERR RX_DRP RX_OVR TX_OK TX_BPS TX_UTIL TX_ERR TX_DRP TX_OVR
-------------------------------------------------------------------------------------------------
Ethernet0 D 0 N/A N/A 0 0 0 0 N/A N/A 0 0 N/A
Ethernet1 U 0 N/A N/A 0 0 0 27 N/A N/A 0 0 N/A
Ethernet2 U 0 N/A N/A 0 0 0 27 N/A N/A 0 0 N/A
Ethernet3 U 0 N/A N/A 0 0 0 35 N/A N/A 0 0 N/A
Ethernet4 X 0 N/A N/A 0 0 0 0 N/A N/A 0 0 N/A

[Command]
show link-flapping config

[Purpose]
Show interface link-flapping configuration

[View]
System view

[Use Cases]

sonic# show link-flapping config
+-------------+----------+------------+-------------+------------+
| Port | Detect | Interval | Threshold | Action |
+=============+==========+============+=============+============+
| Ethernet129 | enable | 60 | 5 | error-down |
+-------------+----------+------------+-------------+------------+

[Command]
show interface errdown

[Purpose]
Display the err-disable state of all interfaces

[View]
System view

[Notes]

Once an interface enters the errdown state, it cannot recover automatically. Manual restoration by executing the shutdown/no shutdown command in the interface view is required.

[Use Cases]

sonic# show interface errdown
Interface Status Reason
--------------- -------- --------
Ethernet1 up None
Ethernet5 up None
Ethernet9 up None
Ethernet13 up None
Ethernet17 up None
Ethernet21 up None
Ethernet25 up None
Ethernet29 up None
Ethernet33 up None
Ethernet37 up None
Ethernet41 up None
Ethernet45 up None
Ethernet49 up None
Ethernet53 up None
Ethernet57 up None
Ethernet61 up None
Ethernet65 up None
Ethernet69 up None
Ethernet73 up None
Ethernet77 up None
Ethernet81 up None
Ethernet85 up None
Ethernet89 up None
Ethernet93 up None
Ethernet97 up None
Ethernet101 up None
Ethernet105 up None
Ethernet109 up None
Ethernet113 up None
Ethernet117 errdown Link flap
Ethernet121 up None
Ethernet125 up None
Ethernet129 up None
Ethernet130 up None

[Command]
clear counters interface

[Purpose]
Clear interface count

[View]
System view

[Use Cases]

sonic# clear counters interface
Cleared counters

[Command]
interface ethernet interface_id

[Purpose]
Switch to ethernet view

[Parameter]

ParameterDescription
interface_idInterface id

[View]
System configuration view

[Use Cases]

sonic# configure terminal
sonic(config)# interface ethernet 1
sonic(config-if-1)# show this
!
interface ethernet 1

[Command]
shutdown no shutdown

[Purpose]
Shutdown interface

[View]
Interface view

[Usage Scenario]
When you have made changes to the interface’s operational parameters, and the new configuration does not take effect immediately, you can use the “shutdown” and “undo shutdown” commands to disable and re-enable the interface to apply the new configuration. Also, when an interface is idle, it is advisable to use the “shutdown” command to deactivate that interface. This helps prevent any issues that may arise due to interference on the interface when it’s not in use.

[Use Cases]

sonic# configure terminal
sonic(config)# interface ethernet 1
sonic(config-if-1)# shutdown
sonic(config-if-1)# show this
!
interface ethernet 1
shutdown

[Command]
link-flapping detect enable

no link-flapping detect enable

[Purpose]
Enable/disable the link-flapping feature on the interface.

[View]
Interface view

[Use Cases]

sonic# configure terminal
sonic(config)# interface ethernet 121
sonic(config-if-121)# link-flapping detect enable
sonic(config-if-121)#

[Command]
link-flapping detect-action error-down

no link-flapping detect-action error-down

[Purpose]
Configure/Remove the interface status after the link-flapping threshold is triggered.

[View]
Interface view

[Usage Scenario]
When the device interface frequently alternates between UP and DOWN states, it will proactively enter the errdisable state.

[Notes]

Once an interface enters the errdisable state, it cannot recover automatically; manual restoration by executing the shutdown/no shutdown command in the interface view is required.

[Use Cases]

sonic# configure terminal
sonic(config)# interface ethernet 121
sonic(config-if-121)# link-flapping detect-action error-down

[Command]
link-flapping detect-interval time

no link-flapping detect-interval

[Purpose]
Configure/Remove the link-flapping monitoring period.

[Parameter]

ParameterDescription
timeInterface UP/DOWN monitoring period; Unit: seconds; Range: 5-60.

[View]
Interface view

[Use Cases]

sonic# configure terminal
sonic(config)# interface ethernet 121
sonic(config-if-121)# link-flapping detect-interval 30

[Command]
link-flapping detect-threshold threshold_num

no link-flapping detect-threshold

[Purpose]
Configure/Remove the threshold for frequent interface UP/DOWN events.

[Parameter]

ParameterDescription
threshold_numInterface UP/DOWN count; Range: 5-30.

[View]
Interface view

[Use Cases]

sonic# configure terminal
sonic(config)# interface ethernet 121
sonic(config-if-121)# link-flapping detect-interval 30

[Command]
speed speed

[Purpose]
Configure the interface rate

[Parameter]

ParameterDescription
speedRate in Mbit. Selectable 10/100/1000/2500/10000/25000/40000/100000/auto.

[View]
Interface view

[Use Cases]

sonic# configure terminal
sonic(config)# interface ethernet 1
sonic(config-if-1)# speed 10000
sonic(config-if-1)# show this
!
interface ethernet 1
speed 10000

[Command]
limit-rate {ingress|egress} bind cir cbr

no limit-rate {ingress|egress} bind

[Purpose]
Configure interface rate limiting function

[Parameter]

ParameterDescription
cirSpecifes the committed information rate (CIR), which is the allowed rate at which trafc can pass through. (unit: KBytes)
cbrSpecifes the committed burst size (CBS), which is the average volume of burst trafc that can pass through an interface. (unit: Bytes)

[View]
Interface view

[Use Cases]

sonic# configure terminal
sonic(config)# interface ethernet 1
sonic(config-if-1)# limit-rate ingress bind 1000 100
sonic(config-if-1)# limit-rate egress bind 200 200
sonic(config-if-1)# show this
!
interface ethernet 1
limit-rate egress bind 200 200
limit-rate ingress bind 1000 100

[Command]
mtu mtu

[Purpose]
Configure interface MTU

[Parameter]

ParameterDescription
mtuMaximum Transmission Unit, Scope: 1312~9216

[View]
Interface view

[Use Cases]

sonic# configure terminal
sonic(config)# interface ethernet 1
sonic(config-if-1)# mtu 2000
sonic(config-if-1)# show this
!
interface ethernet 1
mtu 2000

[Command]
startup-delay time

no startup-delay

[Purpose]
Configure interface delayed start time

[Parameter]

ParameterDescription
timeValue range: 1-300, unit: s

[View]
Interface view

[Usage Scenario]
In unstable network environments, there may be situations where the device cannot obtain an IP address from the expected DHCP server. If the device acquires an IP address from another DHCP server, even after network recovery, it may remain unable to obtain an IP address from the desired subnet for an extended period. To avoid this scenario, users can specify a delay in port activation time for the device after a reboot, depending on the network conditions.

[Notes]
When the time parameter is configured to 0, it means no delayed start is enabled.

[Use Cases]

sonic(config)# interface ethernet 1
sonic(config-if-1)# startup-delay 100

[Command]
description description
no description

[Purpose]
Configure interface description information

[Parameter]

ParameterDescription
descriptionInterface description

[View]
Interface view

[Notes]
Only one description for an interface, which will be overwritten by multiple configurations.

[Use Cases]

sonic# configure terminal
sonic(config)# interface ethernet 1
sonic(config-if-1)# description abc
sonic(config-if-1)# show this
!
interface ethernet 1
description abc

[Command]
breakout {4x25G|4x10G|4x1G}
no breakout

[Purpose]
Configure static splitting for the interface

[Parameter]

ParameterDescription
4x25GSplit the 100G interface into 4x25G
4x10GSplit the 100G interface into 4x10G
4x1GSplit the 100G interface into 4x1G

[View]
Interface view

[Notes]
When splitting, do not check configuration dependencies; however, check the configuration dependencies for sub-interfaces 1-4 during merging. After splitting, a device restart is required for the changes to take effect

[Use Cases]

sonic(config)# interface ethernet 49
sonic(config-if-49)# breakout 4x25G

[Command]
speed auto

[Purpose]
Enable interface speed adaptation

[View]
Interface view

[Usage Scenario]
The device defaults to enabling interface speed auto-negotiation. After manually modifying the interface speed, this command can be used to restore the interface speed auto-negotiation feature.

[Use Cases]

sonic(config)# interface ethernet 1
sonic(config-if-1)# speed auto

[Command]
show sub-interface {ethernet interface_name.subinterface_number | status}

[Purpose]
Display sub-interface status information

[Parameter]

ParameterDescription
interface_nameParent interface name
subinterface_numberSub-interface ID

[View]
System view

[Use Cases]

sonic# show sub-interface status
+----------------------+-------+--------+---------+---------------------+
| Sub port interface | MTU | vlan | Admin | Type |
+======================+=======+========+=========+=====================+
| Eth1.3000 | 9216 | 3000 | up | dot1q-encapsulation |
+----------------------+-------+--------+---------+---------------------+
| Eth40.3000 | 9216 | 3000 | up | dot1q-encapsulation |
+----------------------+-------+--------+---------+---------------------+

[Command]
interface sub-ethernet interface_name.subinterface_number
no interface sub-ethernet interface_name.subinterface_number

[Purpose]
Add sub-interface

[Parameter]

ParameterDescription
interface_nameParent interface name
subinterface_numberSub-interface ID

[View]
System configuration view

[Notes]
If the sub-interface is configured with an IP address, the IP address of the sub-interface must be deleted before the sub-interface can be deleted.

[Use Cases]

sonic# configure terminal
sonic(config)# interface sub-ethernet 40.1000
sonic(config-if-40.1000)#

[Command]
interface loopback loopback_id

[Purpose]
Switch to loopback view

[Parameter]

ParameterDescription
loopback_idLoopback port ID

[View]
System configuration view

[Use Cases]

sonic# configure terminal
sonic(config)# interface loopback 0
sonic(config-loif-0)# show this
!
interface loopback 0

[Command]
ip address A.B.C.D/M

[Purpose]
Adding an IP address to the loopback port

[Parameter]

ParameterDescription
A.B.C.D/MIP address with prefix length

[View]
System configuration view

[Notes]
The IPv4 address configured on the Loopback port is not allowed to be deleted and can be overwritten by reconfiguration.

[Use Cases]

sonic# configure terminal
sonic(config)# interface loopback 2
sonic(config-loif-2)# ip address 3.3.3.6/24
sonic(config-loif-2)# show this
!
interface loopback 2
ip address 3.3.3.6/24

[Command]
port-group ethernet interface_range

[Purpose]
Create port group

[View]
System configuration view

[Usage Scenario]
Creating an interface group is designed to facilitate the identical configuration of multiple Ethernet interfaces. Configuring each interface individually can easily lead to errors and result in a significant amount of repetitive work. By establishing an interface group, it becomes possible to centrally manage the configuration of these interfaces, thereby enhancing efficiency and reducing the likelihood of configuration errors.

[Use Cases]

sonic(config)# port-group ethernet 1-20
sonic(config-port-group-1-20)# switchport vlan access 10

[Command]
port-group lag lag_range

[Purpose]
Create lag group

[View]
System configuration view

[Usage Scenario]
Creating a lag group is designed to facilitate the identical configuration of multiple lags. Configuring each lag individually can easily lead to errors and result in a significant amount of repetitive work. By establishing an lag group, it becomes possible to centrally manage the configuration of these lags, thereby enhancing efficiency and reducing the likelihood of configuration errors.

[Use Cases]

sonic(config)# port-group lag 1-20
sonic(config-lag-group-1-20)# switchport vlan access 10