Windows Server 2012, Hyper-V, how to use 1 IP for all VMs?

5,064

You need to setup internet connection sharing, which does Network Address Translation (NAT). With this setup, the machines will all use private IP addresses, and you have to forward ports from the public IP to the appropriate internal addresses.

Server 2012 supports this already - you would set this up on the host. There is a guide here that walks you through the process.

Alternatively, you could setup a virtual machine running pfSense or some other firewall OS. It would have two network connections, one to the outside world, which gets the public IP address, and one that is connected to the same virtual switch as all the virtual machines. This makes it act as though you had plugged all the VMs into a physical NAT device/router.

The seperate firewall virtual machine can give you a lot more control over how everything is setup than ICS, but it's also one more virtual machine to have to maintain. So you can decide which option works better for your environment.

Share:
5,064

Related videos on Youtube

Adam B
Author by

Adam B

Updated on September 18, 2022

Comments

  • Adam B
    Adam B over 1 year

    I am running Windows Server 2012 to host several VMs. However, our ISP has only assigned us two IP addresses, one of which is assigned to the host o/s (Windows Server 2012). How can I set this up so all the VMs share the same second IP address, and traffic gets routed appropriately to the VMs?

    Assuming there is a way, would this cause a lot of overhead since it has to now do some additional routing? I realize the perfect answer might be to get just more IPs or use a external stand-alone router, but this is not feasible for me.

    • DanBig
      DanBig over 10 years
      What is your goal? Why is a static IP assigned directly to a server? Is there no gateway device in place?
    • Adam B
      Adam B over 10 years
      The ISP has alotted me 2 static IP addresses. I chose to have one assigned to the host o/s.