Skip to content
Ask AI

Interface Basic Configuration

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

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
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 [ethernetinterface-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****Description
LanesInternal chip interface ID
FECInterface FEC mode
AliasInterface alias
OperPhysical link UP/Down status of the interface
AdminEnable UP/Down status for interface business
TypeOptical module type

show counters interface [ethernet [Command]****show counters interface [ethernetinterface-name**]**

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

[Purpose] Show interface count

[Parameter]

ParameterDescription
interface-nameInterface 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 ethernetinterface-name

[Purpose] Switch to ethernet view

[Parameter]

ParameterDescription
interface-nameInterface 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] speedspeed

[Purpose] Configure the interface rate

[Parameter]

ParameterDescription
speedRate 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] mtumtu

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

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