Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

At work, I have two networks - the hard wired eth0 is great for getting to local resources, but it is tied to a really slow internet connection. My wifi, on the other hand, is a fast wireless N. I'd like to set up my routes so that 192.168.* and 10.1.* go out over eth0, but everything else goes out over eth1. This will let me connect to my local resources but keep my web browsing snappy. I know it's possible - I did it with a prior Ubuntu install before my hard drive failed but I didn't document it and I can't get help from the person who set it up for me. Any help would be hugely appreciated!

Edit: Results of route -n

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.201.1   0.0.0.0         UG    0      0        0 eth1
192.168.201.0   0.0.0.0         255.255.255.0   U     2      0        0 eth1`
share|improve this question
    
Please post the output of route -n, this will be useful in helping you set this up. –  roadmr Sep 5 '12 at 19:17
    
What do you use to configure the network? The GUI (based on NetworkManager)? /etc/network/interfaces? Other? –  Gilles Sep 5 '12 at 21:19
    
I've set up the wireless with network manager, but I'm a developer, so I'm comfortable going in and editing the interface or other files to make this work if I'm pointed in the right direction. –  Feasoron Sep 6 '12 at 14:23
add comment

1 Answer 1

up vote 2 down vote accepted

Your routing table doesn't seem to list anything for eth0, and there shouldn't be an interface named eth1` unless that was just a typo, so it is difficult to make an educated guess based on your current configuration.

Basically this is handled by your routes. Your 'default route' will route all traffic that isn't specifically configured by a static route. You want to configure your default route to go out eth1, and static routes for eth0. You can do all of this in NetworkManager or using the flat config files (or by hand if you want to test it). Your default route is identified by the line with the 'Destination' of '0.0.0.0'.

In networkmanager edit the eth0 connection, click on 'IPv4 Settings' then click the 'Routes' button, then check the box for "Use this connection only for resources on it's network". This should be all you have to do, then bring down and then back up both interfaces. If eth1 is configured for dhcp, it should set the default route for that connection and eth0 will only configure routes for the network it is connected to.

Hope this helps.

share|improve this answer
add comment

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.