I've been playing around with Server 2016 and the ViaMonstra Hydration Kit for ConfigMgr. If you want your lab environment to be able to connect to the internet, you know (if you've been reading our books) that you need to setup a virtual router. In Kent's book (System Center 2012 R2: Mastering the Fundamentals), we actually walk you through setting up a very complex environment that requires you to use our "GW01" or a Vyatta virtual router in order for your lab to get out to the internet.
In Server 2016 (and Windows 10), there is a new feature called NAT network which allows you to get your VMs out to the internet without the need to setup a virtual router. Below are the PowerShell commands to do the setup *based on the ViaMonstra environment*. If you use our hydration kit and customize it for your environment, you'll need to customize what's below to match your unique configuration.
Note: If your Hyper-V host is using the same address space as the NAT-enabled virtual switch, you need to change one of them. For example, having your home network (and your Hyper-V Lab Host) both using the 192.168.1.0 address space will not work.
New-VMSwitch -SwitchName "ViaMonstraNAT" -SwitchType Internal New-NetIPAddress -IPAddress 192.168.1.1 -PrefixLength 24 -InterfaceAlias "vEthernet (ViaMonstraNAT)" New-NetNat -Name ViaMonstraNATNetwork -InternalIPInterfaceAddressPrefix 192.168.1.0/24
Once the switch is created, simply configure the virtual machines to use it.
DC01 from the hydration kit configured to use the new switch.
If you want more info, please visit Thomas Maurer's blog, it's very shiny.
Thanks for reading
I've following the instructions and on my DC, I used the following:
IP Address: 192.168 1.200
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.1
Preferred DNS Server: 192.168.1.200
Alternate DNS Server: 126.96.36.199
I can ping 192.168.1.200, and 188.8.131.52 but I pinging 192.168.1.1 fails. What am I doing wrong?
Maybe the host firewall does not allow ping… The 192.168.1.1 is on the host level,
Hi Ami, thank you for the post. I think it is important for readers to note that this will not work if your Hyper-V host is using the same private address space that is used by the NAT-enabled virtual switch. For example, if your home network (and your Hyper-V Lab Host) is using the 192.168.1.0 address space for itself, then the above NAT configuration will not work.
Thanks, added a note with that information.
How does this work if you also have an Enterprise Proxy on your Corporate Network. I've followed the instructions but I'm not even getting prompted for Proxy Authentication on the DC01/CM01 devices?
The NAT gateway in Hyper-V usually uses the Internet connection of the host, but I haven't tested in Proxy environments. But, first make sure NAT is setup correctly by trying to ping resources on your network (from DC01/CM01). / Johan
Hi Johan, I can ping IP addresses of devices on my corporate LAN from the Hydration devices but I can't access anything on the internet. I just can't get them to hit the proxy authentication servers. I've got a few other things to try today so we'll see.