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.
Interface Basic Configuration
Section titled “Interface Basic Configuration”show interface description
Section titled “show interface description”[Command]
show interface description
[Purpose]
Display individual interface description information
[View]
System view
[Use Cases]
sonic# show interface descriptionInterface Oper Admin Alias Description---------- ---- ----------- ------ ------- ---------- -------------Ethernet1 up 1000M up up Ethernet1Ethernet2 up 1000M up up Ethernet2Ethernet3 down 1000M down up Ethernet3Ethernet4 up 1000M up up Ethernet4Ethernet5 down 1000M down up Ethernet5Ethernet6 down 1000M down up Ethernet6Ethernet7 down 1000M down up Ethernet7Ethernet8 down 1000M down up Ethernet8Ethernet9 down 2.5G down up Ethernet9Ethernet10 up 1000M up up Ethernet10Ethernet11 down 2.5G down up Ethernet11Ethernet12 up 2.5G up up Ethernet12Ethernet13 down 10G down up Ethernet13Ethernet14 up 10G up up Ethernet14Ethernet15 up 10G up up Ethernet15Ethernet16 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 eepromEthernet14: SFP EEPROM detectedApplication Advertisement: N/AConnector: LCEncoding: 64B/66BExtended Identifier: GBIC/SFP defined by two-wire interface IDExtended RateSelect Compliance: UnknownIdentifier: SFP/SFP+/SFP28Length OM3(10m): 30.0Nominal Bit Rate(100Mbs): 103Specification compliance:10G Ethernet Compliance: 10GBASE-SRESCON Compliance: UnknownEthernet Compliance: UnknownFibre Channel Link Length: Intermediate distance (I)Fibre Channel Speed: UnknownFibre Channel Transmission Media: UnknownFibre Channel Transmitter Technology: Shortwave laser w/o OFC (SN)Infiniband Compliance: UnknownSFP+CableTechnology: UnknownSONET Compliance Codes: UnknownVendor Date Code(YYYY-MM-DD Lot): 2018-07-03Vendor Name: OEMVendor OUI: 00-00-00Vendor PN: TSSP85B33CDL03Vendor Rev: AVendor SN: STST85S82700095sonic# show interface transceiver lpmodePort Low-power Mode---------- ----------------Ethernet1 OffEthernet2 Offsonic# show interface transceiver presencePort Presence---------- -----------Ethernet1 Not presentEthernet2 Not present
show interface port
Section titled “show interface port”[Command]
show interface port [ethernet interface-name]
[Purpose]
Display interface details
[View]
System view
[Use Cases]
sonic# show interface portEthernet1 is up, line protocol is upHardware is EthInterface index is 1Description:IPV4 address is 192.168.2.217/24Mode of IPV4 address assignment: MANUALMode of IPV6 address assignment: not-setIP MTU 9100 bytesLineSpeed 1.0GInput statistics:23794823 packets, 2029335221 octets63489 Multicasts, 680223 Broadcasts, 23051111 Unicasts0 error, 0 discarded0 ipv4Packets, 0 ipv4Octets0 ipv6Packets, 0 ipv6OctetsOutput statistics:14181183 packets, 1219985112 octets0 Multicasts, 0 Broadcasts, 14181183 Unicasts0 error, 0 discarded0 ipv4Octets, 0 ipv6Octets
show interface status
Section titled “show interface status”[Command]
show interface status
[Purpose]
Show interface status
[View]
System view
[Use Cases]
sonic# show interface statusInterface Lanes Speed MTU FEC Alias Vlan Oper Admin Type Asym PFC----------- ------- ------- ----- ----- ---------- ------ ------ ------- -------------- ----------Ethernet1 0 1000M 9100 none Ethernet1 routed up up RJ45 N/AEthernet2 1 1000M 9100 none Ethernet2 routed up up RJ45 N/AEthernet3 2 1000M 9100 none Ethernet3 routed down up RJ45 N/AEthernet4 3 1000M 9100 none Ethernet4 routed up up RJ45 N/AEthernet5 4 1000M 9100 none Ethernet5 routed down up RJ45 N/AEthernet6 5 1000M 9100 none Ethernet6 routed down up RJ45 N/AEthernet7 6 1000M 9100 none Ethernet7 routed down up RJ45 N/AEthernet8 7 1000M 9100 none Ethernet8 routed down up RJ45 N/AEthernet9 8 2.5G 9100 none Ethernet9 routed down up RJ45 N/AEthernet10 9 1000M 9100 none Ethernet10 routed up up RJ45 N/AEthernet11 10 2.5G 9100 none Ethernet11 routed down up RJ45 N/AEthernet12 11 2.5G 9100 none Ethernet12 routed up up RJ45 N/AEthernet13 12 10G 9100 none Ethernet13 routed down up N/A N/AEthernet14 13 10G 9100 none Ethernet14 routed up up SFP/SFP+/SFP28 N/AEthernet15 14 10G 9100 none Ethernet15 routed up up SFP/SFP+/SFP28 N/AEthernet16 15 10G 9100 none Ethernet16 routed up up SFP/SFP+/SFP28 N/A
Show interface status Command Display Description Table
|
|
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 interfaceIFACE 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 0Ethernet2 U 223 0.00 B/s 0.00% 0 0 0 256 40.79 B/s 0.00% 0 0 0Ethernet3 D 0 0.00 B/s 0.00% 0 0 0 0 0.00 B/s 0.00% 0 0 0Ethernet4 U 1,611 0.45 B/s 0.00% 0 0 0 2,838 41.07 B/s 0.00% 0 0 0Ethernet5 D 0 0.00 B/s 0.00% 0 0 0 0 0.00 B/s 0.00% 0 0 0Ethernet6 D 0 0.00 B/s 0.00% 0 0 0 0 0.00 B/s 0.00% 0 0 0Ethernet7 D 0 0.00 B/s 0.00% 0 0 0 0 0.00 B/s 0.00% 0 0 0Ethernet8 D 0 0.00 B/s 0.00% 0 0 0 0 0.00 B/s 0.00% 0 0 0Ethernet9 D 0 0.00 B/s 0.00% 0 0 0 0 0.00 B/s 0.00% 0 0 0Ethernet10 U 0 0.00 B/s 0.00% 0 0 0 257 40.97 B/s 0.00% 0 0 0Ethernet11 D 0 0.00 B/s 0.00% 0 0 0 0 0.00 B/s 0.00% 0 0 0Ethernet12 U 252 0.32 B/s 0.00% 0 0 0 258 40.97 B/s 0.00% 0 0 0Ethernet13 D 0 0.00 B/s 0.00% 0 0 0 0 0.00 B/s 0.00% 0 0 0Ethernet14 U 0 0.00 B/s 0.00% 0 0 0 0 0.00 B/s 0.00% 0 0 0Ethernet15 U 257 0.28 B/s 0.00% 0 0 0 257 40.97 B/s 0.00% 0 0 0Ethernet16 U 538 33.90 B/s 0.00% 0 0 0 1 0.00 B/s 0.00% 0 0 0
clear counters interface
Section titled “clear counters interface”[Command]
clear counters interface
[Purpose]
Clear interface count
[View]
System view
[Use Cases]
sonic# clear counters interfaceCleared counters
interface ethernet interface-name
Section titled “interface ethernet interface-name”[Command]
interface ethernet interface-name
[Purpose]
Switch to ethernet view
[Parameter]
interface-name Interface name
[View]
System configuration view
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 1sonic(config-if-1)# show this!interface ethernet 1
shutdown
Section titled “shutdown”[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 terminalsonic(config)# interface ethernet 1sonic(config-if-1)# shutdownsonic(config-if-1)# show this!interface ethernet 1shutdown
speed speed
Section titled “speed speed”[Command]
speed speed
[Purpose]
Configure the interface rate
[Parameter]
speed Rate in Mbit. Selectable 1000/2500/10000
[View]
Interface view
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 1sonic(config-if-1)# speed 1000sonic(config-if-1)# show this!interface ethernet 1speed 1000
mtu mtu
Section titled “mtu mtu”[Command]
mtu mtu
[Purpose]
Configure interface MTU
[Parameter]
mtu Maximum Transmission Unit, Scope: 1312~9216
[View]
Interface view
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 1sonic(config-if-1)# mtu 2000sonic(config-if-1)# show this!interface ethernet 1mtu 2000
startup-delay
Section titled “startup-delay”[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 1sonic(config-if-1)# startup-delay 100
description description
Section titled “description description”[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 terminalsonic(config)# interface ethernet 1sonic(config-if-1)# description abcsonic(config-if-1)# show this!interface ethernet 1description abc
autoneg
Section titled “autoneg”[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 1sonic(config-if-1)# autoneg
router-interface
Section titled “router-interface”[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 terminalsonic(config)# interface ethernet 1sonic(config-if-1)# router-interfacesonic(config-if-1)# no router-interface
Sub-interface Configuration
Section titled “Sub-interface Configuration”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 terminalsonic(config)# interface sub-ethernet 1.1000sonic(config-if-1.1000)#
Loopback Interface Configuration
Section titled “Loopback Interface Configuration”interface loopback loopback-id
Section titled “interface loopback loopback-id”[Command]
interface loopback loopback-id
[Purpose]
Switch to loopback view
[Parameter]
loopback-id Loopback port ID
[View]
System configuration view
[Use Cases]
sonic# configure terminalsonic(config)# interface loopback 0sonic(config-loif-0)# show this!interface loopback 0
ip address A.B.C.D/M
Section titled “ip address A.B.C.D/M”[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 terminalsonic(config)# interface loopback 2sonic(config-loif-2)# ip address 3.3.3.6/24sonic(config-loif-2)# show this!interface loopback 2ip address 3.3.3.6/24
Port Group Configuration
Section titled “Port Group Configuration”port-group ethernet interface range
Section titled “port-group ethernet interface range”[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-10sonic(config-port-group-1-10)# switchport vlan access 10