Page 1 of 1
Need advice. How to configure a virtual machine as router
Posted: 17. Sep 2009, 11:43
by jjplaw
(Newbie in virtual machine stuff)
I have 2 LANs in my office, LAN A and LAN B. Printers and servers located on LAN A.
My laptop is connected to LAN A via wireless and LAN B via cable.
My workstation is connected to LAN B via cable.
I need to set up a virtual machine in my laptop that acts as a router to enable my workstation to access the printers and servers on LAN A.
Need some direction and strategy on how to approach this problem.
Has anyone done a project like this before
Please advise.
Someone suggested me to use pfSense on the virtual machine.
Re: Need advice. How to configure a virtual machine as router
Posted: 17. Sep 2009, 12:00
by Sasquatch
The application to use on the VM is up to you, there are several pieces of software, depending on the OS you want to run on it. The outline is at least as followed, which you can use to implement it on the software you want to use.
The VM must have 2 NICs, both in Bridged mode and each to a different physical NIC (one wireless, one wired). Configure both interfaces as needed for the attached network. Configure the software you use to route traffic from the one to the other network, so two-way communication can be done.
On the workstation, set the default gateway to the VM, or add a route for the other network to go through the VM. The latter might be a better solution because of the resources on the network, like internet and all.
Now, I use a Linux host, so your route command will differ, but with the help output of the command alone (/?) you can find the right syntax for Windows.
Code: Select all
route add -net networkA subnetA dev eth0
This command will add a route to network A that goes through interface eth0. Replace "NetworkA" and "SubnetA" with the correct values of the network.
Re: Need advice. How to configure a virtual machine as router
Posted: 17. Sep 2009, 12:28
by jjplaw
thanks for your reply.
Is it possible to use NAT instead?
I can use Bridged mode on LAN B but not on LAN A.
LAN A has fixed IPs configured. Admin is not willing to allocate me an IP address.
I need my workstation to access only the printers and servers on LAN A. Internet and other stuff through LAN B as normal.
So i guess the latter would be the solution...
Re: Need advice. How to configure a virtual machine as router
Posted: 17. Sep 2009, 12:35
by Sasquatch
Sorry, but NAT will not be usable for that. You know, with the route command, it should be possible to access the other network resources without the need of a router. As long as the networks are accessible through the same LAN adapter. If they are physically separated, it will be a bit harder. Without an IP address on the other LAN, it will be tough. I can't give you a definitive answer on how and what to do, because I don't have a clear view of the network. Maybe your network admin can help you with this.