Configuring a Hyper-V Lab Internal Network | Scripters Inc (2024)

This setup is for running an internal network within Hyper-V server on a physical Server 2016 R2 host machine.

Step 1: Internal Network

In Hyper-V Manager, open the Virtual Switch Manager. Create a New VirtualNetwork Switch, call it ‘Internal’ and make sure the Connection Type is set as Internal Network.

On each VM, go to Settings and click on Add Hardware. Choose Network Adapter, and from the Virtual Switch dropdown menu, choose Internal. Leave other settings as default.

On the physical host machine open Network and Sharing Center and click on Change Adapter Settings.

Find the connection that is your physical nic (mine was called Ethernet) and right click and choose Properties. Click the Sharing tab and click the checkbox to ‘Allow other network users to connect through this computers Internal connection. The Home Networking Connection will be vInternet (Internal). Disable the nic and re-enable it. This was setup to allow for Internet connection to the Internal network but it never worked.

Now go to the properties of the vEthernet (Internal ) switch and go to TCP/IP v4. Enter the following:

  • Set static IP to 192.168.10.1
  • Subnet mask to 255.255.255.0
  • Default Gateway is blank (because the switch is the default gateway)
  • DNS server is the IP of your DC01 vm on your internal network running DNS, DHCP, AD. Mine is 192.168.10.2

Step 2: External Network

In Hyper-V Manager, open the Virtual Switch Manager. Create a New VirtualNetwork Switch, call it ‘External’ and make sure the Connection Type is set as External Network. From the dropdown choose the physical NIC card of the host machine. Make sure you checkmark “Allow the management operating system to share this network adapter.” Click OK and exit.

When you go to the host machine’s Network Connections, you will see three NICs listed

  • vEthernet (Internal) – Hyper-V Virtual Ethernet Adapter #1
  • vEthernet (External) – Hyper-V Virtual Ethernet Adapter #2
  • Ethernet ( the machine’s Physical NIC card)

What’s interesting is that as soon as you add an external Hyper-V virtual NIC, it changes the settings of the host’s physical NIC in that IPv4 and IPv6 are now unchecked but ‘Hyper-V Extensible Virtual Switch’ is now selected. Hyper V has now created a tunnel from the physical NIC card to the virtual External NIC.

Right click the Ethernet NIC and choose properties. Go to the Sharing tab and check both checkboxes. Choose vEthernet (External) from the dropdown.

Next, open the properties of the External virtual NIC and add static IP settings. I added a free address from the range set on my physical router

  • Set static IP to 192.168.1.76
  • Subnet mask to 255.255.255.0
  • Default Gateway to 192.168.1.254
  • DNS is 192.168.1.254

Setting up internal networking on your VM’s

Now go to each of your vm’s and power them down. In Hyper-V manager, right click on your first vm and choose Settings. Add a Network Adapter andin Settings, choose External for the Virtual Switch. You will now have 2 network adapters – Internal and External. Click OK to save the settings and boot the VM. Do the same for the other VMs (I had only one other as my SharePoint server, SP01).

Log into the DC01 VM and open the properties of the Ethernet 1 NIC. Thisis your internal network virtual NIC. Set the static ip settings to:

  • Set static IP to 192.168.10.2
  • Subnet mask to 255.255.255.0
  • Default Gateway to 192.168.10.1
  • DNS is 192.168.10.2 (because this machine is running DNS for the internal network)

Log into the SP01 VM and open the properties of the Ethernet 1 NIC. Thisis your internal network virtual NIC. Set the static ip settings to:

  • Set static IP to 192.168.10.3
  • Subnet mask to 255.255.255.0
  • Default Gateway to 192.168.10.1
  • DNS is 192.168.10.2

On each vm make sure that you’ve enabled Network Discovery, by going to Network and Sharing Center – Change Advanced Sharing Settings – Click on the Internal Network – and choose Turn on Network Discovery. With the Internal network settings done you should be able to ping each machine by IP and by name. You may need to reboot both VM’s and wait for awhile before the machine names are registered in DC01’s DNS.

But what about Internet access?

Setting up external networking on your VM’s

This is why we added the second External NICS to our VMs, to allow for internet access through the vEthernet (external)NIC that was added/enabled on the host machine.

For these NIC settings, I left them as default but you could run Ipconfig /all from a cmd window to see what address is being assigned and set it as a static IP.

And that should be it. The machines should be able to ping by name or IP and they should have internet access as well.

Configuring a Hyper-V Lab Internal Network | Scripters Inc (2024)

References

Top Articles
Latest Posts
Article information

Author: Eusebia Nader

Last Updated:

Views: 5785

Rating: 5 / 5 (80 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Eusebia Nader

Birthday: 1994-11-11

Address: Apt. 721 977 Ebert Meadows, Jereville, GA 73618-6603

Phone: +2316203969400

Job: International Farming Consultant

Hobby: Reading, Photography, Shooting, Singing, Magic, Kayaking, Mushroom hunting

Introduction: My name is Eusebia Nader, I am a encouraging, brainy, lively, nice, famous, healthy, clever person who loves writing and wants to share my knowledge and understanding with you.