#PSTip Configuring trunk mode in Hyper-V

With the introduction of Hyper-V in Windows Server 2012, the Hyper-V Extensible Switch became available providing more functionality than previous versions. One of the new features was support for VLAN trunk mode, making it possible for a virtual machine to see traffic from multiple VLANs. This might be a need for virtual machines running network services such as a reverse proxy.

Configuring trunk mode for a virtual network adapter is not supported from the Hyper-V Manager; only a single VLAN can be configured:


In order to configure trunk mode, we can use the Hyper-V PowerShell module:

Set-VMNetworkAdapterVlan –VMName DemoVM –Trunk –AllowedVlanIdList 1000-1050 –NativeVlanId 1000

The above example will enable the virtual machine DemoVM to send and receive traffic on VLAN 1000 to 1050. If no VLAN is specified in the network packet, it will be processed on VLAN 1000.

Filed in: Hyper-V Tags: ,

3 Responses to "#PSTip Configuring trunk mode in Hyper-V"

  1. Johan says:

    Does not work in Server 2016? Been at this for ages and for some very weird reason the native vlan will work, not any vlan that is in the –AllowedVlanIdList.

    • edward says:

      Hi Johan… I’m in the same boat… tagged frames between my to Cisco Virtual Routers are not getting through … if I set to native no problem… Did you every get any insight into this


Leave a Reply

Submit Comment

© 2018 PowerShell Magazine. All rights reserved. XHTML / CSS Valid.
Proudly designed by Theme Junkie.
%d bloggers like this: