The VMware Knowledge Base provides support solutions, error messages and troubleshooting guides
Sample configuration of virtual switch VLAN tagging (VST Mode) (1004074)
- Assign a VLAN to a portgroup(s). The supported VLAN range is 1-4094.
Reserved VLAN IDs:
- VLAN ID 0 (zero) Disables VLAN tagging on port group (EST Mode)
- VLAN ID 4095 Enables trunking on port group (VGT Mode)
- Set the switch NIC teaming policy to Route based on originating virtual port ID (this is set by default).
To configure the physical switch settings:
- Define ESXi/ESX VLANs on the physical switch.
- Allow the proper range to the ESXi/ESX host.
- Set the physical port connection between the ESXi/ESX host and the physical switch to TRUNK mode. ESXi/ESX only supports IEEE 802.1Q (dot1q) trunking.
- Physical switch is set to TRUNK mode
- dot1q encapsulation is enabled
- Spanning-tree is set to portfast trunk (for example, port forwarding, skips other modes)
- Define VLAN interface
- Assign IP Range to VLAN interface
- VLAN Routing – and VLAN Isolation
Caution: Native VLAN ID on ESXi/ESX VST Mode is not supported. Do not assign a VLAN to a port group that is same as the native VLAN ID of the physical switch. Native VLAN packets are not tagged with the VLAN ID on the outgoing traffic toward the ESXi/ESX host. Therefore, if the ESXi/ESX host is set to VST mode, it drops the packets that are lacking a VLAN tag.
This sample is a supported Cisco Trunk Port configuration:
switchport(Set to layer 2 switching)
switchport trunk encapsulation dot1q(ESXi/ESX only supports dot1q, not ISL)
switchport trunk allowed vlan 10-100(Allowed VLAN to ESXi/ESX. Ensure ESXi/ESX VLANs are allowed)
switchport mode trunk(Set to Trunk Mode)
switchport nonegotiate(DTP is not supported)
no ip address
no cdp enable(ESXi/ESX 3.5 or higher supports CDP)
spanning-tree portfast trunk(Allows the port to start forwarding packets immediately on linkup)
Note: For more information on configuring your physical network switch, contact your switch vendor.
To assign a VLAN to a port group, there must be a corresponding VLAN interface for each VLAN on a physical switch with a designated IP range.
ip address 10.10.100.1 255.255.255.0(This IP can be used as VLAN 200 Gateway IP)
Note: When the VLAN ID is defined on the physical switch, it can be configured for ESX. If the IP range is assigned to a VLAN, decide if any routing may be required to reach other nodes on the network.
To configure a VLAN on the portgroup using the VMware Infrastructure/vSphere Client:
- Click the ESXi/ESX host.
- Click the Configuration tab.
- Click the Networking link.
- Click Properties.
- Click the virtual switch / portgroups in the Ports tab and click Edit.
- Click the General tab.
- Assign a VLAN number in VLAN ID (optional).
- Click the NIC Teaming tab.
- From the Load Balancing dropdown, choose Route based on originating virtual port ID.
- Verify that there is at least one network adapter listed under Active Adapters.
- Verify the VST configuration using the ping command to confirm the connection between the ESXi/ESX host and the gateway interfaces and another host on the same VLAN.
Note: For additional information on VLAN configuration of a VirtualSwitch (vSwitch) port group, see Configuring a VLAN on a portgroup (1003825).
esxcfg-vswitch -p "portgroup_name" -v VLAN_ID virtual_switch_name
Note: The illustration attached to this article is a sample VST mode topology and configuration with two ESXi/ESX hosts, each with two NICs connecting to the Cisco switch.
For translated versions of this article, see:
- Sample configuration of EtherChannel / Link Aggregation Control Protocol (LACP) with ESXi/ESX and Cisco/HP switches (1004048)
Request a Product Feature
To request a new product feature or to provide feedback on a VMware product, please visit the Request a Product Feature page.