With this VMware KB you'll found how-to configure VLANS on your vSwitches, pSwitche and VMs.
Basically there are 3 methods of VLAN Tagging possible:
01 –External Switch Tagging (EST)
02 – Virtual Switch Tagging (VST)
03 –Virtual Guest Tagging (VGT)
I highly recommend also this following PDF document concerning VLANing in VMware ESX which you can find here: VMware ESX Server 3: 802.1Q VLAN Solutions
- Sample configuration – ESX connecting to physical switch via VLAN access mode and external switch VLAN tagging (EST Mode) (1004127).
- Sample configuration of virtual switch VLAN tagging (VST Mode) (1004074).
- Sample configuration of virtual machine VLAN tagging (VGT Mode) (1004252).
External Switch Tagging
* All VLAN tagging of packets is performed on the physical switch.
* ESX host network adapters are connected to access ports on the physical switch.
* The portroups connected to the virtual switch must have their VLAN ID set to 0.
Virtual Switch Tagging
* All VLAN tagging of packets is performed by the virtual switch, before leaving the ESX host.
* The ESX host network adapters must be connected to trunk ports on the physical switch.
* The portgroups connected to the virtual switch must have an appropriate VLAN ID specified.
Virtual Guest Tagging
* All VLAN tagging is performed by the virtual machine.
* You must install an 802.1Q VLAN trunking driver inside the virtual machine,
* VLAN tags are preserved between the virtual machine networking stack and external switch when frames are passed to/from virtual switches.
* Physical switch ports are set to trunk port.