Forum Discussion

barryhallett's avatar
barryhallett
Occasional Reader
Nov 21, 2025

Hyper-V Core - Setting up a VLAN

Hi All,

 

Forgive me if I've put this post in an incorrect location. I'm not a large user of Microsoft forums. I have tried to find where to create a post under the servers section but I cannot find the create post button in that community. I'm happy for this post to be moved to the correct location.

 

I have a server running Hyper-V core 2019 of which I remotely connect to from a Windows 10 Pro computer using Hyper-V manager. I have a number of VM and relevant snapshots on it.

 

I have recently been asked by work to investigate setting up a VLAN on this server to group together 5 VMs on there own private network (hopefully using my existing VMs) with access to the internet. I have searched online on how to do this and in most cases the host Hyper-V server is a full blown OS not a base Hyper-V core. Can anyone guide me on the best source of information on how to setup this requirement? At this time I am imagining that most work has to be done on the command line screen of Hyper-V core via command line entries or PowerShell commands.

 

If this is not possible can someone point me to reliable information on how i can upgrade my Hyper-V core  to a full blown OS with a GUI ideally without losing my existing VMs?

 

Thanks in advance.

Regards,

Barry

1 Reply

  • Yes, you can set up VLANs on Hyper-V Core 2019 using PowerShell, and your existing VMs can be grouped into a private network with internet access. You don’t need to upgrade to a full GUI OS to achieve this:

    1. Create a Virtual Switch
    Use PowerShell to create an external virtual switch that supports VLAN tagging:

    New-VMSwitch -Name "VLANSwitch" -NetAdapterName "Ethernet" -AllowManagementOS $true


    •    Replace "Ethernet" with your actual physical NIC name.
    •    This switch will allow VMs to communicate externally and with each other.
    2. Assign VLAN IDs to VM network adapters
    For each VM you want to isolate into a VLAN:

    Set-VMNetworkAdapterVlan -VMName "VM1" -Access -VlanId 100
    Set-VMNetworkAdapterVlan -VMName "VM2" -Access -VlanId 100
    ...


    •    This puts all 5 VMs into VLAN 100.
    •    Use different VLAN IDs for other groups.
    3. Enable internet access
    To allow internet access:
    •    Ensure the physical switch port connected to your Hyper-V host is configured as a trunk port.
    •    Allow VLAN 100 on that trunk.
    •    Configure NAT or use a virtual router VM (e.g., pfSense) to route traffic from VLAN 100 to the internet.

Resources