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 up 1000M up up Ethernet1
Ethernet2 up 1000M up up Ethernet2
Ethernet3 down 1000M down up Ethernet3
Ethernet4 up 1000M up up Ethernet4
Ethernet5 down 1000M down up Ethernet5
Ethernet6 down 1000M down up Ethernet6
Ethernet7 down 1000M down up Ethernet7
Ethernet8 down 1000M down up Ethernet8
Ethernet9 down 2.5G down up Ethernet9
Ethernet10 up 1000M up up Ethernet10
Ethernet11 down 2.5G down up Ethernet11
Ethernet12 up 2.5G up up Ethernet12
Ethernet13 down 10G down up Ethernet13
Ethernet14 up 10G up up Ethernet14
Ethernet15 up 10G up up Ethernet15
Ethernet16 up 10G up up Ethernet16

show interface transceiver {eeprom|lpmode|presence}

Section titled “show interface transceiver {eeprom|lpmode|presence}”

[Command]

show interface transceiver {eeprom|lpmode|presence}

[Purpose]

Display of optical module information

[Parameter]

eeprom Display interface transceiver EEPROM information

lpmode Display interface transceiver low power mode

presence Display module in-position information

[View]

System view

[Use Cases]

sonic# show interface transceiver eeprom
Ethernet14: SFP EEPROM detected
Application Advertisement: N/A
Connector: LC
Encoding: 64B/66B
Extended Identifier: GBIC/SFP defined by two-wire interface ID
Extended RateSelect Compliance: Unknown
Identifier: SFP/SFP+/SFP28
Length OM3(10m): 30.0
Nominal Bit Rate(100Mbs): 103
Specification compliance:
10G Ethernet Compliance: 10GBASE-SR
ESCON Compliance: Unknown
Ethernet Compliance: Unknown
Fibre Channel Link Length: Intermediate distance (I)
Fibre Channel Speed: Unknown
Fibre Channel Transmission Media: Unknown
Fibre Channel Transmitter Technology: Shortwave laser w/o OFC (SN)
Infiniband Compliance: Unknown
SFP+CableTechnology: Unknown
SONET Compliance Codes: Unknown
Vendor Date Code(YYYY-MM-DD Lot): 2018-07-03
Vendor Name: OEM
Vendor OUI: 00-00-00
Vendor PN: TSSP85B33CDL03
Vendor Rev: A
Vendor SN: STST85S82700095
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-name]

[Purpose]

Display interface details

[View]

System view

[Use Cases]

sonic# show interface port
Ethernet1 is up, line protocol is up
Hardware is Eth
Interface index is 1
Description:
IPV4 address is 192.168.2.217/24
Mode of IPV4 address assignment: MANUAL
Mode of IPV6 address assignment: not-set
IP MTU 9100 bytes
LineSpeed 1.0G
Input statistics:
23794823 packets, 2029335221 octets
63489 Multicasts, 680223 Broadcasts, 23051111 Unicasts
0 error, 0 discarded
0 ipv4Packets, 0 ipv4Octets
0 ipv6Packets, 0 ipv6Octets
Output statistics:
14181183 packets, 1219985112 octets
0 Multicasts, 0 Broadcasts, 14181183 Unicasts
0 error, 0 discarded
0 ipv4Octets, 0 ipv6Octets

[Command]

show interface status

[Purpose]

Show interface status

[View]

System view

[Use Cases]

sonic# show interface status
Interface Lanes Speed MTU FEC Alias Vlan Oper Admin Type Asym PFC
----------- ------- ------- ----- ----- ---------- ------ ------ ------- -------------- ----------
Ethernet1 0 1000M 9100 none Ethernet1 routed up up RJ45 N/A
Ethernet2 1 1000M 9100 none Ethernet2 routed up up RJ45 N/A
Ethernet3 2 1000M 9100 none Ethernet3 routed down up RJ45 N/A
Ethernet4 3 1000M 9100 none Ethernet4 routed up up RJ45 N/A
Ethernet5 4 1000M 9100 none Ethernet5 routed down up RJ45 N/A
Ethernet6 5 1000M 9100 none Ethernet6 routed down up RJ45 N/A
Ethernet7 6 1000M 9100 none Ethernet7 routed down up RJ45 N/A
Ethernet8 7 1000M 9100 none Ethernet8 routed down up RJ45 N/A
Ethernet9 8 2.5G 9100 none Ethernet9 routed down up RJ45 N/A
Ethernet10 9 1000M 9100 none Ethernet10 routed up up RJ45 N/A
Ethernet11 10 2.5G 9100 none Ethernet11 routed down up RJ45 N/A
Ethernet12 11 2.5G 9100 none Ethernet12 routed up up RJ45 N/A
Ethernet13 12 10G 9100 none Ethernet13 routed down up N/A N/A
Ethernet14 13 10G 9100 none Ethernet14 routed up up SFP/SFP+/SFP28 N/A
Ethernet15 14 10G 9100 none Ethernet15 routed up up SFP/SFP+/SFP28 N/A
Ethernet16 15 10G 9100 none Ethernet16 routed up up SFP/SFP+/SFP28 N/A

Show interface status Command Display Description Table

Field

Describe

Lanes Internal chip interface ID
FEC Interface FEC mode
Alias Interface alias
Oper Physical link UP/Down status of the interface
Admin Enable UP/Down status for interface business
Type Optical module type

