[PLUG] Routing Query

Aj Lavin aj at ecto.us
Mon Sep 16 19:12:52 UTC 2002


On Mon, Sep 16, 2002 at 09:06:37AM -0700, Richard Langis wrote:
> 
> internet------\
>                \                                          _______
>                 \                            **          |      |
>              |--------|     |---------|     /  \         |      |
>              |firewall|-----|file serv|-----|AP|     *--/laptop/
>              |--------|     |---------|     |--|       /______/
>                 1.251          1.252         2.x         2.3

> Here's the output of 'route -n' on the fileserver:
> 
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags Metric Ref    Use 
> 127.0.0.0       0.0.0.0         255.255.255.255 UH    0      0        0 lo
> 192.168.2.0     192.168.2.252   255.255.255.0   UG    0      0        0 eth1
> 192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
> 192.168.1.0     192.168.1.252   255.255.255.0   UG    0      0        0 eth0
> 192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
> 0.0.0.0         192.168.1.251   0.0.0.0         UG    0      0        0 eth0

The following assumes you are using Linux 2.4 kernel.

I don't think one installs "gateway" routes for directly attached
networks.  The following should suffice.

127.0.0.0       0.0.0.0         255.255.255.255 UH    0      0        0 lo
192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
0.0.0.0         192.168.1.251   0.0.0.0         UG    0      0        0 eth0

ifconfig should automatically set up the routes for the directly
attached networks. The only route you should set manually is the
default gateway. If you are using Debian, then set all of these
parameters in /etc/networking/interfaces (man interfaces).

Also, ensure that you are turning on routing in your kernel:

echo "1" > /proc/sys/net/ipv4/ip_forward

Of course, run /sbin/ifonfig to ensure that both interfaces are
configured properly.

HTH,

Aj




More information about the PLUG mailing list