HyperV VM Routing Network across the Host

Lincky 21 Reputation points
2021-04-11T11:46:52.483+00:00

My requirement seems to be accomplished which is documented at https://techcommunity.microsoft.com/t5/networking-blog/l2bridge-container-networking/ba-p/1180923.

I'd like to know if there is any other out-of-box solution to accomplish it.

Hyper-V Host A (LAN IP: 192.168.10.100/24)
Hyper-V Host B (LAN IP: 192.168.10.200/24)

They are under the same physical network switch.

I have created
VM1 under Hyper-V Host A by Private Network (LAN 192.168.2.100/24)
VM2 under Hyper-V Host A by Private Network (LAN 192.168.3.100/24)

VM3 under Hyper-V Host B by Private Network (LAN 192.168.2.200/24)
VM4 under Hyper-V Host B by Private Network (LAN 192.168.4.100/24)

In this condition,
Q1: I'd like to know if any possibility to create a virtual LAN switch for VM1 and VM3 as they are in the same IP Subnet
Q2: VM1 and VM2 as they are under the same Hyper-V Host A, any possibility to reachable with each other? Use IP route add? or another VM to host RRAS?
Q3: routing across VM1 , VM2, VM3, VM4 with each others.

Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
1,831 questions
No comments
{count} votes

Accepted answer
  1. Dave Patrick 330.5K Reputation points Microsoft MVP
    2021-04-11T13:58:41.023+00:00

    Simplest solution may be to add a second external vSwitch on both hosts, then plug into a dumb physical switch with no other connection. Then connect the isolated guests to this isolated vSwitch.

    --please don't forget to Accept as answer if the reply is helpful--

    No comments

4 additional answers

Sort by: Most helpful
  1. Lincky 21 Reputation points
    2021-04-11T16:22:06.797+00:00

    @Dave Patrick , well, it looks like it's the simple method as the workaround.

    I need to do some testing and simulate different AD sites and forest by different IPSubnet, while I cannot accommodate lots of VMs under one Hyper-V host. That's the reason I prepared 2 X physical machine ( HyperV HostA and HyperV HostB. )

    Because of the condition restraints,I cannot use external vSwitch for VMs directly which are hosted in HyperV HostA and HyperV HostB. Between VMs, I need to use Private Network so that VM1 and VM2 could access internet and they are under the same network. The same as VM3 and VM4.

    In that condition, Hyper-V Host A & Hyper-V Host B are under the same physical network switch.

    Hyper-V Host A (LAN IP: 192.168.10.100/24)

    1. VM1 under Hyper-V Host A by Private Network (LAN 192.168.2.100/24)
    2. VM2 under Hyper-V Host A by Private Network (LAN 192.168.3.100/24)

    Hyper-V Host B (LAN IP: 192.168.10.200/24)

    1. VM3 under Hyper-V Host B by Private Network (LAN 192.168.2.200/24)
    2. VM4 under Hyper-V Host B by Private Network (LAN 192.168.4.100/24)

    -------------

    So, the question remains,
    How to connect VMs into the same virtual network switch for 2 X physical Hyper-V Host

    Thanks.

    No comments

  2. Dave Patrick 330.5K Reputation points Microsoft MVP
    2021-04-11T18:32:47.83+00:00

    I need to use Private Network so that VM1 and VM2 could access internet

    A private vSwitch is not going to have internet access. A private vSwitch is only going to allow traffic between host and guest.
    https://learn.microsoft.com/en-us/archive/blogs/jhoward/hyper-v-what-are-the-uses-for-different-types-of-virtual-networks

    --please don't forget to Accept as answer if the reply is helpful--

    No comments

  3. Lincky 21 Reputation points
    2021-04-12T08:11:39.617+00:00

    alright,
    I have another discussion with internal IT
    they will connect to Hyper-V Host A and B on the 3rd Ethernet port to the same physical network switch.
    after which, different IP routings are through RouteOS
    Thanks


  4. Dave Patrick 330.5K Reputation points Microsoft MVP
    2021-04-12T13:06:58.973+00:00

    Sounds good, you're welcome.

    No comments