The VLAN ID feature in Hyper-V allows you to support 802.1Q standards for VLAN Tagging. In short, it allows you to isolate hosts on the same physical network.
In the Hyper-V world, we can utilize VLAN IDs in two ways. We can isolate certain computers on the network or we can isolate VMs inside our hosts. First and foremost, your routers need to support and be configured with the VLAN identifiers. For the External and Internal virtual network configurations, you can isolate traffic to and from your host using a VLAN ID. You can do this for management purposes. As a result, only data tagged for the host VLAN will make it to your VMs. The other method is to configure the NICs of the VMs with a VLAN ID themselves. This is available in all three virtual network profiles. When used with the External profile, your VMs will only be able to communicate with VMs and physical host on your network with a matching VLAN ID.
Here is how you configure a virtual network with a VLAN ID.
In Hyper-V Manager, click Virtual Network Manager
Select External and click Add.
Check Enable virtual LAN identification for management operating system.
Select a number and click OK.
To configure a VM to use a VLAN:
Right click the VM you want to configure.
In the Hardware column, click the NIC you want to configure.
Check Enable virtual LAN identification.
Provide the VLAN number and then click OK