With ISDN Debian suggests the following:

[00:56:02 tmp]$ cat /etc/ppp/ip-up
#!/bin/sh
#
# $Id: ip-up,v 1.2 1998/02/10 21:25:34 phil Exp $
#
# This script is run by the pppd after the link is established.
# It uses run-parts to run scripts in /etc/ppp/ip-up.d, so to add 
routes,
# set IP address, run the mailq etc. you should create script(s) there.
#
# Be aware that other packages may include /etc/ppp/ip-up.d scripts 
(named
# after that package), so choose local script names with that in mind.
#
# This script is called with the following arguments:
#    Arg  Name                          Example
#    $1   Interface name                ppp0
#    $2   The tty                       ttyS1
#    $3   The link speed                38400
#    $4   Local IP number               12.34.56.78
#    $5   Peer  IP number               12.34.56.99
#    $6   Optional ``ipparam'' value    foo

# The  environment is cleared before executing this script
# so the path must be reset
PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
export PATH
# These variables are for the use of the scripts run by run-parts
PPP_IFACE="$1"
PPP_TTY="$2"
PPP_SPEED="$3"
PPP_LOCAL="$4"
PPP_REMOTE="$5"
PPP_IPPARAM="$6"
export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM


# as an additional convenience, $PPP_TTYNAME is set to the tty name,
# stripped of /dev/ (if present) for easier matching.
PPP_TTYNAME=`/usr/bin/basename "$2"`
export PPP_TTYNAME 

# Main Script starts here

# Do not want the ip-up.d scripts for an inbound connection.
if [ "$PPP_IPPARAM"X = inboundX ]; then
#    route del -host "$PPP_REMOTE"
#    route add -host "$PPP_REMOTE" gw rakefet "$PPP_IFACE"
    exit 0
fi

run-parts /etc/ppp/ip-up.d

# last line

[00:56:11 tmp]$ ls /etc/ppp/ip-up.d
00-ipppd   exim       fetchmail.dpkg-old  slrn  xisp.dpkg-dist
0xisp-dns  fetchmail  leafnode            xisp
[00:56:20 tmp]$ grep -A5 '"$PPP_IFACE"' /etc/ppp/ip-up.d/00-ipppd
case "$PPP_IFACE" in
        ippp0)  route del default
                route del "$PPP_REMOTE"
                route add -host "$PPP_REMOTE" gw "$PPP_LOCAL"
                route add default gw "$PPP_REMOTE"

[00:56:27 tmp]$ grep -A5 '"$PPP_IFACE"' /etc/ppp/ip-down.d/99-ipppd 
case "$PPP_IFACE" in
        ippp0)  route del default
                route del "$PPP_REMOTE"
                # route add default netmask 0 $PPP_IFACE     # usually 
necessary
                # The next lines are for firewalling.
                # See comments in /etc/isdn/device.* about firewalling!


> Hi,
> 
> One of the parameters of pptp (i.e. of pppd) is "defaultroute".
> However, when there is already an existing default gateway, it doesn't
> have any effect. Not only the original gateway remains the default, but
> moreover: the new one even isn't inserted into the routing table as an
> entry.
> 
> Besides, even when running "route add default gateway" manually, it
> doesn't OVERRIDE the original gateway, but only inserts a yet another
> entry.
> 
> Of course, it is possible to "del" the original entry, "add" the new
> one, and then re-"add" the original (so when the new fails, the
> original will replace it automatically). But it's ugly, and has some
> problems.
> 
> In addition, since pppd is invoked in the background, it is impossible
> to add a "route" command to the rc init script, but it must be done
> after pppd succeeded to establish a connection with the ADSL (which
> takes at least a few seconds). "route" also needs the exact IP number
> of the default router in the case of ADSL, which usually isn't
> permanent, and should be sed'ed/awk'ed/etc. from the output of
> ifconfig.
> 
> So in any case, if the "defaultroute" parameter of "route add default
> gateway" could work correctly, it could help.
> 
> Anybody?
> 
> 
> BTW: The Israeli start-up "Zend" sold a license for their PHP debugger
> to Borland in close to $1M. Just read about it in TheMarker.
> -- 
> Eli Marmor
> [EMAIL PROTECTED]
> CTO, Founder
> Netmask (El-Mar) Internet Technologies Ltd.
> __________________________________________________________
> Tel.:   +972-9-766-1020          8 Yad-Harutzim St.
> Fax.:   +972-9-766-1314          P.O.B. 7004
> Mobile: +972-50-23-7338          Kfar-Saba 44641, Israel
> 
> =================================================================
> To unsubscribe, send mail to [EMAIL PROTECTED] with
> the word "unsubscribe" in the message body, e.g., run the command
> echo unsubscribe | mail [EMAIL PROTECTED]
> 

-- 

    Shaul Karl
    email: shaulka(at-no-spam)bezeqint.net 
           Please substitute (at-no-spam) with an at - @ - character.
           (at-no-spam) is meant for unsolicitate mail senders only.



=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to