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.

I have a machine with three network interfaces running Ubuntu 12.04 LTS, 64-bit, kernel 3.5.0-49.

I am using all three interfaces. Two of them are connected to LANs (eth0 and eth1) and one is connected to the internet (eth2); but when I try to access the internet, it attempts to go through eth0 (error responses come from eth0's IP).

I know that it will work (from experience elsewhere) if I don't set a gateway address for eth0 or eth1, but I have to because for some reason the network manager GUI won't let me save connection settings if no gateway is specified (?).

How do I either a) set eth0 and eth1 to not have gateway addresses, or b) tell the system to use eth2 for internet access (that is, IPs not on eth0/eth1's subnets, and DNS lookups, I guess).

As for trying to unset eth0 and eth1's gateway addresses: Trying to bypass the network manager GUI, I checked in /etc/network/interfaces but Ubuntu doesn't seem to use it (it only has an entry for lo). I'm not really familiar with more modern ways of configuring interfaces though, and so I gave up there.

share|improve this question
1  
In your interface file if you are using network manager should contain only auto lo iface lo inet loopback By default the ethernet uses eht0, can you change your lans use eth1 and eth2? –  Wild Man May 27 at 3:59
    
@WildMan That's a good idea (moving internet to eth0); I can try it. It's a bit of a hassle to gain physical access to this machine (it's mounted in a ceiling), but I should be able to manage it through the patch bay - although if I mess it up and ruin my remote access (it's headless) I'll need physical access anyways. –  Jason C May 27 at 4:09
1  
If you have routing capabilities you can check this post out: serverfault.com/questions/41077/… (it's old, but it's saying to just take out the default gateway and just have one) –  No Time May 27 at 4:13
1  
You can manually configure the settings there if you remove network manager or disable it. –  Wild Man May 27 at 4:16
1  
/etc/NetworkManager /etc/NetworkManager/system-connections –  No Time May 27 at 4:17

1 Answer 1

up vote 3 down vote accepted

It sounds like you're looking for a way to set the default gateway. You can see the current settings by running ip route. You probably want yours to look like something like this:

default via 192.168.0.1 dev eth0 ...
192.168.0.0/24 dev eth0 ...
192.168.1.0/24 dev eth1 ...
192.168.2.0/24 dev eth2 ...

These routes are automatically created by NetworkManager. Try checking Edit ▸ IPv4 Settings ▸ Routes ▸ Use this connection only for resources on its network on the two LAN connections to prevent them from becoming the default gateway.

You shouldn't need to work around NetorkManager.

share|improve this answer
    
Oh, this sounds perfect and I like that it's not a workaround. This is the first thing I will try tomorrow; thanks! –  Jason C May 27 at 10:43
    
Well it took me a few days to get around to trying it, but it worked perfectly. Thanks again. –  Jason C Jun 7 at 18:09

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.