InfotechGuyz.com Blog

How to route Hyper-V virtual networks between two hosts

This article explains how to route Hyper-V virtual networks between two physical hosts. This is a very advanced concept so I assume you have at least some experience with Hyper-V networking. This technique allows you scale a very large network / active directory environment across multiple physical hosts. You can deploy five to six VMs on each physical host and allow it to communicate while using its own IP address range. This technique is very useful when building a large Active Directory environment consisting multiple site and domains. You can assign different subnet to each virtual network and use this technique to allow communication between multiple hosts.

hyerpv

 

Step by step high level overview
  1. Follow the instructions on how to route between two networks here.
  2. create an external network and bind to physical NIC
  3. configure RRAS for Routing and NAT
  4. add static routes to both hosts
  5. confirm network connectivity

 

Step #1 - Follow the instructions on how to route between two virtual networks here.

Step #2 - create an external network and bind to physical NIC

  1. Open Hyper-V manager, ( Server Manager > Roles > Hyper-V)
  2. On “Actions” pane, click Virtual Network Manager
  3. Choose “New virtual network”, “External” click on “Add”
  4. Enter network name, choose your primary physical network adapter. See screenshot
  5. Click OK

 

hyerpv

 

Important note: Make sure your physical NIC bind to Microsoft Virtual Network Switch or else the packets will stop at the physical interface ( running tracert can prove this). This is needed to route traffic that come in from your physical interface to the VM’s loopback interface which is part of Microsoft Virtual Network Switch. You can do this by creating new External Virtual Network and selecting your physical adapter.

hyerpv

Step #3 - configure RRAS for Routing and NAT

  1. Open “Routing and Remote Access” console. ( Server Manager > Network Policy and Access > Routing and Remote Access)
  2. Right click on “Routing and Remote Access” and choose “Configure and Enable Routing and Remote Access”
  3. Choose “Custom Configuration”
  4. Choose “NAT” and “LAN routing”, click Next
    NAT allows your VMs to access the internet without exposing them.
    LAN routing allows you route between Local Area Connections
  5. Click Finish and Start the service.
  6. Browse to “NAT” under IPv4, Right click and choose “New Interface”, choose the interface that you use to connect to the internet.
  7. Choose “Public interface connected to the internet”, check “Enable NAT on this interface”, click OK

Step #4 - add static routes to both hosts

  1. Use “route add” command or RRAS console to add static route for virtual networks ( this allows the host to forward traffic to a physical host that is hosting the virtual network)

Step #5 - confirm network connectivity

  1. use “Ping” and “tracert” to troubleshoot network connectivity between VMs, Virtual networks and hosts.