[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Routing



"Mark Maas" <mark@menem.mine.nu> writes:
> 
> This is what my table looked like:
> 
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags Metric Ref    Use
> Iface
> localnet        *               255.255.255.0   U     0      0        0 eth0
> 217.149.32.0    *               255.255.240.0   U     0      0        0 eth1
> default         217.149.34.113  0.0.0.0         UG    0      0        0 eth1
> default         192.168.8.4     0.0.0.0         UG    0      0        0 eth0

Whoops...  Sorry for that earlier blank reply.  My finger slipped.

I assume "localnet" here is 192.168.8.0 and that 192.168.8.4 is the
gateway on the local LAN which you were successfully using to contact
the other firms before bringing up "eth1".

I'd suggest doing:

        route del default gw 192.168.8.4

to get rid of that spurious extra default route and:

        route add -net 192.168.3.0/24 gw 192.168.8.4
        route add -net 10.1.0.0/24 gw 192.168.8.4

to try and route the two other private LANs through the old gateway.
Your final routing table will look like:

  localnet        *               255.255.255.0   U     0      0        0 eth0
  192.168.3.0     192.168.8.4     255.255.255.0   UG    0      0        0 eth0
  10.1.0.0        192.168.8.4     255.255.255.0   UG    0      0        0 eth0
  217.149.32.0    *               255.255.240.0   U     0      0        0 eth1
  default         217.149.34.113  0.0.0.0         UG    0      0        0 eth1

To make this change permanent, assuming you're using
"/etc/network/interfaces" and "eth0" is configured statically, you
want to comment out its "gateway" line (which adds that incorrect
default route) and add two "up" commands to statically route the two
"special" networks through the old gateway, like so:

auto eth0
iface eth0 inet static
        address 192.168.8.whatever
        network 192.168.8.0
        netmask 255.255.255.0
        broadcast 192.168.8.255
#       gateway 192.168.8.4
        up route add -net 192.168.3.0/24 gw 192.168.8.4
        up route add -net 10.1.0.0/24 gw 192.168.8.4

Is "eth1" a DHCP-configured ADSL modem or something?  If so, it'll get
the default route to 217.149.34.113 assigned automatically during the
DHCP negotiation, so there's nothing to add for that.

-- 
Kevin <buhr@telus.net>



Reply to: