Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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 0.0.0.0). Don't worry, your VM will not be affected. Just make sure you don't shut down the interface (ifconfig eth0 up.

share|improve this answer
    
I did exactly like what you asked me to.I have assigned 0.0.0.0 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
up vote 0 down vote accepted

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
10.0.2.0        0.0.0.0         255.255.255.0   U         0 0          0 eth0
192.168.56.0    0.0.0.0         255.255.255.0   U         0 0          0 ra0
0.0.0.0         192.168.56.1    0.0.0.0         UG        0 0          0 ra0
default         gw-01           0.0.0.0         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 192.168.56.1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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