Installing and Configuring Network Address Translation (NAT) on a Virtual Machine to connect Virtual Machines running in an Internal or a Private Hyper-V Virtual Switch
Installing and Configuring Network Address Translation (NAT) on a Virtual Machine to connect Virtual Machines running in an Internal or a Private Hyper-V Virtual Switch
If you are running your virtual machines in an Internal or a Private network and you need to provide them with internet or connectivity to your corporate network there are a couple different solutions. One solution is to use a virtual machine as a router. In this blog I will discuss how to configure your host as the solution.
If the Virtual Machines are using an Internal Virtual Network check out this blog on how to configure a NAT on your host machine to provide the access to your corporate network and the internet.
Note: Before configuring the Virtual Machine to provide network connectivity there are a few networking prerequisites that have to be completed within Hyper-V.
I have not configured any virtual networks yet. Figure 1 shows that I only have the host’s physical network card available in Network Connections pane.
Figure 1.
Use the Hyper-V Manager to create an External and a Private virtual networks. The steps would be the same if using an Internal virtual network.
- With Private highlighted click on Create Virtual Switch.
Note that the cards names will include the names you used when you created them in Hyper-V.
Using Hyper-V Manager configure the virtual machines to connect their Network card to the newly created Internal Virtual Network.
Note: The virtual machine that will be configured as the router must have at least 2 network adapter cards.
- In the Settings window select Network Adapter in the hardware pane and then select the appropriate network from the drop down Virtual switch menu in the right hand pane and click OK.
Configure the Virtual Machines NIC with an IP Address from the Private virtual network.
- Start the Virtual Machine if Required.
- Logon to each of the Virtual Machine and configure their IP addresses or allow DHCP to configure them.
- Using the Properties of the network adapter set an IP Address from the Private network. I will be using 172.16.0.10/24 with Gateway of 172.16.0.1 and a DNS server address of 8.8.8.8.
Configuring the Virtual router. In my example it will be server 2
- In the Settings window select Network Adapter in the hardware pane and then select the appropriate network from the drop down Virtual switch menu in the right hand pane and click OK. One Network Adapter will we set to External and one to Private. As seen below.
Configure the Virtual Router Computer Private NIC with an IP Address from the Private virtual network.
- Start and logon to the router.
- Using the Properties of the network adapter identified as Private, set an IP Address from the Private network. I will be using 172.16.0.1/24 with no Default Gateway or DNS server addresses.
- If DHCP is not being used on the external network using the Properties of the network adapter identified as External, set an IP Address from the External network.
The computer’s network prerequisites have been completed. It is now time to configure the router computer to provide connectivity to the corporate network and the internet.
Install Routing and Remote Access on the router computer.
- On the Before you begin click Next.
- On the Select installation type, ensure Role-based or feature-based installation is selected, click Next.
- On the Select destination server, ensure the proper server is selected, click Next.
- On the Select server roles, select Remote access.
- On the Select features, click Next.
- On the Remote Access, click Next.
- On the Select role services, select Routing, click Next.
- On the Web Server Role (IIS), click Next.
- On the Select role services, click Next.
- On the Confirm installation selections, select Restart the destination server automatically if required, click Yes to prompt, click Install.
WARNING: Server will restart after installation is complete.
13. After the server restarts, Logon, on the Installation progress, click Close.
Configuring Routing and Remote Access as a Network Address Translation (NAT) server.
- Right click on the server and select Configure and Enable Routing and Remote Access.
- On the Welcome screen, click Next.
- On the Configuration page, select Network address translation (NAT), click Next.
- On the NAT Internet Connection, select which Interface is your external interface (Public), click Next.
- On the Name and Address Translation Service, select I will set up name and address services later, click Next.
- On the Complete the Routing and Remote Access Server Setup Wizard, click Finish.
- If a prompt appears saying unable to open VPN Ports click OK to acknowledge.
- Nat is now installed.
Your Virtual Machines now have access to the internet and your corporate network.
Until next time, RIDE SAFE!
Rick Trader
Windows Server Instructor – Interface Technical Training
Phoenix, AZ
You May Also Like
A Simple Introduction to Cisco CML2
0 3794 0Mark Jacob, Cisco Instructor, presents an introduction to Cisco Modeling Labs 2.0 or CML2.0, an upgrade to Cisco’s VIRL Personal Edition. Mark demonstrates Terminal Emulator access to console, as well as console access from within the CML2.0 product. Hello, I’m Mark Jacob, a Cisco Instructor and Network Instructor at Interface Technical Training. I’ve been using … Continue reading A Simple Introduction to Cisco CML2
Cable Testers and How to Use them in Network Environments
0 694 1This content is from our CompTIA Network + Video Certification Training Course. Start training today! In this video, CompTIA Network + instructor Rick Trader demonstrates how to use cable testers in network environments. Let’s look at some tools that we can use to test our different cables in our environment. Cable Testers Properly Wired Connectivity … Continue reading Cable Testers and How to Use them in Network Environments
OSPF Adjacency Troubleshooting Solution – Getting Close to the OSPF adj
0 249 1In this video, Cisco CCNA & CCNP instructor Mark Jacob shows how to troubleshoot OSPF Adjacency issues by showing the distance between routers with the show ip ospf neighbor command.
Pingback: Using your Virtual Machines running on an internal Hyper-V