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

Our server has three ethernet interfaces. I have one plugged into the cable modem (for static ip), and one plugged into the router (for access to the rest of the work network). I'm pretty sure that I had both interfaces running simultaneously under Xubuntu, but under Ubuntu Server I can't seem to pull this off; if I connect to the work network, my static ip stops working. This kind of defeats the purpose of having more than one ethernet interface. How can I make these two interfaces live together happily?

route Output:
eth0 down

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface  *      U     0      0        0 eth2
default         rrcs-74-218-198         UG    100    0        0 eth2

eth0 up (hangs after first two lines, so I used route -n)

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface U     0      0        0 eth2   U     0      0        0 eth0         UG    100    0        0 eth0         UG    100    0        0 eth2
share|improve this question
How, exactly, does it 'stop working'? Does it go down? Does data flow stop? –  wzzrd Aug 17 '09 at 13:09
When I ifup the other interface, I have trouble accessing the IP address of the server from the outside world. The IP address seems to be accessible from the LAN though... –  DLH Aug 17 '09 at 13:38

3 Answers 3

up vote 4 down vote accepted

Do you have default gateways for both interfaces? If the answer is yes then disable default gateway in the configuration for eth0.

share|improve this answer
Ah yes, I thought including the gateway info was required for both interfaces, so I didn't realize that I was making two defaults. I'm a programmer, not a network admin. Don't judge me! ;) –  DLH Jul 20 '10 at 20:14
thx for the hint.. I had the same problem as well! –  Dominik Dorn Sep 2 '13 at 10:45

I'm guessing that your static IP keeps working perfectly well, but the DHCP setup on the other NIC causes it to become the default gateway as instructde by the DHCP server.

To test this little theory, run route when only connected with the static NIC, when connectde just to the local LAN, and when connected with both.

You should see output something like:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface    *        U     0      0        0 eth0
default         UG    0      0        0 eth0

You will see more lines when connected through more NICs, and more if you have any extra network routing configured (such as VPNs). The important line is the one marked as default in destination.

Edit: with the new info added to your question, I'm not entirely sure as I've not seen that arrangement (I know a bit on routing but I'm no export!). It looks like there are two gateways defined, one for each network interface. This may mean that there is no fixed route for packets to public addresses and this leaves two potential problems: if the local LAN is not configured to allow packets from you to be forwarded to public addresses then they won't get out, and if you are using DNS servers that are only accessible down one of the lines and the other line is used you will not get any name resolution. Could you add the output of nslookup example.com and cat /etc/resolve.conf to your information, and I might be able to diagnose further and suggest a fix.

share|improve this answer
when I bring up the other interface and run route, it prints a line for each interface, then just hangs without printing a line for default. –  DLH Aug 17 '09 at 14:04
The hang will probably be it trying to lookup a name for an IP address, but not being able to see the nameserver and waiting for a timeout before carrying on. It will eventually finish, btu to skip the name resolution completely, use route -n in place of plain route. –  David Spillett Aug 17 '09 at 14:24
alright, when I do that, I get one line for each interface as before, then I get a another line for each interface in reverse order, each one beginning with (four lines total). –  DLH Aug 17 '09 at 14:37
You should update your question to include all the new information, i.e. the full output of route in each case, nicely formatted and easy to read. –  David Spillett Aug 17 '09 at 16:14
good idea. –  DLH Aug 17 '09 at 17:02

You have two default gateways on the same metric, which basically confuses the hell out of the routing engine (it cannot make a clear decision which one to use). Seeing that you have a router, I would suggest you put the server on the other side of that and leave the routing to the router.

Alternatively, if you want to (or have to) leave the server where it is in your network line-up:

  1. ensure there is only one default gateway (your third line is for a default gateway to an internal network, that is unlikely to work in any case, unless the gateway has another separate route to the Internet)
  2. ensure that your server has IP forwarding enabled:
    echo 1 >/proc/sys/net/ipv4/ip_forward
    and that your firewall handles the forwarding correctly.

The hanging of route on the third lines is caused by the fact that you either do not have internal DNS at all, or the DNS server is not reachable from the server (which could be caused by the routing issue) or it does not have a name for the address (i.e. the pointer records are not set up correctly or at all).

share|improve this answer

Your Answer


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.