Skip to content

How to assign VLAN ID to virtual NIC in Hyper-V

How can you run multiple virtual machines on different subnets on a Hyper-V server if you don’t have a System Center Virtual Machine Manager? Let’s say you have different subnets for Management, DMZ, LAN and you need to configure the VMs on the right subnet.

First, your network administrator needs to create the VLANs and  configure a trunk port on the physical switch and then you need to connect the physical NICs from the Hyper-V server to the trunk port.

Now you have two options to set the VLAN ID for the virtual machine NIC, one is using Powershell and the other one using the Hyper-V GUI.

The fastest way is to use the Powershell command: Set-VMNetworkAdapterVlan -VMName myvm -Access -VLANId 100 .

Using the GUI you have to go on the VM settings, then select network adapter and enable virtual LAN identification.

Hope that this helps!

Published inGeneral

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.