Command Line Reference
Interface Configuration
Logical Interfaces
20 min
vlan interface vlan interface please refer to docid\ qprgny3rjshvxgopfrvkb lag interface lag interface please refer to docid\ q53ou9z9gtxn5zjxycqpm sub interface sub interface sub interface status view sub interface status view table 1 sub interface status view table 1 sub interface status view command purpose show sub interface \[ ethernet interface name subinterface number ] display information about the status of subinterfaces show { ip | ipv6 } interfaces display ip address configuration of subinterfaces show sub interface \[ethernet show sub interface \[ethernet interface name subinterface number ] \[command] show sub interface \[ ethernet interface name subinterface number ] \[purpose] display information about the status of subinterfaces \[parameters] parameter description interface name parent interface name (eg 0/1) subinterface number subinterface number \[view] privileged user view \[use cases] sonic# show sub interface sub port interface speed mtu vlan admin type \ 0/0 2 25g 9100 2 up 802 1q encapsulation show {ip|ipv6} interfaces show {ip|ipv6} interfaces \[command] show { ip | ipv6 } interfaces \[purpose] display ip address configuration of subinterfaces \[view] privileged user view \[use cases] sonic# show ip interfaces interface master ipv4 address/mask admin/oper bgp neighbor neighbor ip \ 0/0 2 2 0 0 1/24 up/down n/a n/a 0/48 199 0 3 1/24 up/up n/a n/a 0/52 199 0 7 1/24 up/up n/a n/a loopback0 10 1 0 34/32 up/up n/a n/a mgmt 10 250 0 138/24 up/up n/a n/a sub interface config sub interface config table 2 subinterface config table 2 subinterface config command purpose interface {ethernet|link aggregation} interface name subinterface number create a subinterface mtu mtu configure the mtu value on a subinterface shutdown bring the subinterface down administratively ip address { a b c d/m | a b/m } \[ secondary ] configure ip address for the subinterface mac address hh\ hh\ hh\ hh\ hh\ hh specify a mac address to the subinterface interface {ethernet|link aggregation} interface name subinterface number \[command] interface {ethernet|link aggregation} interface name subinterface number \[purpose] create a subinterface \[parameters] parameter description interface name parent interface name (eg 0/1) subinterface number subinterface number \[view] global configuration view \[notes] run command no interface {ethernet|link aggregation} interface name subinterface number to delete the subinterface \[use cases] sonic# configure terminal sonic(config)# interface ethernet 0/1 1 sonic(config if 0/1 1)# show this ! interface ethernet 0/1 1 sonic(config)# no interface ethernet 0/1 1 mtu mtu \[command] mtu mtu \[purpose] configure the mtu value on a subinterface \[parameters] parameter description mtu maximum transmission unit, the range is from 1312 to 9216 the default is 9216 bytes \[view] subinterface configuration view \[use cases] sonic# configure terminal sonic(config)# interface ethernet 0/1 1 sonic(config if 0/1 1)# mtu 2000 sonic(config if 0/1 1)# show this ! interface ethernet 0/1 1 mtu 2000 shutdown shutdown \[command] shutdown \[purpose] bring the subinterface down administratively \[view] subinterface configuration view \[notes] run command no shutdown to bring the sub interface up administratively \[use cases] sonic# configure terminal sonic(config)# interface ethernet 0/1 1 sonic(config if 0/1 1)# shutdown sonic(config if 0/1 1)# show this ! interface ethernet 0/1 1 shutdown ip address { ip address { a b c d/m | a b/m } \[secondary] \[command] ip address { a b c d/m | a b/m } \[ secondary ] \[purpose] configure ip address for the subinterface \[parameters] parameter description a b c d/m ipv4 address with prefix length a b/m ipv6 address with prefix length secondary the default is primary ip, specifying this option means configuring as secondary ip, which requires that the secondary ip and primary ip be in the same network segment \[view] subinterface configuration view \[notes] ipv4 address with subnet mask /32 is not allowed to be configured addresses with subnet mask /31 is allowed in other subnet masks, addresses with the host portion all zeros or all ones are not allowed ipv6 address with subnet mask /127 or /128 is not allowed to be configured in other subnet masks, addresses with the host portion all zeros are not allowed, but all ones are allowed run command no ip address { a b c d/m | a b/m } \[ secondary ]to delete ip address configuration of the subinterface \[use cases] sonic# configure terminal sonic(config)# interface ethernet 0/2 2 sonic(config if 0/2 2)# ip address 3 3 3 6/24 sonic(config if 0/2 2)# show this ! interface ethernet 0/2 2 ip address 3 3 3 6/24 mac address mac address hh\ hh\ hh\ hh\ hh\ hh \[command] mac address hh\ hh\ hh\ hh\ hh\ hh \[purpose] specify a mac address to the subinterface \[parameters] parameter description hh\ hh\ hh\ hh\ hh\ hh mac address, not case sensitive \[view] subinterface configuration view \[notes] the default is the mac of the switch run command no mac address to restore the mac of the sub interface to default \[use cases] sonic# configure terminal sonic(config)# interface ethernet 0/2 2 sonic(config if 0/2 2)# mac address 18 17 25 37 67\ af sonic(config if 0/2 2)# show this ! interface ethernet 0/2 2 mac address 18 17 25 37 67\ af loopback loopback loopback view loopback view table 3 loopback view table 3 loopback view command purpose show { ip | ipv6 } interfaces display ip address configuration of loopback interfaces show {ip|ipv6} interfaces show {ip|ipv6} interfaces \[command] show { ip | ipv6 } interfaces \[purpose] display ip address configuration of loopback interfaces \[view] privileged user view \[use cases] sonic# show ip interfaces interface master ipv4 address/mask admin/oper bgp neighbor neighbor ip \ 0/48 199 0 3 1/24 up/up n/a n/a 0/52 199 0 7 1/24 up/up n/a n/a 0/72 10 72 0 1/24 up/up n/a n/a loopback0 10 1 0 34/32 up/up n/a n/a mgmt 10 250 0 138/24 up/up n/a n/a loopback config loopback config table 4 loopback config table 4 loopback config command purpose interface loopback loopback id enter loopback interface configuration view ip address { a b c d/m | a b/m } configure ip address for the loopback interface interface loopback interface loopback loopback id \[command] interface loopback loopback id \[purpose] enter loopback interface configuration view \[parameters] parameter description loopback id loopback interface number, integer form, range from 0 to 999 \[view] global configuration view \[notes] loopback0 has been created by default and cannot be deleted run command no interface loopback loopback id to delete loopback interface \[use cases] sonic# configure terminal sonic(config)# interface loopback 1 sonic(config loif 1)# show this ! interface loopback 1 ip address { ip address { a b c d/m | a b/m } \[command] ip address { a b c d/m | a b/m } \[purpose] configure ip address for the loopback interface \[parameters] parameter description a b c d/m ipv4 address with prefix length a b/m ipv6 address with prefix length \[view] loopback interface configuration view \[notes] run command no ip address { a b c d/m | a b/m } to delete ip address configuration of the loopback interface \[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
