How to enable vlan trunking in Hyper-v

Get-VMNetworkAdapter -VMName “vmname” | Set-VMNetworkAdapterVlan -Trunk -AllowedVlanIdList “1-2048” -NativeVlanId “0”

This command is useful when virtualizing routers in Hyper-v. The alternative is to make individual switches and tag the switches. -NativeVlanId “0” means untagged traffic does not get assigned a vlan.

Leave a Reply

Your email address will not be published.