You can use vicfg-vswitch to manage VLANs.

VLANs allow you to further segment a single physical LAN segment so that groups of ports are isolated as if they were on physically different segments. The standard is IEEE 802.1Q.

A VLAN ID restricts port group traffic to a logical Ethernet segment within the physical network.

  • Set the VLAN ID to 4095 to allow a port group to reach port groups located on other VLAN.
  • Set the VLAN ID to 0 to disable the VLAN for this port group.

If you use VLAN IDs, you must change the port group labels and VLAN IDs together so that the labels properly represent connectivity. VLAN IDs are optional.

You can use the following commands for VLAN management.

  • Allow all port groups to reach port groups located on other VLANs.
    vicfg-vswitch <conn_options> --vlan 4095 --pg "ALL" vSwitch2
  • Disable VLAN for port group g42.
    vicfg-vswitch <conn_options> --vlan 0 --pg g42 vSwitch2

Run vicfg-vswitch -l to retrieve information about VLAN IDs currently associated with the virtual switches in the network.