Re: confused routes with multiple nics



On Aug 6, 5:18 pm, ibupro...@xxxxxxxxxxxxxxxxxxxxxx (Moe Trin) wrote:
One definite, one possible problem

I can ping hosts with 10.0.0.2xx IPs and hosts with 129.200.32.xxx IPs
but I cannot ping the DNS server IPs. When I do it tells me its using
the 10.0.0.211 interface(eth1).

Where does the 10.0.0.1 gateway lead? I'd bet it does not lead to the
Internet, much less the 129.200.0.0/16 area, so it's almost certainly
wrong. The "normal" routing table for this box should look something
like

/sbin/route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
129.200.32.0 0.0.0.0 255.255.255.192 U 0 0 929 eth0
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 1450 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 388 lo
0.0.0.0 129.200.32.1 0.0.0.0 UG 0 0 79 eth0

Perhaps that 10.0.0.1 gateway leads to other subnets in the 10.0.0.0/8
range, and ONLY in that case should there be an entry for it, like
10.0.0.0 10.0.0.1 255.0.0.0 U 0 0 21 eth1

What you have done is mis-use the word "gateway". While the more simple
meaning of the word is "that host that leads elsewhere" - virtually all
Linux distributions (and the crappy "helper" tools provided by the various
distributions) make the _assumption_ that if you declare a gateway, it
MUST lead to the _world_ which is not always the case, and pretty uncommon
when there are multiple ways off of the local wire.

Read the routing table (above) like this:

There is a route to 129.200.32.0 - 129.200.32.63, and these hosts are
DIRECTLY attached to eth0. Because these hosts are directly attached, no
gateway is needed to reach them. There is a route to 10.0.0.0 - 10.0.0.255,
and these hosts are DIRECTLY attached to eth1. Again, no gateway is needed
to reach these hosts. There is a route to the loopback (120.0.0.0/8). IF
NONE OF THE ABOVE ROUTES LEAD WHERE YOU WANT TO GO, SEND THE PACKETS TO
129.200.32.1. This last sentence defines a "default" route (meaning if
nothing else works, use this). Now if you think about it, you can't have
two defaults in this scenario because you never NEED (much less 'see') the
second default - because the "first" one says "use me!!!".

Any suggestions on how I should setup my routes?

Loose the second default route - OR set it up so that the kernel knows
where it _does_ lead to (which is obviously not "everywhere").

There are circumstances where two (or more) default routes may need to
exist. This is not one of those cases. For details on them, see the
Adv-Routing-HOWTO which should be on your system.

Above, I mentioned a "possible" problem. The DNS servers have to know about
all hosts you intend to talk to that are NOT included in /etc/hosts (or an
NIS file if using that). The kernel believes the first answer it receives
from a name resolver - and that includes the NXDOMAIN (does not exist in
_my_ records) response from DNS. Talk to your network administrator if
there are hostnames on the 10.0.0.0/24 network that the 129.x.x.x servers
don't know about. For what it's worth, we using internal name servers for
internal hosts (servers not reachable from the world) and these know how
to resolve external addresses as well. Internal hostnames are not visible
outside.

You sir, are awesome. Your explanation was eloquent and descriptive
and I got the point immediately. I have also fixed the problem based
on your feedback. I now understand the meaning of a gateway in this
context. The 10.x.x.x gateway did not lead to the internet and
really, i had no use for it since all the hosts on that network are on
the same switch as eth1.

-Kevin

.



Relevant Pages

  • Re: confused routes with multiple nics
    ... dns 129.172.51.4 ... gateway 10.0.0.1 ... There is a route to 129.200.32.0 - 129.200.32.63, ... Because these hosts are directly attached, ...
    (comp.os.linux.networking)
  • Re: connecting two private subnets
    ... pre-existing network and visaversa. ... OK - but they aren't on the same wire, and you need to have a gateway ... could be "if no other route goes where you want, ... (Gotta love it - 16.777 millions hosts on the same wire. ...
    (comp.os.linux.networking)
  • Static route via address, not interface
    ... relevant in the lists, handbook or FAQ. ... wireless hosts is "reflected" off the internal interface of an OpenBSD ... of host tunnels from the wireless clients into the gateway. ... Here is the route ...
    (freebsd-net)
  • Re: howto isolate 2 nics?
    ... should be through eth0 with what ever gateway address is provided by ... instead of providing a proper route to that network. ... communication between hosts on a single link. ...
    (Fedora)
  • Problem with routes disappearing.
    ... All of the servers in question are IBM SC5200's with Sco ... On the other set of servers the route is still there ... but stops working and cant be seen with netstat -rn. ... add host 192.168.1.14: gateway 10.1.39.1: File exists ...
    (comp.unix.sco.misc)