Setting 802.1Q Priority in Windows using Hyper-V Adapters

125 Views Asked by At

I want to be able to send packets with 802.1Q (VLAN) headers set to multiple VLAN IDs and Priority Code Points (PCP) to test our networking equipment.

I was able to successfully configure multiple VLANs via Hyper-V adapters using the instructions found on this blog.

Windows allows setting the PCP via QoS policies, which I was able to set up using the New-NetQosPolicy Powershell command. As a test, I set up a QoS policy for all my traffic using New-NetQosPolicy -Name "Test" -PriorityValue8021Action 7 -DSCPAction 56.

This does set the correct 802.1Q PCP on VLANs created through the Intel ProSet and Realtek driver utilities, but the PCP on the Hyper-V adapter traffic stays as 0 (default). The DSCP in the IP header does change to 56 for all traffic, so the policy is being applied. The Intel ProSet driver configuration is deprecated and does not work on Windows 11, so I'd rather not rely on it.

I did see Set-VMNetworkAdapter has a IeeePriorityTag property, whcih I se to On.

Am I missing something, or does this functionality not work? I'm using Windows 10 21H2. All traffic from the main OS, no virtual machines involved.

New-VMSwitch -Name "vSwitch" -NetAdapterName "Ethernet" -AllowManagementOS $true
Add-VMNetworkAdapter -ManagementOS -Name "VLAN5" -SwitchName "vSwitch" -Passthru | Set-VMNetworkAdapterVlan -Access -VlanId 5 -Passthru | Set-VMNetworkAdapter -IeeePriorityTag On
New-NetQosPolicy -Name "Test" -PriorityValue8021Action 7 -DSCPAction 56
0

There are 0 best solutions below