2

I have a few Windows Servers 2012 running on Hyper-V on my Windows 8 laptop.

-The servers need to have a static IP.

-The servers need internet acces.

I've configured the servers to have a static adress in the same range as my local network at home. (192.168.2.x in my case) I've configured the servers with the default gateway of the local network.

That all works nice and fine, till I move my laptop to an other network, with a different IP range. Ofcourse the servers can't access internet anymore.

What is a good solution for this problem, without changing the IP configuration for each server? Is there like a virtual switch/bridge/proxy for hyper-v?

2 Answers 2

2
+50

I believe you are asking about Virtual Networking for Hyper-V, which uses an External virtual switch to enable virtual machines to access all resources available on the physical network including the host machine and the Internet, while able to keep a fixed IP address within the Hyper-V environment.

The virtual switch is a virtual network adapter that is used by the virtual machines. This virtual switch connects to the physical network adapter, so keeps network and Internet connectivity even if the physical machine is moved between physical networks. Because the virtual machines connect to the virtual switch rather than to the physical one, they are insensible to the physical environment of the host computer.

Here are some sources for information regarding Virtual Networking for Hyper-V :

Virtual Networking for Hyper-V (part 1 of 6)
Step by Step Guide to Configure Windows Hyper-V Virtual Network
Create a virtual switch in Windows 8 Client Hyper-V
Understanding Hyper-V VLANs (if you decide to use the optional VLAN IDs)

If more information is required, many more reference material and articles can be found by on the Web.

0
3
  1. Put the VMs on an "Internal" network.
  2. On your Host:
    • open Control Panel
    • Network and Sharing Center
    • Change Adapter Settings
    • Open the properties of your Primary connection
    • Sharing Tab
    • Select the vEthernet corresponding with the "Internet" network you created
  3. Configure the servers with the Internal IP range and Gateway for ICS. You may want to just switch one to DHCP temporarily to get the settings.

Note: Your VMs will not be accessible by the external LAN anymore. They'll communicate with each other and use your host for access to the Internet, and can access resources on the external LAN in certain circumstances (the main problem is being able to find the external services, as they're on a different broadcast domain, and usually there's no mechanism for discovery between the two).

Alternately there are VMs that can do interesting address translation (NAT44 and such), but they're rather complicated and less reliable than the simplicity of ICS.

6
  • Thanks a lot for you suggestion. I've tried the steps, but the virtual machines require to be DHCP clients (thus changing the IP adress). And I can't find a way to configure the DHCP server.
    – Dennis
    Dec 31, 2014 at 10:21
  • So the condition 'the servers need a static IP' is not met...
    – Dennis
    Dec 31, 2014 at 10:30
  • ICS doesn't force the clients to need DHCP - just because you don't understand something does not make the answer wrong... Dec 31, 2014 at 11:28
  • I've change the IP's to the range specified in my question, and also changed the IP's of the servers. Pointing their default gateway to the ICS IP. Doesn't work... You just don't understand the question James Snell, or you're to lazy to read and test everything...
    – Dennis
    Dec 31, 2014 at 14:46
  • 1
    I answered your question, including the Static IP requirement. Please do not get abusive if you are unable to understand the answer. You never said it was necessary to use a particular address range. You can configure the range used by ICS in the registry key: HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters
    – Chris S
    Jan 1, 2015 at 17:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .