I have a lab environment that I use to “try before implementing “things” Microsoft. The lab is hosted on a PC running Windows Server 2008 R2 with Hyper-V. The physical Hyper-V server may host at least 4 guest Windows servers with different operating systems running concurrently to create a SQL clustered environment or a web server farm or both. Generally, this requires a Domain Controller, and two or more SQL servers in a Windows Failover cluster. The SQL servers my be set up to use Log Shipping, host an Always on Availability Group or just be configured in a traditional SQL Failover cluster.
There are times when you need multiple network interfaces on a physical server running Microsoft Hyper-V. In this environment, you know you will need at least 2 NICs on each virtual guest. One for client data movement and the quorum and the other for the Windows cluster heartbeat.
You can set this up with one physical NIC on the host by configuring a Hyper-V Network to use the NIC. When provisioning each guest OS, add two NICs to the configuration both servers using the same Hyper-V Network. In the virtual guest configure separate subnets for each NIC, for example: 192.168.101.1 and 192.168.102.1. The Failover Cluster wizard will see both NICs and you can reserve one for the client and the other for the heartbeat. This works fine.
If you had two network cards installed on your physical host you could utilize both of them and present each as a separate Hyper-V Network to your virtual guests. Of course the physical NICs would have to connect to the same router if you wanted them to be External. I find External to be my network of choice because they provide the individual servers with access to the Internet. This comes in handy for patching and 3rd party software downloads. Of course, you can create an Internal network that let the servers communicate among themselves and the host but then you get into the isolated network situation that always adds an extra step to getting things done quickly.
In my Lab it’s the old Linksys WR54G router that’s connected to the Internet. But wait, don’t I need something in between the virtual guests and the Linksys router to support the other network? Yes, you can use another home router. On the second router connect the Internet side to one of the inner-facing four ports on the first router. That gives you a lot of flexibility in plugging devices into routers supporting 2 separate networks.
But what if you don’t have another router on the premises and you just don’t feel a need to purchase another home router? The answer is Routing and Remote Access Services. Here’s how I set this up in my Lab.
Routing&Remote Access for Hyper-V
You can use Routing and Remote Access Service (RRAS) when you have 2 physical NICs in your host and you want the guest VMs to use 2 different subnets. I’m not a genius so I asked Mr. Google how to do this. You know the trick when having an interaction with Mr. Google or Mr. Bing is to phrase the question so that they can understand what you mean. After some interaction between the two search engines, Mr. Google found this post. Mr. Bing tried but I got tired of getting recommendations on where I should go for dinner or an exotic getaway for the weekend or the new dry-cleaning shop that opened in the strip mall around the corner.
The post is by Chris Jones and it’s on his TechNet blog site, Lets Do This. Here’s the full address of the link. Wait a second, this is about using one NIC for two subnets. He is doing what I originally said, define 2 Hyper-V networks with 2 subnets using a single NIC. The secret is to read his post and map out the network then follow my variation to make up your own mind of which to use for your situation.
LEVEL7HOST is a Windows 2008 R2 SP2 server with 2 NICs. I use Server Manager to install the RRAS role. I’ve created two Hyper-V networks: VM Logical NIC and Subnet-2. This is what they look like in Control Panel.
VM Logical NIC IP address configuration:
Subnet-2 IP address configuration:
Hyper-V Virtual Network Manager shows:
There is also another “Internal Virtual Network” that I configured for communication among the VMs but I’m not using that.
Here’s what the Network Interfaces look like in RRAS:
In order to get this to work, you need to set up a Static Route. Click on the Help in the RRAS console for the full explanation. Click on Static Routes then fill in the blanks.
Here’s the properties view showing that the VM Logical NIC interface is able to get outside using the Linksys WRt45G (192.168.101.1) interface
Here’s the network setting on the Windows Server 2008 R2 VM guest OPUSAPP1-12:
Browse out to the internet. What luck, I get to fill out a survey. But does Microsoft want to know what I really think? Maybe later.
And the settings on OPUSAPP2-12, a similar Windows 2008 R2 VM:
I guess, we were lucky to avoid the survey – this time:
Statistics on the RRAS console…
Here is the NAT work being done.
That’s pretty much all there is to it. Like I said, you may or may not find a need for this.
References:
This posting is provided “as is” with no warranties, guarantees or rights whatsoever.