#!/bin/sh # When the ppp link comes up, this script is called with the following # parameters # $1 the interface name used by pppd (e.g. ppp3) # $2 the tty device name # $3 the tty device speed # $4 the local IP address for the interface # $5 the remote IP address # $6 the parameter specified by the 'ipparam' option to pppd DEBUGFILE=/tmp/ip-up-debug.txt ## echo "1:$1 2:$2 3:$3 4:$4 5:$5 6:$6" > $DEBUGFILE NET=`echo $5 | cut -d. -f1,2,3` ## echo $NET >> $DEBUGFILE case $NET in 192.168.3) ## echo "CASE1" >> $DEBUGFILE RESULT=`/sbin/route add -net 192.168.30.0 $5 255.255.255.0` ##echo $RESULT >> $DEBUGFILE ;; 192.168.2) ## echo "CASE2" >> $DEBUGFILE RESULT=`/sbin/route add -net 192.168.20.0 netmask 255.255.255.0 gw $5` ## echo $RESULT >> $DEBUGFILE ;; 192.168.1) ## echo "CASE3" >> $DEBUGFILE RESULT=`/sbin/route add -net 192.168.10.0 netmask 255.255.255.0 gw $5` ## echo $RESULT >> $DEBUGFILE ;; *) ## echo "No match" >> $DEBUGFILE ;; esac