Command Line Reference
Ethernet Switching
VLAN Configuration
13 min
vlan configuration vlan configuration vlan(virtual local area network)the commands for creating, deleting and adding members are shown in the table show vlan summary show vlan summary \[command] show vlan summary \[purpose] display vlan summary information \[view] system 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 | + + + + + + description of the show vlan summary command output true 131,655 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 left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type show vlan vid show vlan vid \[command] show vlan vid vlan id show vlan all \[purpose] display vlan specific information \[view] system view \[ use cases ] sonic# show vlan vid 300 vlan id 300 route interface name vlan 300 tagged ports untagged ports ethernet1 mac learning enable vlan vlan \[command] vlan vlan id no vlan vlan id \[purpose] create vlan \[parameter] true 166,564 left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type \[view] system configuration view \[ use cases ] sonic# configure terminal sonic(config)# vlan 300 sonic(config vlan 300)# show this ! vlan 300 switchport {trunk|access} vlan switchport {trunk|access} vlan \[command] switchport {trunk|access} vlan vlan id \[purpose] add interface to vlan \[parameter] true 167,606 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 \[view] interface view \[usage scenario] frames sent by user hosts are untagged, and frames received by the interface from the peer device may be tagged therefore, the device should be configured with different modes when adding interfaces to vlans, depending on the actual use case \[comment] access mode an interface can only be added to one vlan in access mode when an interface is added to a vlan in access mode, as an incoming interface, it can receive frames without vlan tags or with vlan ids equal to the access value as an outgoing interface, it compares the vlan tag carried by the frame with the access value if they are equal, it strips the vlan tag from the frame; if they are not equal, it takes no action trunk mode an interface can be added to multiple vlans in trunk mode, indicating that it allows traffic to pass through without modifying the vlan tag on the frame a physical interface can be added to different vlans in both access and trunk modes \[ use cases ] sonic(config)# interface ethernet 1 sonic(config if 1)# switchport access vlan 10 vlan group vlan group \[command] vlan group vlan id vlan id \[purpose] bulk create vlans and enter vlan configuration view \[parameter] true 179,551 left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type \[view] system configuration view \[usage scenario] when there is a need to configure a large number of vlans with similar properties, this command allows entering the vlan creation process and vlan configuration view for modifying the configuration of these vlans \[ use cases ] sonic(config)# vlan group 10 20,30,40 broadcast {flood|drop} broadcast {flood|drop} \[command] broadcast {flood|drop} \[purpose] configure broadcast function handling \[parameter] true 155,516 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 \[view] vlan view \[usage scenario] broadcast forwarding is a method of sending a data packet to all devices within the same vlan it can be used for sending arp requests, dhcp requests, and similar functions in a vlan, whether broadcast packets are forwarded can be configured on the switch \[ use cases ] sonic# configure terminal sonic(config)# vlan 40 sonic(config vlan 40)# broadcast drop unknown uni {flood|drop} unknown uni {flood|drop} \[command] unknown uni {flood|drop} \[purpose] configure the processing of unknown unicast packets \[parameter] true 148,540 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 \[view] vlan view \[usage scenario] unknown unicast refers to unicast data packets for which the switch cannot determine the vlan in which the destination mac address resides if a vlan needs to receive unknown unicast data, it can be configured in unknown unicast forwarding mode if a vlan does not need to forward unknown unicast data packets within it, it can be configured in discard mode \[ use cases ] sonic# configure terminal sonic(config)# vlan 40 sonic(config vlan 40)# unknown uni drop unre multi {flood|drop} unre multi {flood|drop} \[command] unre multi {flood|drop} \[purpose] configure the processing of unknown multicast packets \[parameter] true 176,517 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 \[view] vlan view \[usage scenario] multicast is a method of sending packets to a group of devices in the same vlan it is used for multimedia streaming, routing protocols, and more in a vlan, multicast forwarding can be achieved by configuring the switch's igmp snooping feature however, if you want to prevent the forwarding of unknown multicast within that vlan, you can use the "drop" parameter for implementation \[ use cases ] sonic# configure terminal sonic(config)# vlan 40 sonic(config vlan 40)# unre multi drop
