[Fwd: Re: [techtalk] Building ADSL - LAN]

Yann Vernier yann.vernier at euroseek.net
Fri Oct 8 15:11:42 EST 1999


Just This Girl wrote:

> Network Address   Netmask           Gateway Address   Interface
> 0.0.0.0           0.0.0.0           xxx.yyy.zzz.246   xxx.yyy.zzz.242
> 127.0.0.0         255.0.0.0         127.0.0.1         127.0.0.1
> xxx.yyy.zzz.240   255.255.255.248   xxx.yyy.zzz.242   xxx.yyy.zzz.242
> xxx.yyy.zzz.242   255.255.255.255   127.0.0.1         127.0.0.1
> xxx.yyy.zzz.255   255.255.255.255   xxx.yyy.zzz.242   xxx.yyy.zzz.242
> 224.0.0.0         224.0.0.0         xxx.yyy.zzz.242   xxx.yyy.zzz.242
> 255.255.255.255   255.255.255.255   xxx.yyy.zzz.242   xxx.yyy.zzz.242
>
> TCP/IP on Windows98 is set up as follows:
> Gateway: xxx.yyy.zzz.242
> IP Addr: xxx.yyy.zzz.242
> Netmask: 255.255.255.248
>
> The ADSL modem is configured with:
> Gateway: xxx.yyy.zzz.246
> IP Addr: xxx.yyy.zzz.241
> Netmask: 255.255.255.248
>
> However, when I ifconfig eth0 (the NIC under Linux) using this:
>
> ifconfig eth0 xxx.yyy.zzz.242
>
> it automatically inserts this into the route table:
>
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags Metric Ref    Use
> Iface
> xxx.yyy.zzz.240 0.0.0.0         255.255.255.248 U     0      0        0
> eth0

This is a network route, not a gateway route. Notice the genmask; it
says
which IPs will be directed through this route. "route add default gw"
will
add your gateway with a genmask of 0.0.0.0, for "everything not yet
caught".

> Note the gateway. I want xxx.yyy.zzz.242 as the gateway, NOT 0.0.0.0,
> but it will not let me delete this route to readd it. This is the error
> I get:
>
> bash# route del -net xxx.yyy.zzz.240
> SIOCDELRT: Invalid argument

You might be able to delete that route by giving it the full settings:
bash# route del -net xxx.yyy.zzz.240 netmask 255.255.255.248 dev eth0
but as I said, I don't think this is needed. The route only affects IPs
from xxx.yyy.zzz.240 to xxx.yyy.zzz.255.

> What I -think- I should be typing to get the routing displayed in
> Windows98 is:
>
> route add default gw xxx.yyy.zzz.246

won't work before there's a route to the gateway! i.e. delete the first
route and add this, and you get "what device is that? no route to the
gateway..."

> route add -net xxx.yyy.zzz.240 gw xxx.yyy.zzz.242 netmask 255.255.255.248

This is the route that points to the gateway; traffic to this net _don't
have to go through the gateway_. Don't use the gw parameter here.

> route add xxx.yyy.zzz.242 gw localhost

Don't "gw localhost". This must be windows silliness.

> route add xxx.yyy.zzz.255 gw xxx.yyy.zzz.242
> route add -net 224.0.0.0 gw xxx.yyy.zzz.242 netmask 224.0.0.0
> route add 255.255.255.255 gw xxx.yyy.zzz.242

You really only need one route per device plus one default gateway route
for most setups. These don't make much sense.

> However, Linux complains and moans about the last two entries.

It should. The entries you've shown are redundant and/or recursive. In
short, just do:
bash# route add default gw xxx.yyy.zzz.246
and you're home free. The automatic route you've seen is necessary to
reach
the gateway.

************
techtalk at linuxchix.org   http://www.linuxchix.org




More information about the Techtalk mailing list