show counters interface [ethernet interface-name]

Section titled “show counters interface [ethernet interface-name]”

[Command]

show counters interface [ethernet interface-name]

[Purpose]

Show interface count

[Parameter]

interface-name Interface name

[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
---------- ------- ---------- ----------- --------- -------- -------- -------- ---------- ---------- --------- -------- -------- --------
Ethernet1 U 23,799,337 6421.08 B/s 0.01% 0 0 0 14,181,350 354.74 B/s 0.00% 0 0 0
Ethernet2 U 223 0.00 B/s 0.00% 0 0 0 256 40.79 B/s 0.00% 0 0 0
Ethernet3 D 0 0.00 B/s 0.00% 0 0 0 0 0.00 B/s 0.00% 0 0 0
Ethernet4 U 1,611 0.45 B/s 0.00% 0 0 0 2,838 41.07 B/s 0.00% 0 0 0
Ethernet5 D 0 0.00 B/s 0.00% 0 0 0 0 0.00 B/s 0.00% 0 0 0
Ethernet6 D 0 0.00 B/s 0.00% 0 0 0 0 0.00 B/s 0.00% 0 0 0
Ethernet7 D 0 0.00 B/s 0.00% 0 0 0 0 0.00 B/s 0.00% 0 0 0
Ethernet8 D 0 0.00 B/s 0.00% 0 0 0 0 0.00 B/s 0.00% 0 0 0
Ethernet9 D 0 0.00 B/s 0.00% 0 0 0 0 0.00 B/s 0.00% 0 0 0
Ethernet10 U 0 0.00 B/s 0.00% 0 0 0 257 40.97 B/s 0.00% 0 0 0
Ethernet11 D 0 0.00 B/s 0.00% 0 0 0 0 0.00 B/s 0.00% 0 0 0
Ethernet12 U 252 0.32 B/s 0.00% 0 0 0 258 40.97 B/s 0.00% 0 0 0
Ethernet13 D 0 0.00 B/s 0.00% 0 0 0 0 0.00 B/s 0.00% 0 0 0
Ethernet14 U 0 0.00 B/s 0.00% 0 0 0 0 0.00 B/s 0.00% 0 0 0
Ethernet15 U 257 0.28 B/s 0.00% 0 0 0 257 40.97 B/s 0.00% 0 0 0
Ethernet16 U 538 33.90 B/s 0.00% 0 0 0 1 0.00 B/s 0.00% 0 0 0

[Command]

clear counters interface

[Purpose]

Clear interface count

[View]

System view

[Use Cases]

sonic# clear counters interface
Cleared counters

[Command]

interface ethernet interface-name

[Purpose]

Switch to ethernet view

[Parameter]

interface-name Interface name

[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]

speed speed

[Purpose]

Configure the interface rate

[Parameter]

speed Rate in Mbit. Selectable 1000/2500/10000

[View]

Interface view

[Use Cases]

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

[Command]

mtu mtu

[Purpose]

Configure interface MTU

[Parameter]

mtu Maximum 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

[Purpose]

Configure interface delayed start time

[Parameter]

time Value 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]

description Interface 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]

autoneg

[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)# autoneg

[Command]

router-interface

no router-interface

[Purpose]

Convert a port from a Layer 2 interface to a Layer 3 interface / Disable the Layer 3 interface and convert it back to a Layer 2 interface.

[View]

Interface View

[Usage Scenario]

The `router-interface` command is commonly used to configure Layer 3 interfaces on devices.

When it is necessary to use an interface solely for Layer 2 forwarding, such as enabling communication between different VLANs without utilizing Layer 3 routing functions, the `no router-interface` command can be used on the interface to disable the Layer 3 functionality of the physical interface. This simplifies network configuration, enhances security, and facilitates troubleshooting.

[Notes]

- Before configuring `router-interface` on an interface, check if the interface has removed Layer 2 configurations such as VLANs before converting it to a Layer 3 interface.

- Before deleting `router-interface` from an interface, check if the interface has an IP address configured. Remove the relevant Layer 3 configurations first before converting it back to a Layer 2 interface.

[Use Cases]

sonic# configure terminal
sonic(config)# interface ethernet 1
sonic(config-if-1)# router-interface
sonic(config-if-1)# no router-interface

show sub-interface [ethernet interface-name.subinterface-number]

Section titled “show sub-interface [ethernet interface-name.subinterface-number]”

[Command]

show sub-interface [ethernet interface-name.subinterface-number |status]

[Purpose]

Display sub-interface status information

[Parameter]

interface-name Parent interface name

subinterface-number Sub-interface ID

[View]

System view

[Use Cases]

sonic# show sub-interface status

interface sub-ethernet interface-name.subinterface-number

Section titled “interface sub-ethernet interface-name.subinterface-number”

[Command]

interface sub-ethernet interface-name.subinterface-number

no interface sub-ethernet interface-name.subinterface-number

[Purpose]

Add sub-interface

[Parameter]

interface-name Parent interface name

subinterface-number Sub-interface ID

[View]

System configuration view

[Use Cases]

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

[Command]

interface loopback loopback-id

[Purpose]

Switch to loopback view

[Parameter]

loopback-id Loopback 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]

A.B.C.D/M IP 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-10
sonic(config-port-group-1-10)# switchport vlan access 10