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.
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/Ashow 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 presentshow 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 ipv6Octetsshow 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/Ashow 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/Aclear counters interface
Section titled “clear counters interface”[Command]
clear counters interface
[Purpose]
Clear interface count
[View]
System view
[Use Cases]
sonic# clear counters interfaceCleared countersinterface 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 1shutdown
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[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 10000limit-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 2000startup-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 100description
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 abcspeed 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 autoSub-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 0ip 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/24Port 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 10port-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