Print
 
How do you configure a trunk port on a cisco switch for ESXi Server..
 
 
Why would you want to do this...
To segregate traffic on different VLANs for improved security (802.1q). Meaning you will be able to put virtual machines onto different VLANs (Maybe you have dev, test and production VLANs).
 
Before you configure the port as a trunk port, ensure that you set the correct VLAN ID on the port groups, especially the management network. Otherwise you will be unable to connect and manage the server via vSphere client. If you cannot connect afterwards you can connect to the service console via the server terminal pressing ALT+F1 and then using the esxcfg-vswitch commands set the correct VLAN ID or remove it.
 
 
 
Configure a single port a trunk port and allow all VLANs on the trunk


interface GigabitEthernet1/0/1
description esxi-01
switchport mode trunk
switchport trunk
switchport nonegotiate
spanning-tree portfast trunk
spanning-tree bpduguard enable
 
 
Comfigure a range of ports a trunk port and only allow specific VLANs on the trunk
 
interface range GigabitEthernet1/0/1-4
description esxi-01
switchport mode trunk
switchport trunk allowed vlan 101,120-130
switchport nonegotiate
spanning-tree portfast trunk
spanning-tree bpduguard enable
 
 
 
NOTE: You cannot use VLAN 1 in virtual switches with trunking because the traffic is not tagged.