Command Line Reference
Layer 2 Configuration
VLAN
32 min
vlan view vlan view table 1 vlan view table 1 vlan view true 242,419#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type show vlan summary show vlan summary \[command] show vlan summary \[purpose] display summary information about vlans \[view] privileged user view \[use cases] sonic# show vlan summary + + + + + + \| vlan id | ip address | ports | port tagging | dhcp helper address | +===========+================+===========+================+=======================+ \| 1000 | 192 168 0 1/21 | ethernet0 | untagged | 192 0 0 1 | \| | | ethernet1 | untagged | 192 0 0 2 | \| | | ethernet2 | untagged | 192 0 0 3 | \| | | ethernet3 | untagged | 192 0 0 4 | + + + + + + \| 1200 | | | | | + + + + + + show vlan summary show vlan summary vlan id \[command] show vlan summary vlan id \[purpose] display specific vlan summary information \[parameters] true 330,331#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] privileged user view \[use cases] sonic# show vlan summary 1000 + + + + + + \| vlan id | ip address | ports | port tagging | dhcp helper address | +===========+================+===========+================+=======================+ \| 1000 | 192 168 0 1/21 | ethernet0 | untagged | 192 0 0 1 | \| | | ethernet1 | untagged | 192 0 0 2 | \| | | ethernet2 | untagged | 192 0 0 3 | \| | | ethernet3 | untagged | 192 0 0 4 | + + + + + + show vlan show vlan vlan id \[command] show vlan vlan id \[purpose] display specific information about the vlan \[parameters] true 330,331#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] privileged user view \[use cases] sonic(config)# show vlan 300 vlan id 300 route interface name vlan 300 tagged ports untagged ports 0/0 mac learning enable show vlan all show vlan all \[command] show vlan all \[purpose] display detailed information about all vlans \[view] privileged user view \[use cases] sonic(config)# show vlan all vlan id 300 route interface name vlan 300 tagged ports untagged ports 0/0 mac learning enable show {ip|ipv6} interfaces show {ip|ipv6} interfaces \[command] show { ip | ipv6 } interfaces \[purpose] display ip address configuration of vlan 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 loopback0 10 1 0 34/32 up/up n/a n/a vlan100 vrf123 100 100 0 1/24 up/up n/a n/a vlan200 vrf123 200 200 0 1/24 up/up n/a n/a vlan300 vrf123 200 230 0 1/24 up/down n/a n/a vlan400 200 240 0 1/24 up/down n/a n/a vlan4094 99 0 0 1/24 up/up n/a n/a mgmt 10 250 0 138/24 up/up n/a n/a show counters vlan show counters vlan \[command] show counters vlan \[purpose] display vlan interfaces statistics \[view] privileged user view \[notes] only supported on cx308p 48y n v2 and cx532p n v2 (support two vlanifs at most), other models are not supported yet run command clear counters vlan to clear vlanifs statistics \[use cases] sonic# show counters vlan vlan name packets in packets out \ vlan1011 100 100 vlan1012 0 0 vlan config table 2 vlan config table 2 vlan config 310,351#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type vlan vlan vlan id \[command] vlan vlan id \[purpose] create a vlan and enter vlan configuration view \[parameters] true 330,331#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] global configuration view \[notes] run command no vlan vlan id to delete the vlan \[use cases] sonic# configure terminal sonic(config)# vlan 300 sonic(config vlan 300)# show this ! vlan 300 description description description description \[command] description description \[purpose] specify the description for the vlan \[parameters] true 330,331#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] vlan configuration view \[notes] run command no description to delete description \[use cases] sonic# configure terminal sonic(config)# vlan 200 sonic(config vlan 200)# description vlan 200 sonic(config vlan 200)# do show vlan 200 vlan id 200 description vlan 200 route interface name vlan 200 tagged ports untagged ports mac learning enable mac address learning mac address learning \[command] mac address learning \[purpose] enable mac learning for the vlan \[view] vlan configuration view \[notes] mac learning is enabled by default run command no mac address learning to disable mac learning for the vlan \[use cases] sonic# configure terminal sonic(config)# vlan 300 sonic(config vlan 300)# no mac address learning sonic(config vlan 300)# show this ! vlan 300 no mac address learning {broadcast|unknown multicast|unknown unicast} {drop|flood} {broadcast|unknown multicast|unknown unicast} {drop|flood} \[command] { broadcast | unknown multicast | unknown unicast } { drop | flood } \[purpose] set bum suppression \[view] vlan configuration view \[notes] by default, the policy for bum messages is flooding \[use cases] sonic# configure terminal sonic(config)# vlan 10 sonic(config vlan 10)# broadcast drop counter enable counter enable \[command] counter enable \[purpose] enable vlan interfaces statistics \[view] vlan configuration view \[notes] only supported on cx308p 48y n v2 and cx532p n v2 (support two vlanifs at most), other models are not supported yet run command no counter enable to disable vlan interfaces statistics \[use cases] sonic# configure terminal sonic(config)# vlan 10 sonic(config vlan 10)# counter enable interface vlan interface vlan vlan id \[command] interface vlan vlan id \[purpose] enter vlanif configuration view \[parameters] true 330,331#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] global configuration view \[notes] run command no interface vlan vlan id to delete vlan interface you should remove the member ports from it before deleting \[use cases] sonic# configure terminal sonic(config)# interface vlan 300 sonic(config vlanif 300)# 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 vlan interface \[parameters] true 119,542#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type \[view] vlanif 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 vlan interface \[use cases] sonic# configure terminal sonic(config)# interface vlan 300 sonic(config vlanif 300)# ip address 3 3 3 6/24 sonic(config vlanif 300)# show this ! vlan 300 ip address 3 3 3 6/24 mtu mtu mtu \[command] mtu mtu \[purpose] configure the mtu value on a vlan interface \[parameters] true 113,548#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] vlanif configuration view \[use cases] sonic# configure terminal sonic(config)# interface vlan 300 sonic(config vlanif 300)# mtu 2000 sonic(config vlanif 300)# show this ! vlan 300 mtu 2000 shutdown shutdown \[command] shutdown \[purpose] bring the vlanif down administratively \[view] vlanif configuration view \[notes] run command no shutdown to bring the vlanif up administratively \[use cases] sonic# configure terminal sonic(config)# interface vlan 300 sonic (config vlanif 3)# shutdown sonic (config vlanif 3)# show this ! interface vlan 300 shutdown 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 vlan interface \[parameters] true 229,432#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] vlanif configuration view \[notes] the default is the mac of the switch; run command no mac address to restore the mac of the vlan interface to default \[use cases] sonic# configure terminal sonic(config)# interface vlan 300 sonic(config vlanif 300)# mac address 18 17 25 37 67\ af sonic(config vlan 300)# show this ! vlan 300 mac address 18 17 25 37 67\ af switchport {trunk|access} vlan switchport {trunk|access} vlan vlan id \[command] \[command] switchport { trunk | access } vlan vlan id \[purpose] add member port to the vlan \[parameters] true 330,331#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type \[view] physical interface configuration view/lagif configuration view \[notes] an interface can only be added to one vlan as untagged, but it can be added to multiple vlans as tagged the vlan id of the untagged vlan will be set as pvid of the interface; run command no switchport vlan vlan id to remove the interface from specified vlan; run command no switchport to remove the interface from all vlans and change to layer 3 port \[use cases] sonic# configure terminal sonic(config)# interface ethernet 0/0 sonic(config if 0/0)# switchport access vlan 300 sonic(config if 0/0)# show this ! interface ethernet 0/0 switchport access vlan 300 vlan range vlan range vlan list \[command] vlan range vlan list \[purpose] create a bulk of vlans \[parameters] true 233,428#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] global configuration view \[notes] run command no vlan range vlan list to delete vlans \[use cases] sonic# configure terminal sonic(config)# vlan range 10 20,4000 switchport trunk range vlan switchport trunk range vlan vlan list \[command] switchport trunk range vlan vlan list \[purpose] add member port to a bulk of vlans \[parameters] true 142,302#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] physical interface configuration view/lagif configuration view \[notes] run command no switchport vlan range vlan list to remove member port from a bulk of vlans \[use cases] sonic# configure terminal sonic(config)# interface ethernet 0/4 sonic(config if 0/4)# switchport trunk range vlan 10 20,4000 qinq config table 3 qinq config table 3 qinq config true 242,419 left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type dot1q tunnel enable dot1q tunnel enable \[command] dot1q tunnel enable \[purpose] enable qinq \[view] global configuration view \[notes] currently, only cx308p 48y n v2, cx532p n v2 and cx732q n v2 devices support this feature execute the no dot1q tunnel enable command to disable qinq \[use cases] sonic# configure sonic(config)# dot1q tunnel enable dot1q tunnel dot1q tunnel \[command] dot1q tunnel \[purpose] enable qinq on the interface \[view] interface configuration view \[notes] currently, only cx308p 48y n v2, cx532p n v2 and cx732q n v2 devices support this feature this command needs to be executed under the physical interface configured with access vlan execute the no dot1q tunnel command to disable qinq \[use cases] sonic# configure sonic(config)# interface ethernet 0/8 sonic(config if 0/8)# dot1q tunnel dot1q tunnel ethertype dot1q tunnel ethertype tpid \[command] dot1q tunnel ethertype tpid \[purpose] configure qinq's tpid \[parameters] true 142,302 left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type \[view] interface configuration view \[notes] currently, only cx308p 48y n v2, cx532p n v2 and cx732q n v2 devices support this feature this command needs to be executed under the physical interface configured with access vlan execute the no dot1q tunnel ethertype command to restore the default configuration of qinq tpid \[use cases] sonic# configure sonic(config)# interface ethernet 0/8 sonic(config if 0/8)# dot1q tunnel ethertype 9200
