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 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
show interface transceiver
Section titled “show interface transceiver”[Command]
show interface transceiver {eeprom|lpmode|presence}
[Purpose]
Display of optical module information
[Parameter]
Parameter | Description |
---|---|
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 eepromEthernet48: SFP EEPROM Not detectedEthernet49: 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: STST31182900045sonic# show interface transceiver lpmodePort Low-power Mode---------- ----------------Ethernet1 OffEthernet2 Offsonic# show interface transceiver presencePort Presence---------- -----------Ethernet1 Not presentEthernet2 Not present
show interface port ethernet
Section titled “show interface port ethernet”[Command]
show interface port ethernet interface_id
[Purpose]
Display interface details
[View]
System view
[Use Cases]
sonic# show interface portEthernet1 is up, line protocol is downHardware is EthInterface index is 1Description:Mode of IPV4 address assignment: not-setMode of IPV6 address assignment: not-setIP MTU 9216 bytesLineSpeed 1G, Auto-negotiation offInput statistics: 0 packets, 0 octets 0 Multicasts, 0 Broadcasts, 0 Unicasts 0 error, 0 discarded 0 ipv4Packets, 0 ipv4Octets 0 ipv6Packets, 0 ipv6OctetsOutput statistics: 0 packets, 0 octets 0 Multicasts, 0 Broadcasts, 0 Unicasts 0 error, 0 discarded 0 ipv4Octets, 0 ipv6Octets
show interface status
Section titled “show interface status”[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
show counters interface
Section titled “show counters interface”[Command]
show counters interface ethernet interface_id
[Purpose]
Show interface count
[Parameter]
Parameter | Description |
---|---|
interface_id | Interface id |
[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-------------------------------------------------------------------------------------------------Ethernet0 D 0 N/A N/A 0 0 0 0 N/A N/A 0 0 N/AEthernet1 U 0 N/A N/A 0 0 0 27 N/A N/A 0 0 N/AEthernet2 U 0 N/A N/A 0 0 0 27 N/A N/A 0 0 N/AEthernet3 U 0 N/A N/A 0 0 0 35 N/A N/A 0 0 N/AEthernet4 X 0 N/A N/A 0 0 0 0 N/A N/A 0 0 N/A
show link-flapping config
Section titled “show link-flapping config”[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 |+-------------+----------+------------+-------------+------------+
show interface errdown
Section titled “show interface errdown”[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 errdownInterface Status Reason--------------- -------- --------Ethernet1 up NoneEthernet5 up NoneEthernet9 up NoneEthernet13 up NoneEthernet17 up NoneEthernet21 up NoneEthernet25 up NoneEthernet29 up NoneEthernet33 up NoneEthernet37 up NoneEthernet41 up NoneEthernet45 up NoneEthernet49 up NoneEthernet53 up NoneEthernet57 up NoneEthernet61 up NoneEthernet65 up NoneEthernet69 up NoneEthernet73 up NoneEthernet77 up NoneEthernet81 up NoneEthernet85 up NoneEthernet89 up NoneEthernet93 up NoneEthernet97 up NoneEthernet101 up NoneEthernet105 up NoneEthernet109 up NoneEthernet113 up NoneEthernet117 errdown Link flapEthernet121 up NoneEthernet125 up NoneEthernet129 up NoneEthernet130 up None
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
Section titled “interface ethernet”[Command]
interface ethernet interface_id
[Purpose]
Switch to ethernet view
[Parameter]
Parameter | Description |
---|---|
interface_id | Interface id |
[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
link-flapping detect enable
Section titled “link-flapping detect enable”[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 terminalsonic(config)# interface ethernet 121sonic(config-if-121)# link-flapping detect enablesonic(config-if-121)#
link-flapping detect-action error-down
Section titled “link-flapping detect-action error-down”[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 terminalsonic(config)# interface ethernet 121sonic(config-if-121)# link-flapping detect-action error-down
link-flapping detect-interval
Section titled “link-flapping detect-interval”[Command]
link-flapping detect-interval time
no link-flapping detect-interval
[Purpose]
Configure/Remove the link-flapping monitoring period.
[Parameter]
Parameter | Description |
---|---|
time | Interface UP/DOWN monitoring period; Unit: seconds; Range: 5-60. |
[View]
Interface view
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 121sonic(config-if-121)# link-flapping detect-interval 30
link-flapping detect-threshold
Section titled “link-flapping detect-threshold”[Command]
link-flapping detect-threshold threshold_num
no link-flapping detect-threshold
[Purpose]
Configure/Remove the threshold for frequent interface UP/DOWN events.
[Parameter]
Parameter | Description |
---|---|
threshold_num | Interface UP/DOWN count; Range: 5-30. |
[View]
Interface view
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 121sonic(config-if-121)# link-flapping detect-interval 30
[Command]
speed speed
[Purpose]
Configure the interface rate
[Parameter]
Parameter | Description |
---|---|
speed | Rate in Mbit. Selectable 10/100/1000/2500/10000/25000/40000/100000/auto. |
[View]
Interface view
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 1sonic(config-if-1)# speed 10000sonic(config-if-1)# show this!interface ethernet 1 speed 10000
limit-rate {ingress|egress} bind
Section titled “limit-rate {ingress|egress} bind”[Command]
limit-rate {ingress|egress} bind cir cbr
no limit-rate {ingress|egress} bind
[Purpose]
Configure interface rate limiting function
[Parameter]
Parameter | Description |
---|---|
cir | Specifes the committed information rate (CIR), which is the allowed rate at which trafc can pass through. (unit: KBytes) |
cbr | Specifes 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 terminalsonic(config)# interface ethernet 1sonic(config-if-1)# limit-rate ingress bind 1000 100sonic(config-if-1)# limit-rate egress bind 200 200sonic(config-if-1)# show this!interface ethernet 1limit-rate egress bind 200 200limit-rate ingress bind 1000 100
[Command]
mtu mtu
[Purpose]
Configure interface MTU
[Parameter]
Parameter | Description |
---|---|
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 1 mtu 2000
startup-delay
Section titled “startup-delay”[Command]
startup-delay time
no startup-delay
[Purpose]
Configure interface delayed start time
[Parameter]
Parameter | Description |
---|---|
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
Section titled “description”[Command]
description description
no description
[Purpose]
Configure interface description information
[Parameter]
Parameter | Description |
---|---|
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 1 description abc
breakout
Section titled “breakout”[Command]
breakout {4x25G|4x10G|4x1G}
no breakout
[Purpose]
Configure static splitting for the interface
[Parameter]
Parameter | Description |
---|---|
4x25G | Split the 100G interface into 4x25G |
4x10G | Split the 100G interface into 4x10G |
4x1G | Split 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 49sonic(config-if-49)# breakout 4x25G
speed auto
Section titled “speed auto”[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 1sonic(config-if-1)# speed auto
Sub-interface Configuration
Section titled “Sub-interface Configuration”show sub-interface
Section titled “show sub-interface”[Command]
show sub-interface {ethernet interface_name.subinterface_number | status}
[Purpose]
Display sub-interface status information
[Parameter]
Parameter | Description |
---|---|
interface_name | Parent interface name |
subinterface_number | Sub-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 |+----------------------+-------+--------+---------+---------------------+
interface sub-ethernet
Section titled “interface sub-ethernet”[Command]
interface sub-ethernet interface_name.subinterface_number
no interface sub-ethernet interface_name.subinterface_number
[Purpose]
Add sub-interface
[Parameter]
Parameter | Description |
---|---|
interface_name | Parent interface name |
subinterface_number | Sub-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 terminalsonic(config)# interface sub-ethernet 40.1000sonic(config-if-40.1000)#
Loopback Interface Configuration
Section titled “Loopback Interface Configuration”interface loopback
Section titled “interface loopback”[Command]
interface loopback loopback_id
[Purpose]
Switch to loopback view
[Parameter]
Parameter | Description |
---|---|
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
Section titled “ip address”[Command]
ip address A.B.C.D/M
[Purpose]
Adding an IP address to the loopback port
[Parameter]
Parameter | Description |
---|---|
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
Section titled “port-group ethernet”[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-20sonic(config-port-group-1-20)# switchport vlan access 10
port-group lag
Section titled “port-group lag”[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-20sonic(config-lag-group-1-20)# switchport vlan access 10