8

I'm setting up OpenBSD as a VM in HyperV 2012. It would be easier for me to just create one interface on the vm and have OpenBSD take care of setting up the vlans.

Is it possible to tell HyperV to send all traffic to a port whether it's tagged or not?

If I uncheck the "Enable virtual LAN identification" it looks like HyperV is only sending untagged traffic to the port.

MDMarra
  • 100,183
  • 32
  • 195
  • 326
Guillaume Filion
  • 967
  • 1
  • 10
  • 13
  • If you wanted to bring the trunk into the Hyper-V switch instead of a specific VM, how would you do that? – radiowhiz Jan 31 '16 at 06:07

1 Answers1

8

Using the PowerShell Set-VMNetworkAdapterVlan cmdlet, you can turn on trunk mode on the virtual NIC. I don't think there is an equivalent GUI option for this.

Set-VMNetworkAdapterVlan -Trunk -AllowedVlanIdList "100,101" -VMName "VmName" -VMNetworkAdapterName "TrunkNic" -NativeVlanId 1
  • -Trunk turns on trunk mode, which leaves the VLAN tags intact.
  • -AllowedVlanIdList specifies which VLAN's to allow the guest to use. This parameter is mandatory in trunk mode. If you have a largeish number of VLANs, you also can use ranges like -AllowedVlanIdList "1-4000"
  • -NativeVlanId is required, too. It specifies which VLAN outgoing untagged packets belong to. I think that it also has strips off the VLAN tag for incoming packets on that VLAN. Or something like that. I remember that there was a weird behavior here that I completely sidestepped by just setting this to an unused, blackholed VLAN and not using the untagged interface in the guest, because that was easier to configure and seemed less fragile to me.
the-wabbit
  • 40,319
  • 13
  • 105
  • 169
longneck
  • 22,793
  • 4
  • 50
  • 84
  • Thanks a lot, I'll check it out tomorrow and let you know how it works! – Guillaume Filion Jun 25 '13 at 21:56
  • It looks to me the VM's VLAN in range of AllowedVlanIdList can not talk to each other. The VMs on NativeVlanId can talk to each other. Does some settings miss? Does the Nic should connect to which virtual switch? –  Jul 30 '13 at 11:18