Command Line Reference
Interface Management
31 min
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 interface basic configuration show interface description 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 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 eeprom ethernet48 sfp eeprom not detected ethernet49 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 stst31182900045 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 show interface port ethernet show interface port ethernet \[command] show interface port ethernet interface id \[purpose] display interface details \[view] system view \[use cases] sonic# show interface port ethernet1 is up, line protocol is down hardware is eth interface index is 1 description mode of ipv4 address assignment not set mode of ipv6 address assignment not set ip mtu 9216 bytes linespeed 1g, auto negotiation off input statistics 0 packets, 0 octets 0 multicasts, 0 broadcasts, 0 unicasts 0 error, 0 discarded 0 ipv4packets, 0 ipv4octets 0 ipv6packets, 0 ipv6octets output statistics 0 packets, 0 octets 0 multicasts, 0 broadcasts, 0 unicasts 0 error, 0 discarded 0 ipv4octets, 0 ipv6octets show interface status 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 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 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 \ ethernet0 d 0 n/a n/a 0 0 0 0 n/a n/a 0 0 n/a ethernet1 u 0 n/a n/a 0 0 0 27 n/a n/a 0 0 n/a ethernet2 u 0 n/a n/a 0 0 0 27 n/a n/a 0 0 n/a ethernet3 u 0 n/a n/a 0 0 0 35 n/a n/a 0 0 n/a ethernet4 x 0 n/a n/a 0 0 0 0 n/a n/a 0 0 n/a clear counters interface clear counters interface \[command] clear counters interface \[purpose] clear interface count \[view] system view \[use cases] sonic# clear counters interface cleared counters interface ethernet 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 terminal sonic(config)# interface ethernet 1 sonic(config if 1)# show this ! interface ethernet 1 shutdown 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 terminal sonic(config)# interface ethernet 1 sonic(config if 1)# shutdown sonic(config if 1)# show this ! interface ethernet 1 shutdown speed speed \[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 terminal sonic(config)# interface ethernet 1 sonic(config if 1)# speed 10000 sonic(config if 1)# show this ! interface ethernet 1 speed 10000 limit rate {ingress|egress} bind 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 terminal sonic(config)# interface ethernet 1 sonic(config if 1)# limit rate ingress bind 1000 100 sonic(config if 1)# limit rate egress bind 200 200 sonic(config if 1)# show this ! interface ethernet 1 limit rate egress bind 200 200 limit rate ingress bind 1000 100 mtu mtu \[command] mtu mtu \[purpose] configure interface mtu \[parameter] parameter description 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 startup delay 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 1 sonic(config if 1)# startup delay 100 description 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 terminal sonic(config)# interface ethernet 1 sonic(config if 1)# description abc sonic(config if 1)# show this ! interface ethernet 1 description abc speed auto 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 1 sonic(config if 1)# speed auto sub interface configuration sub interface configuration show sub interface 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 numbe r 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 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 terminal sonic(config)# interface sub ethernet 40 1000 sonic(config if 40 1000)# loopback interface configuration loopback interface configuration interface loopback 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 terminal sonic(config)# interface loopback 0 sonic(config loif 0)# show this ! interface loopback 0 ip address 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 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 port group configuration port group configuration port group ethernet 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 20 sonic(config port group 1 20)# switchport vlan access 10 port group lag 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 20 sonic(config lag group 1 20)# switchport vlan access 10
