I am trying to do something like this:

  • All networking connections originating from Ubuntu should go through my Wireless connection
  • All the connections originating from within Windows (installed inside a VM) should go through the wired connection.

Now, I was able to get the second one by bridging my VM's adapter to the eth0 interface. But whenever I connect the ethernet cable, Ubuntu refuses to use my wireless connection for any further connections. I am guessing that wired has a higher preference over wireless but is there some way I can achieve the above situation?


You need to set a higher metric on the LAN interface (or a lower one on the WLAN interface). Or just disable NetworkManager for the LAN interface and take it's IP away (ifconfig eth0 Don't worry, your VM will not be affected. Just make sure you don't shut down the interface (ifconfig eth0 up.

  • I did exactly like what you asked me to.I have assigned to the eth0 interface. The VM still works but my host browser still cannot connect to the Internet. Is there something that I am missing? When I am trying to assign a higher metric to the wlan interface, it says operation not permitted. – Legend Nov 18 '09 at 22:23

So, I found a solution that works. Lets say the routing table looks like the following:

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface   U         0 0          0 eth0   U         0 0          0 ra0         UG        0 0          0 ra0
default         gw-01          UG        0 0          0 eth0

I cooked up the routing table. There maybe flaws! But it should stand good for an example. Notice that there are two interfaces involved. In this case, the default route is to send the packets to gw-01 which belongs to eth0. All I did was the following:

sudo route del default gw-01 eth0 
sudo route add default

Everything works as expected but the access in the host is relatively slow. I am not sure why but at least I have something that works. Any better solutions are still welcome.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.