Using VLAN Trunking with Hyper-V and SCVMM

Intro

With Windows Server 2008 R2 with Hyper-V, typically you would have multiple physical network connections to your switch, with each port belonging to a specific VLAN where required. This works fine if you only have a small configuration with only a few VLANs. However as the virtual infrastructure grows and you require more VLANs, how do you solve the problem without adding an insane number of add-on ethernet adapters to your servers?

To solve this problem, we must use VLAN trunking which is configurable when using System Center Virtual Machine Manager (SCVMM).

SCVMM Configuration

To enable VLAN trunking on the Hyper-V hosts perform the following steps on your SCVMM Server:

  1. Open the SCVMM Admin Console. Click Hosts from the left hand menu.
  2. Right Click on the host you would like to enable VLAN trunking on, click Properties.
  3. Click the Networking Tab.
  4. If you are going to modify an existing network select it, otherwise click Add and create a new one ensuring to select Physical network Adapter and add the network connection (interface) you wish to use.
  5. On the connection Click Edit.
  6. Check the Enable VLANs on this connection box.
  7. Next Tick Trunk Mode, and depending on what you would like to do you can add all VLAN IDs or you can add specific VLAN IDs as required.
  8. Click Ok to each window. 

Once the settings have applied the next thing you need to do is enable the corresponding switch interface to operate as a VLAN Trunk interface.

Switch Configuration

To enable the VLAN Trunk configuration to work correctly you need to enable trunking on your switches, specifically to the interface/connections you have enable for trunking on each of your Hyper-V hosts.

To do this on a Cisco switch see the below configuration example:

STK1#conf t
STK1(config)#interface gi1/0/2
STK1(config-if)#switchport trunk encapsulation dot1q
STK1(config-if)#switchport mode trunk

This will set interface gi1/0/2 to perform VLAN Trunking for all VLANs. 

Virtual Machine Configuration

This is the last bit of the puzzle. When you create virtual machines now you need to do two things:

  1. Set the Virtual Machine to use the Trunk Network you created earlier.
  2. Set the VLAN ID on the Network Adapter Settings page.

An example of these settings can be seen on the below screenshot:

No votes yet