Wednesday, 23 July 2014

Configure Internet Access for Hyper-V in Windows Server 2012 R2

If you owned a Windows Server 2012 R2 and have Installed Windows Server 2012 R2 into your Hyper-V and want to have internet access, you may follow the following steps to setup the network configuration.

Step 1 : At Hyper-V Manager window click on Virtual Switch Manager... located at right side of the panel.

Hyper-V Manager Window

Step 2 : At Virtual Switch Manager window, select New virtual network switch on the left panel, select External on the right panel and click Create Virtual Switch.

Hyper-V Manager - Virtual Switch Manager for - New virtual network switch Selection

Step 3 : Fill in the name field with your desired name. Under Connection type category, select External network radio button and choose your LAN network card in the drop down menu. Leave the check box "Allow management operating system to share this network adapter" checked and click OK button.

Hyper-V Manager - Virtual Switch Manager for - External Selection

Step 4 : By now you will have one additional adapter in your Network Connections window Located at Control Panel\Network and Internet\Network Connections.

Network Connection - Network Adapter

Step 5 (Optional) : You will now need to enable Internet connection sharing by checking the option "Allow other network users to connect through this computer's Internet connection". Enable it from the adapter that have internet connection.

Network Connection - Network Adapter - Properties - Sharing Tab

Step 6 : Back to your Hyper-V Manager window. Right click on the virtual machine that you want to have internet connection and click Settings...

Settings for New Virtual Machine - Add Hardware

Step 7 : Select Add Hardware on the left panel, select Network Adapter at right panel and click Add button.

Settings for New Virtual Machine - Network Adapter

Step 8 : For your Virtual Switch drop down menu, select your created external network adapter that you have done in Step 2 and 3. Click on OK button. By now your virtual machine should have internet connection. If end up like the figure below or no internet connection, proceed to step 9.

Network Connection - Network Adapter - Network Connection Details Window


Step 9 : In your Virtual Machine, configure a static IP address for your adapter. Located at your adapter's properties > Internet Protocol Version 4 (TCP/IPv4) > Click Properties button. Set the Default gateway [192.168.137.1] (Since the shared internet connection pre-configure the IP address to be 192.168.137.1). Set Subnet mask [255.255.255.0]. Set IP address [192.168.137.XX] (XX - Any value other than 1). You may leave the DNS as blank or any of your desired DNS server. The figure below is using google DNS. After done fill up the fields, apply your settings by clicking on OK button. Now you will have Internet connection.

Network Connection - Network Adapter - Properties - Internet Protocol Version 4 (TCP/IPv4) Properties

That's all for the configuration.




No comments:

Post a Comment