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.

  • Thanks for the quick answer, I've just left the office and will give it a stab tomorrow morning. We don't have OOB access unfortunately. but I will probably coordinate with a technician over there to minimize downtime and have them perform any additional config changes that need to happen.
    – gnarbarian
    Aug 13 '15 at 1:16
  • So, I've installed the service but I have not finished configuring it. Which options do I need to select? The first option on the wizard allows me to select different configurations. Should I select "NAT", "VPN and NAT", or "Custom" ?
    – gnarbarian
    Aug 13 '15 at 23:29
  • @gnarbarian honestly I couldn't tell you off the top of my head. It's been a few years since I worked with RRAS. Pretty sure you want to start with the "NAT" configuration, but I am 95% sure this will kick you off your remote session. Aug 14 '15 at 2:33
  • @Mark_Henderson Well luckily enough it didn't boot me off. Thanks a million for all your help so far. I went through the wizard (selecting NAT) and selected LAC4 (the adapter that gets the IP address) as the public adapter. and I selected LAC5 (the hyper-v internal adapter) as the private adapter. VMs still can't access the outside network though. Do I need to set up a static route from a gateway IP of my choosing to the gateway IP of the parent network?
    – gnarbarian
    Aug 14 '15 at 2:58
  • @Mark_Henderson Welp, this is strange. I created the static route. tried to connect with the VM. it failed. I then deleted the static route and now I can't connect to the server at all. via FTP or RDP. going to have to wait until tomorrow morning probably to get a tech out there to troubleshoot it with me.
    – gnarbarian
    Aug 14 '15 at 3:10

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.

  • This is a really cool idea and might be preferable to going with the RRA solution posted by Mark Henderson. His solution seems like it would be slightly easier to implement so I am going to try his first. I wish I could mark both answers as correct!
    – gnarbarian
    Aug 13 '15 at 20:47
  • 1
    This is generally how I approach it, mostly because I don't like to run any additional roles on my hyper-v systems if I can avoid it. Either solution should work, just depends on your strategy.
    – qovert
    Aug 13 '15 at 20:50
  • 1
    I did think of this idea, but the you have to somehow get your public IP address into the PFSense box, which still requires some form of local routing, lest you lose the access to your physical host. Aug 13 '15 at 21:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.