[Guide] How to Use VMware Virtual Machine as LAN Router Between Two Networks

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

192.168.2.x series.

VMware Virtual Machine as LAN Router

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)

2) Laptop

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.

desktop virtualization software

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.

VMware Virtual Machine as LAN Router

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.

Server virtualization

4) Press Next and select ‘Custom configuration’.  Select ‘LAN Routing’ option and start the service at the end.

VMware Virtual Machine as LAN Router

5) That’s it, it will simply start the routing service in the server. Make sure your both network adapters are listed.

VMware Virtual Machine as LAN Router

 

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.

desktop iplaptop host ip

 

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.

Have fun.

25 thoughts on “[Guide] How to Use VMware Virtual Machine as LAN Router Between Two Networks”

  1. Hai Dinesh
    Thansks for posting
    Sorry I have not yet tried because littel bit busy in my work, surely i will try it and give you update and if any doubts regarding this will mail you.

    • Hi, that was great. Ma question is how could you route between 2 VIRTUAL WORK STATIONS on one host when none is a server??? I want routing to take place on a LINUX workstation bridged to the host on one side and to a windows 7 on the other.

      will be greatful

      • Maybe somebody can help me.
        I have a mac which I want to connect to a home network.
        The mac has parallels installed to use XP for special software I use. Two other PC are on the network and files are shared. I need to access these files from the VM installed in Mac.
        Mac talks to internet OK, VM also talks to internet OK. Problem is VM and /or Mac cannot be seen on home network. Has anybody any ideas, Thanks

  2. This is exactly what I was looking for

    Very rarely we get to design and build a whole environment from scratch and sometimes forget the fundamentals…

  3. Hai Dinesh Jitendra Here

    I had tested yesterday night it working. On the server 2008 BOX, Now i have installed server2008srvr in my physical ADBOX on that i have installed vmware worstation and created one vm as router.

  4. Dear Friends,

    Can you Please assist me how to establish network communication between 3 networks… in VM Ware.

    My Problem is…

    1. Server 2003 Domain1.com having 2 NIC’s
    1 NIC : 192.168.7.1 255.255.255.0 Private
    2 NIC : 202.54.6.6 255.255.255.0 Globla

    2. server 2003 Domain2.com having 2 nic’s
    1 NIC : 192.168.8.1 255.255.255.0 Private
    2 NIC : 202.53.6.8 255.255.255.0 Global

    i need to establish network between these 3 networks..
    any client of Domain1 can able to ping Domain2 client PC.

    Kindly advice…

    thank you all

  5. Whoever you are , thanks for posting this…

    The errors in my method:

    1) NOT really an error: I used custom (bridged) vmnet3 and vmnet instead of auto bridging

    2) DID NOT configure Lan routing and assumed VMware does it automatically …

    the second step really made my day , Dinesh … Bravo.. am your fan .,

    Thanks

  6. OH NO…

    1) There was an error in Step 2 !

    After configuring both adapters under bridged, I am ABLE to ping from the VM to the desktop (in ur case) BUT UNABLE to ping from my laptop to The VM …

    What could be the problem… all firewalls are disabled …

    Please help

  7. Hai Upen
    Jitendra here we all should thank our sysprobs guru Mr. Dinesh I had just posted my idea and my Home Lab Diagram. Chreeeeees support sysprobs tell more about sysprobs thank you.

    • There was an error in Step 2 !

      After configuring both adapters under bridged, I am ABLE to ping from the VM to the desktop (in ur case) BUT UNABLE to ping from my laptop to The VM …

      What could be the problem… all firewalls are disabled …

      Please help

  8. Dear Rajesh have you tried out seeing this screen shot.
    Try it should work.
    Any error if you are getting just post it.

  9. I guess your solution is wrong. BOTH the networks should not be bridged via the same port (aka vmnet0) … In that case theres no way we can communicate both ways… so, shouldn’t it be two different ports on the switch , for ex : briged vmnet 2 for adapter1 and bridged vmnet3 for adater2 ….

    Auto bridging both , wont work,,, has anyone “implemented” this? Let me know asap.

    Thanks

  10. Hai Upen
    I have Just placed one VM as Router with 4 Nics it is working fine in my home lab it is working fine.
    I this diagram also i have bridge on only one side that is on vmwarehost pc.

  11. If you have any new method please post with lab diagram and with scrn shots on this site it will be help full
    for other.

  12. How do I connect my guest OS over the WAN and my lab configuration explained bellow

    Laptop Physical NIC IP 183.62.128.180
    Laptop VM NIC IP 192.168.0.1
    Guest OS Win 2003 NIC IP 192.168.0.200.

    I am able share the physical shared drives also.

    Please let me know how I connect my VM Instance over the WAN.
    I came to know it is possible if I use port forwarding and loop back NIC concepts, if correct please explain.

    Thanks and Regards
    Srinivas

  13. My objective is to run a virtual client-server based network topology training/test lab hosted from a laptop. The server operating systems needed are as follows Window 2000,2003,2008,Win Exch Srvr,SQL Srvr. The client operating systems are as follows;all flavors of Win 2K,XP,Vista,and Win7, Linux, Ubuntu and Mac OS X 10.7 Lion. The applications would be as follows; MS Office Pro 03,07 and 2011 for both Windows and Mac (with Garage Band having full functionality as it does in its native Apple environment). For hardware requirements it was advised to get the following items; I7 processor w/ virtualization, USB 3.0,eSATA,8GB ram, Gigabit nic and a USB 3.0/eSata external multi-bay hard drive enclosure (to store and run the virtual operating systems.
    CAN YOU OFFER ADVISE?

  14. hi everybody,

    i am having trouble with something in vmware. i need help.

    can u help me how to setup the network structure in vmware workstation.
    i had the dns configured.

    file:///C:/Users/Shahi/Desktop/structure%201.jpg

  15. Hi… This is Mohan i instal windows xp in two laps by using VM ware but i can’t ping the both machines… (note:before pinging i switch off all fire walls and antivirus)may i know how to ping the both systems?

  16. hey man great walkthrough

    I have a lab scenario im working on at home

    using vmware workstation

    i have 3 servers (w2k8) ,1 for each of 3 sites.
    each site is on the
    site a is on the 10.0.0.0/26 network
    site b is on the 10.0.0.64/26 network
    site c is on the 10.0.0.128/26 network

    my question is:
    1.) how would i use vmware to create routes between the 3 sites?

    any ideas welcome guys

    thanks in advance

  17. Nice work!

    I used to do it with freesco floppy router.
    Not the same setup but working too.
    i used 1 bridged connection and the rest in host-only.

    Cheers

  18. Hi,
    I am having 4 laptop running in LAN. i am using netgear wi fi router, which is also used to share the internet connection. We access each other computer through this setup
    I have installed ubuntu in VM in one of the computer. I can access my local computer’s shared folder through VM os. How can I access all the 4 laptops using the vm?
    please mail me on mindblowing.007@gmail.com

Comments are closed.