3

I have guest VM on a Windows Server 2012 R2 machine running Hyper-V. Currently, the guest is using the native vlan (vlan ID 1). I can communicate with the guest from the host and from the network. However, the guest is a Zebra/Motorola VX9000 wlan controller that will also need to handle traffic on vlan IDs 10 and 15. The switch port used by the host is untagged on vlan 1, and I updated the port to also be tagged on vlans 10 and 15. I also issue the following command via powershell:

Set-VMNetworkAdapterVlan -VMName MyGuest -Trunk -AllowedVlanIdList "10,15" -NativeVlanId 1

Unfortunately, after I execute this command I lose my ability to communicate with the guest. If I open the Hyper-V console for the guest, it does not have any network access. Trying to ping the guest from the host or other locations on the network results in a Destination host unreachable message.

I can "fix" it by returning the adapter to untagged mode:

Set-VMNetworkAdapterVlan -VMName MyGuest -Untagged

Now I can communicate with the guest again, but this doesn't really solve anything. I still need this guest to be able to handle traffic on vlans 10 and 15.

I don't understand why this happens. Untagged packets were vlan ID 1 before switching to trunk mode. Shouldn't it still be that way now? How can I get this guest to communicate on all of the vlans that I need?

The best I get from error message I see when pinging is similar to what I would see if there were no route. Do I need to issue a separate command to create a route for these networks after setting the port as a trunk (perhaps on the host)?

Joel Coel
  • 12,932
  • 14
  • 62
  • 100

2 Answers2

0

I only have a couple VMs set up this way and they also did not talk on the native VLAN. What we did to solve this was to set the native VLAN to something unused on the network, put the VLAN you want to use into the allowed, and then switched all the NICs inside the VM to tag their traffic.

E-Rock
  • 499
  • 3
  • 6
  • Hmm... I'm not sure I have that ability, as it's not a Windows or even Linux guest. The guest runs a customized version of Cisco's iOS. It should handle the vlan 10 and 15 stuff correctly already, but I don't think there's a way to make it tag management packets. – Joel Coel Jun 23 '15 at 20:16
0

I found a solution!

A post by alejanp at this link led me to try playing around with vlan 0, and the following command seems to be working:

Set-VMNetworkAdapterVlan -VMName MyGuest -Trunk -AllowedVlanList "1,10,15" -NativeVlanId 0

In short, I set native vlan to 0 and included my real native vlan in the allowed list.

Of course, this can only work as long as the untagged vlan needed for the guest matches the untagged vlan from the host/switch port. Thankfully, that is the case today.

Joel Coel
  • 12,932
  • 14
  • 62
  • 100