Primary/secondary ethernet interfaces via NetworkManager in Ubuntu 9.10
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.
Related videos on Youtube
Josh
I am Josh Gitlin, CTO and co-founder of Digital Fruition a software as a service eCommerce company. Currently serving as Principal DevOps Engineer at Pinnacle 21, and hacking away at Cinc Server, the free-as-in-beer rebranded distribution of Chef Server.
Updated on September 17, 2022Comments
-
Josh almost 2 years
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 172.16.151.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2 172.16.30.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 10.1.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1 0.0.0.0 172.16.30.2 0.0.0.0 UG 0 0 0 eth0 0.0.0.0 10.1.0.1 0.0.0.0 UG 0 0 0 eth1
I want the 172.16.30.2 network to be the primary one and the 10.1.0.0 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.
-
Dustin Wilhelmi over 14 yearswhat is your router table? Usually all traffic not local should only leave through one interface.
-
-
Josh over 14 yearsThis does fix the issue, but I also just saw that my nameservers are also incorrect...
-
Josh over 14 years@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
-
emgee over 14 yearsAh... Well, you could just manually handle networking. That's how I usually do it. If you want to, the file is /etc/network/interfaces
-
dag729 over 14 yearsnetworkmanager is buggy: if you want a GUI try wicd (and remove networkmanager), or use the CLI as suggested by emgee