Forum Discussion

barryhallett's avatar
barryhallett
Copper Contributor
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

4 Replies

  • barryhallett's avatar
    barryhallett
    Copper Contributor

    Hi Kidd_Ip

     

    Thanks for the detailed response.

     

    It seems I don't understand this community platform very well. I've responded twice but when I come back to this forum entry my responses are not showing.

     

    A few points that need further understanding.

    a) If I manage to get this VLAN setup (of which I have not managed so far) can you advise if I can still manage the VMs via Hyper-V manager remotely. At the moment I am assuming this will not be possible because the 5 VMs will be on there own isolated network. This is the reason why I was thinking I will have to change from Hyper-V core to a proper OS install thinking that if the Hyper-V is hosted on that I can then at least access the Hyper-V guests via the GUI based Hyper-V host.

    The main reason for my attempts being unsuccessful so far is because is I follow the instructions above then look at the remote Hyper-v manager I see that the guests are set to "VLANSwtich" but No VLAN ID is set. Has this anything to do with me trying to setup 5 checkpoints of 5 VMs as opposed to setting up 5 VMs without checkpoints?

     

    b) As I'm not that experienced in network setups I need a little more understanding on how to setup Hyper-V using a Trunk port. Can you advise a good reference on how to do that?

     

    c) Lastly again as I'm not that experienced in network setups I need a little more on how to setup the NAT to route traffic from VLAN 100 to the internet.

     

    Thanks in advance,

    Regards,

    Barry

  • 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.

    • barryhallett's avatar
      barryhallett
      Copper Contributor

      Hi Kidd_Ip,

      It seems i lost my last message in trying to respond. Sorry if this is a repeat.

      Thanks for the comprehensive resposnse. I will try this soon.

      In addition to the above can you advise how one manages these guest VMs remotely once these guest VMs are on there own private network with access to the internat? can i still use a remote Hyper-V manager to access the guest VMs?

       

      I also dont know how to set a 'switch' (I assume this is the network interface of the Hyper-V host) to a Trunk port. Any resource on how to do this? Also what do i need to set the NAT as in your last bullet point above?

       

      Lastly, Please be advised i want to perform this task on Hyper-V snaphots. Not the original install of the VM.

       

      Regards,

      Barry

    • barryhallett's avatar
      barryhallett
      Copper Contributor

      Hi Kidd_Ip,

      Thanks for a very comprehensive response. I will try this soon. A couple of questions however.

      a) Once the VLAN is setup from a remote Hyper-V manager on the guest VMs hosted on a remote host can i still access the individual guest VMs via the remote Hyper-V manager? Or do i lose that ability?

       

      b) The part about configuring a NAT and pfSense. Is extra hardware required for that and/or how are these individual items setup? My background is not IT.

       

      Thanks again,

      Regards

      Barry

Resources