0

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
74.218.198.192  *               255.255.255.248 U     0      0        0 eth2
default         rrcs-74-218-198 0.0.0.0         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
74.218.198.192  0.0.0.0         255.255.255.248 U     0      0        0 eth2
192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
0.0.0.0         192.168.2.1     0.0.0.0         UG    100    0        0 eth0
0.0.0.0         74.218.198.193  0.0.0.0         UG    100    0        0 eth2
2
  • How, exactly, does it 'stop working'? Does it go down? Does data flow stop?
    – wzzrd
    Aug 17, 2009 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, 2009 at 13:38

3 Answers 3

5

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

2
  • 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, 2010 at 20:14
  • thx for the hint.. I had the same problem as well! Sep 2, 2013 at 10:45
1

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
192.168.39.0    *               255.255.255.0   U     0      0        0 eth0
default         192.168.39.1    0.0.0.0         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.

5
  • 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, 2009 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. Aug 17, 2009 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 0.0.0.0 (four lines total).
    – DLH
    Aug 17, 2009 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. Aug 17, 2009 at 16:14
  • good idea.
    – DLH
    Aug 17, 2009 at 17:02
0

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 192.168.2.1 (i.e. the pointer records are not set up correctly or at all).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.