VLAN on hyper-V

Uri B 6 Reputation points
2021-02-07T12:50:34.507+00:00

Hello
I am using hyper-V on windows server 2016 essentials.
I have an OPNsense router serving 3 VLANs on the same physical port of the server
I have configured a virtual switch on this physical port with VLAN10.
I have an ubuntu 20.04 VM. I have set VLAN 10 in it's network adapter configuration.

When I enter the Ubuntu VM, I get a message:
Connection failed: Activation of network connection failed
64914-image.png

Without the VLAN settings on the switch & adapter - the VM works fine on the base network with no VLAN tag.

Questions:

  1. What am I doing wrong? how do I get the VM to hook up to VLAN 10?
  2. I need to run several VM's on 3-4 different VLANS but only have 2 network ports on the server. what do I do?

Thanks
Uri

Windows for business | Windows Client for IT Pros | Storage high availability | Virtualization and Hyper-V
{count} vote

2 answers

Sort by: Most helpful
  1. Xiaowei He 9,936 Reputation points
    2021-02-17T08:22:41.8+00:00

    Hi,

    Since I'm not familiar with Ubuntu VM, would you please set a a test Windows VM and connected to the virtual switch, then check if the Windows VM could access the network.

    Best Regards,
    Anne

    0 comments No comments

  2. Bear, Uri 1 Reputation point
    2021-02-23T16:37:33.233+00:00

    Hi
    I have spun up a brand new win10 VM on the main network switch and let it update to latest.
    Built a new virtual network switch (VLAN40) and set it's VLAN to 40.
    Usingt VLAN40 and (VLAN==40) on the network adapter, the DHCP is not found
    same with only (VLAN==40) on the network adapter

    With just VLAN40 switch - DHCP brings regular network IP address, not from VLAN

    Regular network DHCP when VLAN not set on switch or virtual network card.

    so it seems like the VLAN definition on the virtual LAN switch is bad.

    Now removed VLAN definition from switch and virtual network card.
    connected a physical smart switch to the network and set VLAN 40 on port 1.
    connected the server physical network port to this port on the switch
    Windows VM and ubuntu VM. Both got an IP address on the VLAN range.

    rechecked:
    re-connected the servers physical network port to the main network switch
    set VLAN = 40 on the virtual switch and on the virtual network port for the Win10 VM.
    No DHCP connection
    same for ubuntu VM

    deleted the virtual switch for VLAN40/physical port #2 and rebuilt it
    same results

    0 comments No comments

Your answer

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