Network configuration in a Hyper-V lab with domain controller, DHCP, and DNS

By | April 16, 2017

If you are running a virtual environment with a DC and DNS server you are likely to encounter a problem with the internet connection or the network connection between your machines. The issue is that your machines can either get an IP address from the DHCP server in your environment or from your router. In case it takes the internal address you don’t have internet access. If the machine takes the external address it may not see the other machines in your lab.
A possible workaround is to create two virtual adapters: The first one to connect the machines internally, the second one to grant them internet access.
Here’s what to do to get it achieved:
1. Create an internal and an external virtual switch in the Virtual Switch Manager in the right pane of your Hyper-V management console. Leave the settings default.


2. Right-click the virtual machines and select Settings. Click Add Hardware and select Network Adapter. Create a second network adapter for each machine in the lab that needs internet access.

The configuration gives you the option use RDP connections from your host computer which are more comfortable than Hyper-V connection. To allow RDP on servers, open the Server Manager, select Local Server and set Remote Desktop to on.

On workstations, open Control Panel, select System, go to the Remote tab and select Allow remote connections to this computer. Alternatively, configure the settings by GPO.
Btw, Microsoft provides an excellent lab with DC, DHCP, DNS, SCCM, MDT and many other installation as download on https://technet.microsoft.com/en-us/windows/mt604890.aspx

2 thoughts on “Network configuration in a Hyper-V lab with domain controller, DHCP, and DNS

  1. Lee

    This is exactly the scenario that I was attempting.

    I built Server1 as a Win2016 DC. I created a Private and an External Switch and assigned both to Server1. The Private vAdapter (as seen by Server1) gets assigned a static IP, and Server 1 is also a DHCP and DNS server for the ‘virtual’ domain. This all seems OK, and Server1 has internet access.

    Server2 (will eventually be SQL Server) currently only has the Private Switch assigned. It seems to be getting the IP config from the DHCP server on Server1 (10.x.x.x range) and can see Server1, so no problem there. But, I don’t want to add the External switch to Server2 – I wan’t to configure it so I can test the firewall / RAS / VPN / Etc, so any access (other than the HyperV management connection) would have to route through Server1, just as if it was a server out on the net (I may end up setting up a separate RAS server, since I don’t think it’s actually best practice to have these services on a DC).

    So, I add Routing services to Server1, figuring I would just configure the ‘virtual’ network w/ NAT or as a direct LAN-to-LAN connection, but this doesn’t seem to be working. Server2 can resolve internet names, but can’t actually get to any sites. I have a feeling this is a firewall issue, but as far as I haven’t found any Firewall rules that seems to be blocking web traffic. Any thoughts?

    BTW, I will check out that MS Lab! Seems like just what I need!

    Thanks for any additional thoughts.

    -Lee

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *