Subject: Re: Routing and PPP...
To: None <current-users@netbsd.org>
From: Matthias Scheler <tron@lyssa.owl.de>
List: current-users
Date: 10/03/1998 11:44:32
In article <199809291803.NAA03645@guild.plethora.net>,
	seebs@plethora.net writes:
> Because I can leave the netmask in a config file and forget about it,

As Perry said netmask are not relevenat for point to point interfaces.

> but the route has to get tweaked whenever the line comes up or down.

Yes, of course.

> I suppose I can just add a "route add foo" somewhere, ...

That's exactly what "ip-up" was invented for. On my remote router it
looks like this:

#!/bin/sh
# ip-up-skript
# called with
#ifname tty speed local remote
PATH=/bin:/sbin:/usr/bin:/usr/sbin;export PATH

ifname=$1
tty=$2
speed=$3
local=$4
remote=$5
export ifname tty speed local remote

grep -v "^#" /etc/ppp/parameters |
(while read theip theroute themask
 do
  if [ $remote = $theip ]
  then
   if [ X$theroute != X ]
   then
    route add -net $theroute -netmask $themask $remote
   fi
  fi
 done)

exit 0

And here is an example for "/etc/ppp/parameters":

#
# IP            nettoroute      netmask
#
# colwyn.owl.de
194.123.65.89   194.123.65.88   255.255.255.248

-- 
Matthias Scheler                                http://home.owl.de/~tron/