Hyper-V host with one External IP address. How do I assign guest VMs an internal IP and configure NAT?

I've been struggling with this for a few days now, I've got a Hyper-V host with one statically configured external IP address. There is no DHCP server or internal network to retrieve an IP. How do I assign VMs an internal IP and configure NAT using the hyper-v network manager and the networking tools in windows server 2008?

Right now, the FTP server is running windows server 2008 R2 Standard, and has hyper-v installed. The VM we have installed is Ubuntu 14.04 LTS. I have been stuck trying to figure out how to assign the VM an internal IP (preferably static) and perform NAT without a physical router to configure. This problem is made more challenging by the fact that I need to RDP into the server to make changes. A bad configuration change locks me out and requires a call to the datacenter to have them go unbork my configuration.

Do I need to create a second "external virtual network switch" and then use Internet Connection Sharing (ICS) to share the connection from the first virtual switch?

Since adding a second external switch will interrupt my current connection, will I still be able to RDP into the host after it's created or will I require someone at the datacenter to go over and manually configure the static IP before I can access it again?

Thanks in advance.


On your Hyper-V host, install Routing and Remote Access.

Then you can use RRAS to NAT from your public IP address inside to your virtual machines, using the IP addresses assigned to their virtual network adapters.

However, beware! Installing RRAS from a remote session often locks you out as you configure RRAS as your session becomes invalid under the new configuration. More on this in a minute.

As for the network switch configuration, generally yes, you would create a total separate, segregated network for your virtual machines and you would just poke ports into there via NAT. However I can't answer your question about whether or not adding the network will kick you out of the host.

Does your hosting provider give you Out Of Band access to the server? Rather than just remoting in, do they have a KVM over IP (such as HP's iLO or Dell's iDRAC or SuperMicro's really crap KVM-over-IPMI implementation) that they could give you access to? That way it won't matter if you bork your RDP connection as you have an out of band path to get back into the server.


You could always spin up a virtual firewall/router VM with two NICs, and route through to the VMs. PFSense plays nicely with hyper-v 2012r2+ and is incredibly easy to setup and manage.