• We should now be fully online following an overnight outage. Apologies for any inconvenience, we do not expect there to be any further issues.

A virtual machine: how to use a different default gateway than the physical host?

starriol

Member
Jan 3, 2006
187
0
0
I'm always doing the weirdest configurations :D

The point here is that I need to run a service which uses a very high ammount of traffic (in WAN terms, the LAN wouldn't be affected since it's 2 MBs/sec top).

So instead of having 2 boxes, I want certain services to go out through the physical NIC's default gateway (one ISP) and all the traffic generated by the VM, through the other ISP.

How can that be done? I can use either VM Ware, Microsoft's solution or Virtual Box, since I still don't have anything set-up.

I did some testing.... using VM Ware with the VM configured as directly connected to the network, I used on the virtual NIC the secondary ISP's router address, as the default gateway, but all the traffic ended up going through the primary ISP.

Show me your ideas, please :D
 

Czar

Lifer
Oct 9, 1999
28,510
0
0
I would think that if both routers are on the same lan

Router1 - 192.168.1.254
Router2 - 192.168.1.1

Setting the host to .254 and the vm to .1 would make it work

never done this though, but should work
 

Kakumba

Senior member
Mar 13, 2006
610
0
0
The easiest way, if you have the hardware, is to use 2 NICs. One NIC for the host, using that gateway, and configure the other NIC to use the other gateway. Then, when you setup VMWare (I would use VMWare server, its free, and excellent, IMO), bridge the NIC with the other gateway. Then, set up your VM with bridged networking on that vmnet and you are set. That is guaranteed to work, however what Czar posted should work. I would try it for you, but I don't have enough network gear right now.
 

Jamsan

Senior member
Sep 21, 2003
795
0
76
I run a similiar setup. I have 2 routers in my network, 2 different ISPs. The vmware HOST machine is on one ISP and the VM's are on another router. Just set the vm's nic to bridged mode and assign it a static ip/default gateway, and there should be no problem whatsoever.