Creating virtual NICs on a Hyper-V host OS that accesses or uses vlans in a trunked virtual switch

itnifl
itnifl used Ask the Experts™
on
Is this possible?
To me it seems like not.

From what I can see, it is possible to let the host OS share the NIC that a virtual switch is created on, but it is not possible to create a virtual NIC on a Hyper-V host OS that accesses or uses vlans in that virtual switch. Or is there a way?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
If you share the virtual switch on the host, you can set a VLAN ID for the host in the HyperV Virtual switch manager.
For the guest machine, you set the VLAN setting in the NIC properties of the virtual machine.
itniflProgrammer

Author

Commented:
Yes same as I wrote, but that only leaves me with one network setup for the host that is shared with the virtual switch. I want several. Perhaps creating subinterfaces on the windows host, on the samee physical nic, will do the trick? If possible?
The VLAN setting for the host has nothing to do with the guest OS.
If you allow the host to share the virtual network, you get an additional virtual NIC beside the virtual switch, And for this Virtual NIC you can set the VLAN.
Whatever you set here, you can assign any other VLAN on the NIC properties of the guest.

If you want to have several NIC inside a guest, you can add several NICs connected the  same or another virtual switch (if your host has more than 1 NIC) and assign each guest NIC a different VLAN.

The only thing what you can not do is to have two virtual networks which can be used by the host  which are bound on one virtual switch. The rule for the host is: 1 virtual switch = 1 virtual NIC. or number of virtual NICs <= number of virtual switches (on the host)
Angular Fundamentals

Learn the fundamentals of Angular 2, a JavaScript framework for developing dynamic single page applications.

itniflProgrammer

Author

Commented:
I am sorry to have to correct you, but there is no talk of guest operating systems here. The text I wrote offers no interpretation into a subject of guest OS networking. I want to find a way to share the host network with the virtual switch in more then one instance. Normally when you share the virtual switch with the host, you have only one NIC you can configure for the host (one instance). This gives you one vlan for the host, in one subnet, with one ip-address. I want several, so that I may use the host OS as if it was a guest OS. This limitation is what I have seen, that I suspect is not possible to get around, and that you restate here is the case.

So in short you are stating that you think it is not possible. Please inform if otherwise.
The rule for the host is: 1 virtual switch = 1 virtual NIC. or number of virtual NICs <= number of virtual switches (on the host) .

In other words, if you want to have 2 VLAN connections for your host, you need two physical NICs.

It is like in hardware switches, there you usually can assign one single port also only to one single VLAN. The connection between VLANs are routers.
So even you would have the chance to do it on the host, you physical switch would not be able to handle it.
itniflProgrammer

Author

Commented:
Sure, you can trunk the vlans.
But back to the question; I guess the host was never intended to act as a guest on to the virtual switch per design, which is understandable.

I have a manager (not in my department, but connected to it), he is very enthusiastic and keeps stating that this must be possible (using the host as a guest to the virtual switch). He seems so convinced that I almost dare not contradict him. So I told him I didn't think so, but I would look into it. I have done so twice now. Both by labbing this myself, and asking here. Bet he won't give up still.
Hi itnifl,

ok, your last response explains the point, so I don't want to let you in the rain....
With vlan trunks you  pointed me to an idea, and voila...

Ok, first at all, It doesn't work with HyperV virtual networks / Virtual Switch, so your colleague is wrong (if you want to be persistent as him).
The trick is before the virtualization.
Second, it is also not recommended...
But it seems to work...

There is a trick, with teaming....
https://community.mellanox.com/docs/DOC-1845
http://blogs.technet.com/b/keithmayer/archive/2012/11/20/vlan-tricks-with-nic-teaming-in-windows-server-2012.aspx

 The second article explains it more in detail.
itniflProgrammer

Author

Commented:
Looks like something similar to the intel vlan solution that has been tried already, but without the intel drivers. I will test it, thank you.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial