Jitendra, one of the contributor of Sysprobs requested this guide with his home testing environment scenario and a nice lab setup picture. This small guide shows how to configure a virtual machine in VMware to act as a LAN router between two networks. This will be very helpful for learning purpose with real world scenario and even in production environment to connect two separate networks as a router.
Here is the picture describing the current lab setup by Jitendra. Even though one network switch has been used here, but there are two networks available.
one – 192.168.1.x series and
Our target is to make communication (let’s say ping and response) between these two network nodes by using VMware virtual machine ( Windows 2003 Server or latest versions) as router between these two networks.
Note – By adding other network IP address range as second IP in each network adapter will help to make network communication when all devices connected to same network switch. But, that will not be in real world practical environment and you may face issues while configuring domains, sites and DNS.
I don’t have more than two physical computers to demonstrate the exact scenario described in above picture.
I have two physical computers.
1) Desktop computer with VMware workstation ( Windows 2003 Server as a guest)
These two computers physically connected via network cable.
Desktop IP – 192.168.2.100
Subnet mask – 255.255.255.0
Laptop IP – 192.168.1.100
Subnet mask – 255.255.255.0
Obviously, these two computers can’t communicate now since both are in separate network.
Important Note – Before do anything, make sure Windows or other firewall programs are turned off or set to allow network connectivity.
Steps Involved to Use VMware Virtual Machine as LAN Router between Two Networks
1) Add one more virtual network adapter to VMware virtual machine. Make sure VM is having two network adapters and connected. Configure both network types to ‘Bridged Mode’, so Windows 2003 OS can communicate to both 192.168.1.x and 192.168.2.x networks.
2) Configure each network adapter inside virtual machine for each network. In my case, I configured one adapter to 192.168.1.10 and other one to 192.168.2.10.
Before go to the next step, test this network configuration by pinging from server to other network nodes on each network, also do it in opposite way.
So, from Windows 2003 virtual machine in VMware, I can ping to my desktop host (192.168.2.100) and laptop host (192.168.1.100), in opposite way I can ping to Windows 2003 server from my Desktop and Laptop physical computers.
This makes sure current network setup including bridged mode and two virtual network adapters are working fine.
3) Now go to ‘Routing and Remote Access’ under ‘Administrative Tools’ Windows 2003 server virtual machine.
Right click on Server and select ‘Configure…’ option as shown below.
4) Press Next and select ‘Custom configuration’. Select ‘LAN Routing’ option and start the service at the end.
5) That’s it, it will simply start the routing service in the server. Make sure your both network adapters are listed.
6) Now, we need to configure Windows 2003 server IP address as Gateway to other networked nodes.
All devices in 192.168.1.x network should have 192.168.1.10 (Windows 2003 IP) as gateway and 192.168.2.x devices should have 192.168.2.10 as gateway.
7) Now all packets will be routed through Windows 2003 server routing services. I can ping to desktop (192.168.2.100) to laptop (192.168.1.100) now.
If you face any difficulties now, just disable and enable the physical network adapter where VMware workstation and virtual machine is running.
I’m sure this guide will be helpful to use VMware virtual machine as router to connect two networks with low cost in testing or production environment.
This method is applicable for Windows 2008 and Windows 2008 R2 servers also which having built in ‘Routing and Remote Access’ features. Also, this can used in Oracle VirtualBox If you properly configured bridged networking with physical network.