Issue with Hyper-V VM on Tagged VLAN – Traffic Reaches Local Hosts but Not External Networks

PieroB 1 Reputation point
2025-12-11T12:27:55.28+00:00

Hi everyone, I’m having an issue getting a Hyper-V VM to work correctly when using a tagged VLAN interface.

I have a test VM configured with a trunk port and a tagged VLAN. Here is the configuration I’m using:

Set-VMNetworkAdapterVlan -VMName "testvlan" -Trunk -NativeVlanId 2 -AllowedVlanIdList "4"

The strange part is this:

When the VM is on VLAN 4 (tagged), it can reach other resources on the same VLAN as long as those resources are running on the same Hyper-V host.

But if the target resource is outside the Hyper-V host, the VM cannot reach it at all.

The hardware vendor has already ruled out any issue with the top-of-rack switches interconnecting the hosts.

If I reconfigure the VM’s network adapter in access mode on the same VLAN, then all traffic works normally and the VM can reach resources outside the host without any problem.

So it seems that traffic leaves the host correctly only when the adapter is in access mode, not when using a trunk with VLAN tagging.

Has anyone seen this behavior before or has suggestions on what to check next?

Thanks!


Moved from: Community Center | Not monitored

Windows for business | Windows Client for IT Pros | Devices and deployment | System management components
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Himanshu Shekhar 1,860 Reputation points Microsoft External Staff Moderator
    2025-12-11T13:33:07.3633333+00:00

    @PieroB - Thank you for reaching Microsoft QnA platform

    It seems like you're experiencing issues with VLAN tagging in your Hyper-V configuration. Here are a few things to check based on your description:

    1. VLAN Configuration: Ensure that the VLAN ID you are using (VLAN 4) is properly configured on both the Hyper-V host and the physical switch. The switch ports must be configured to allow traffic for VLAN 4 and should not be blocking it.
    2. Trunk Port Configuration: Verify that the trunk port on the Hyper-V host is set up correctly. The trunk should allow the VLANs you are trying to use. You can check this with the following PowerShell command:
            Get-VMNetworkAdapterVlan -VMName "testvlan"
      
      This will show you the current VLAN configuration for the VM.
      1. Network Adapter Settings: Make sure that the network adapter settings in the VM are correctly set to use the trunk mode. You might also want to check if the native VLAN ID is set correctly and that it matches the configuration on the physical switch.
      2. Firewall and Security Settings: Check if there are any firewall rules or security settings that might be blocking traffic from the VM to external networks when using tagged VLANs.
      3. Physical Switch Configuration: Since the hardware vendor has ruled out issues with the switches, ensure that the switch ports connected to the Hyper-V host are configured to handle tagged VLAN traffic correctly. This includes checking that they are set to trunk mode and allowing the necessary VLANs.
      4. Testing with Different VLANs: If possible, try configuring the VM to use a different VLAN ID to see if the issue persists. This can help determine if the problem is specific to VLAN 4.

    If after checking these points the issue still exists, consider reviewing the logs for any errors related to networking or VLAN tagging that might provide further insights into the problem.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.