I have an Ubuntu 9.10 machine with three ethernet interfaces, eth0, eth1 and eth2. eth2 is connected to a private network. eth0 and eth2 are connected to two different LANs. Either one will provide access to the internet. All three networks have DHCP servers.

Using Ubuntu's the default settings (And Gnome), when I boot up all the interfaces are active and my system gets three IP addresses. However any attempt to access the internet results in connection timeouts and other weirdness. I suspect that traffic is going out on one NIC (like eth0) and coming back in on another (like eth1). I'm not sure what's going on. The only way I can access the internet at the moment is to bring two of the devices down with ifdown.

How can I configure eth0 as my primary interface so all trafic goes out by default on that interface, while keeping the other two active? Also, I want to make sure Avahi broadcasts properly on all three IPs so that the computers on the LAN of eth1 can still connect to myHostname.local...

EDIT: Here's my routing table:

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface   U         0 0          0 eth2   U         0 0          0 eth0     U         0 0          0 eth1     U         0 0          0 eth1         UG        0 0          0 eth0         UG        0 0          0 eth1

I want the network to be the primary one and the network to be the secondary one.

EDIT2: My nameservers are also incorrect. It seems like Ubuntu is bringing the networks up in order, eth0, then 1, then 2, and the DHCP information from eth1 is overriding eth0, and eth2 is overriding eth1. How can I reverse this so the DHCP information from eth0 is the "master"?

EDIT3: This seems to be an issue with Gnome's NetworkManager.

  • 1
    what is your router table? Usually all traffic not local should only leave through one interface.
    – txwikinger
    Mar 12 '10 at 20:26

It would be good to see your routing table, because I'm just guessing here, but it sounds like your default gateway is not set correctly. You can set that with the route command. It would be something like this:

route add default gw XXX.XXX.XXX.XXX dev eth0

EDIT: I should mention that this route is not persistant, so if this works, you'd need to add the line to your network scripts or rc.local. Also, I have no idea how avahi works so you're on your own on that.

  • This does fix the issue, but I also just saw that my nameservers are also incorrect...
    – Josh
    Mar 12 '10 at 22:04
  • 1
    @emgee: This actually doesn't work -- it works for a few minutes but then the routing table reverts back. I think this is because of NetworkManager
    – Josh
    Mar 12 '10 at 22:21
  • 1
    Ah... Well, you could just manually handle networking. That's how I usually do it. If you want to, the file is /etc/network/interfaces
    – emgee
    Mar 13 '10 at 7:39
  • networkmanager is buggy: if you want a GUI try wicd (and remove networkmanager), or use the CLI as suggested by emgee
    – dag729
    Mar 15 '10 at 20:58

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.