How can I configure my Server 2012 Hyper-V lab setup with NAT?

3

2

I am attempting to create a lab using Windows Server 2012 (GUI) with Hyper-V on my laptop. I am trying to figure out how to create an "Internal" network with NAT through the adapter on the physical laptop.

As it stands, the only way I can get my guest VMs online are through the "External" network so I'm getting an IP address from the DHCP server itself, and not using the host as a gateway.

Internet Connection Sharing is disabled by Group Policy so using the EMC article regarding sharing my connection doesn't seem to be a viable option right now.

Additionally, I've stumbled across this article with "IP Rewrite" but I'm unable to find any other resources on how to employ this to my advantage. What is "IP Rewrite" and how would I employ this in my situation?

swasheck

Posted 2012-12-20T17:32:57.993

Reputation: 69

As the system administrator you should be able to grant yourself an exemption to the group policy disabling internet connection sharing. Also, why are you trying to do this on your laptop as opposed to say a dedicated lab machine? (Running a full test environment of any scale on your laptop is going to kill user performance) – voretaq7 – 2012-12-20T17:39:59.520

@voretaq7 Thanks for the feedback. a) I'm not actually the system administrator - I'm the DBA, b) it's so that I can install different versions of SQL server and use them for professional development. – swasheck – 2012-12-20T17:42:14.423

@swasheck If your "lab" is going to be of any substantial complexity (more than just one VM) you probably want to talk to your sysadmin though - if for no other reason than to ensure that your lab resembles the production environment and all your hard work can be transferred easily when the time comes. – voretaq7 – 2012-12-20T17:49:52.743

@voretaq7 this has nothing to do with any end-user experience. this has to do with professional development. – swasheck – 2012-12-20T17:51:37.863

Answers

5

Hyper-V may not have a NAT networking option (like Virtualbox does), but Windows does: check this out:

  • Basically you make a virtual Internal network.
  • Right-click your network adapter.
  • tab Sharing
  • Enable Sharing and link it to your virtual internal network.
  • Then manually give you machines IP- and DNS settings (including your host).

Vincent Vancalbergh

Posted 2012-12-20T17:32:57.993

Reputation: 187

This was somewhat the approach that I took. I created an "Internal" network with this method and I created an "External" network that allowed Internet access. – swasheck – 2013-06-20T14:42:57.877

1And you can do this twice. Once for your Wifi, once for your LAN connection. Then add both internal networks to your VM and you have internet no matter which one is "active". – Vincent Vancalbergh – 2013-06-20T15:07:44.217

2

Could you accomplish this by running a small Linux VM acting as a gateway?

Give the Linux VM an adapter on both the private and external network, and set ip forwarding. Put your other VM's on the internal network, and point their gateways to your Linux VM.

I haven't tested this, but I would imagine this would work. If you get a sufficiently small linux install (DSL, or something?) resource usage should be minimal.

Jason Taylor

Posted 2012-12-20T17:32:57.993

Reputation: 182

2

It's not a solution using Hyper-V (and there may be some license considerations), but you could always try VirtualBox -- it's pretty decent desktop virtualization, and it does offer a NAT networking option that can do what you're asking for in the question.

Your mileage may vary in terms of performance and vendor support, but I've had good experiences with VirtualBox. It's probably adequate for running SQL servers in a VM to try out new functionality.

voretaq7

Posted 2012-12-20T17:32:57.993

Reputation: 2 051

0

Hyper-V does not have a NAT networking option.

longneck

Posted 2012-12-20T17:32:57.993

Reputation: 372

1I know - at least not a simply click button like VMWare Workstation. However, the rest of my question addresses some of the configurations that may make this more useful. – swasheck – 2012-12-20T18:10:16.880