[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-ppc
Subject:    Re: Ethernet woes...
From:       Ronald Robson <Ronald.Robson () aldevron ! com>
Date:       2000-01-20 13:08:49
[Download RAW message or body]


I don't know if I can solve your problem, but I did note some errors in what you
were trying to do with your routing tables. Perhaps, that is what your problem is.

Ian Pushee wrote:

> Eth0 -- the broken internal ethernet, not connected to anything
> Eth1 -- the Asante card
>
> 255.255.240.0   -- Netmask
> 130.***.224.1   -- Gateway
> 130.***.24.1    -- Nameserver
> 130.***.226.231 -- eth0's old IP address
> 130.***.226.10  -- eth1's current IP address
>
> >  ifconfig
> eth0    Link encap:Ethernet     HWaddr: 00:05:02:FE:20:37
>         inet addr:130.***.226.231 Bcast:130.***.239.255 Mask:255.255.240.0
>         UP BROADCAST RUNNING MULTICAST MTU:1500 Metric: 1
>         RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>         TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
>         collisions:0 txqueulen:100
>         Interrupt: 42 Base address:0x9000
>
> eth1    Link encap:Ethernet     HWaddr: 00:00:B5:94:DF:77 *note*
>         inet addr:130.***.226.10 Bcast:130.***.239.255 Mask:255.255.240.0
>         UP BROADCAST RUNNING MULTICAST MTU:1500 Metric: 1
>         RX packets:0 errors:0 dropped:11330 overruns:0 frame:0
>         TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>         collisions:0 txqueulen:100
>         Interrupt:24 Base address:0x400
> *note* This hardware address is not right... the real one is: 00:00:94:B5:77:DF

First off, since your old card was giving you problems, I would disable the thing
with ifconfig, or rather, not enable it in the first place. If you're not sure how
to do it, read the man page. (Unfortunately, I don't have Linux running right now,
so I can't look it up myself.)

> lo      Link encap:Local Loopback
>         inet addr:127.0.0.1 Mask:255.0.0.0
>         UP LOOPBACK RUNNING MTU:3924 Metric: 1
>         RX packets:2 errors:0 dropped:0 overruns:0 frame:0
>         TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
>         collisions:0 txqueulen:0
>
> >  route
> Destination     Gateway         Genmask         Flags   Metric  Ref  Use  Iface
> 130.***.226.10  *               255.255.255.255 UH      0       0    0    eth1
> 130.***.226.231 *               255.255.255.255 UH      0       0    0    eth0
> *note*  Right Destinations and interfaces... wrong netmasks
> *note*  This first bunch I can remove just fine

Regarding the above, don't confuse the 'Genmask' column with your netmask assigned
by your provider. They are *not* the same thing. The routing table is organized
from the most specific or targeted route to the least and the OS passes an IP
address through it from top to bottom trying to figure out what to do with it. The
Genmask tells the computer how many digits to look at in an IP address when
evaluating that line of the routing table. For example, a genmask of
255.255.255.255 says that an IP address has to match *all* digits if its to go to
the destination listed on that line. In the case above, if an application sent a
packet to 130.***.226.10, the first line of the routing table would match and the
packet would go to itself. Any other IP address, and its passed down the table for
further evaluation.

(As an aside, for a netmask/genmask to make sense, you have to look at it written
out in binary format. 255.255.255.255 is a string of 32 1's. This value is
compared against the IP address also in binary format. Whichever column has a one
in the mask is used to match the IP address against the destination IP address.)

In a second example, if your genmask was 255.255.255.0 and the destination was
130.***.226.0, this line would come below the one above since it is less
restrictive. Here, anything goes for the last digits, but there must be a match in
the first 3 sets. This is typically the case for when your computer is on a LAN
and this is also the case where the netmask and genmask will be the same number.

The last line in the routing table is for the default route and it has a genmask
of 0.0.0.0. In other words, if an IP address doesn't match on any of the preceding
lines, it is guaranteed to match here since the genmask is all zeroes. The
destination column on the left should contain the IP address of your gateway,
130.***.224.1. In other words, your computer will pass the packet on to it and
hopefully it can figure out where to go with it next.

So, if your routing table looks like the one below, your computer will have no
idea what to do with any packet that isn't destined for your own network.

>
>
> default         130.215.224.1   255.255.240.0   UG      0       0    0    eth0
> *note*  Right gateway and netmask, wrong interface (needs to be eth1)

No, right gateway, *wrong* netmask, wrong interface. Mask should be 0.0.0.0

>
>
> 130.***.224.0   *               255.255.240.0   U       0       0    0    eth0
> 130.***.224.0   *               255.255.240.0   U       0       0    0    eth1
> *note*  Right netmask, but I have no clue why I am getting routes to my
>         gateway's network

These are required to communicate with other computers on the same network as your
gateway. Maybe there aren't any you need to talk to, but they should be there as
written above.

>
>
> 127.0.0.0       *               255.0.0.0       U       0       0    0    lo
> *note*  Not sure why this route is being added to the loopback's network, not
>         the host (ie: 127.0.0.1)

The above seems typical of Linux. Other Unix OS's would say 127.0.0.1, but Linux
seems to like the above.

In general, I have found that 'route' doesn't need to be told the mask to use if
ifconfig is set correctly, which I think yours is. The masks that route was using
look correct. Normally, I only use the route command with the destination and
gateway arguements. See below.

Another route I would add is a route from your IP address to your host's local
interface. Something like this:

'route add 130.***.226.10 gw 127.0.0.1'

>
>
> *note*  If I try to "> route del 130.***.224.0", I get -- "SIOCDELRT:
> No such process"
>         Same with "> route del 127.0.0.0" and "> route del default".

Try using 'route del IP gw IP' form. I find that specifing the gateway helps.

FWIW,

Ron

** Sent via the linuxppc-user mail list. See http://lists.linuxppc.org/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic