Mastering Windows Server 2016 Hyper-V

(Romina) #1
has been    configured  to  set via the untagged    configuration.
Do not set a VLAN ID on the physical NIC in the Hyper-V host that is used by the
virtual switch that will be connected to the virtual machines.
If you are using NIC Teaming, have only a single, default mode team interface
configured on the team.
Run all communications through the Hyper-V virtual switch and apply the VLAN
ID configuration on the virtual switch ports that correspond to the virtual network
adapters connected to the virtual switch.

This process makes configuring a VLAN simple. The only VLAN configuration
performed in the Hyper-V environment is within the properties of the virtual network
adapter, as shown in Figure 3.9, where I set the VLAN ID for this specific network
adapter for the virtual machine. The Set-VMNetworkAdapterVlan PowerShell cmdlet
can also be used to set the VLAN ID for a virtual network adapter, as in the following
example:


Figure 3.9 Setting the VLAN ID for a virtual machine's network adapter


Set-VMNetworkAdapterVlan –VMName test1 –Access –VlanId 173


If you refer back to Figure 3.2, something might seem confusing: the option to
configure a VLAN ID on the virtual switch itself. Does this setting then apply to every
virtual machine connected to that virtual switch? No. As the explanation text in the
dialog box explains, the VLAN ID configured on the virtual switch is applied to any
virtual network adapters created in the management OS for the virtual switch, which
allows the management OS to continue using a physical network adapter that has
been assigned to a virtual switch. The VLAN ID configured on the switch has no effect
on virtual machine VLAN configuration.


Note that if you do not require different VLAN IDs within the Hyper-V environment,
and all virtual machines effectively will use the same VLAN ID, then no VLAN
configuration is required at the Hyper-V host or virtual machine level. Simply use
untagged at the switch and configure whatever VLAN ID you wish all traffic to be

Free download pdf