Gees, your running the exact same setup I'm running at home..

Here's where your problem starts:

1. If you running other pppd stuff like dial in/out or VPNs, your
ip-up.local will run for all of the those and ddclient and firewalls
wouldn't want to run for everything just adsl... get it?

2. ADSL scripts don't support (well doesn't work for me) the ipparam
function for pppd so ip-up.local can't tell it's adsl starting up...


what I did is specify everything that uses pppd to use the ipparam option so
then I do this in my ip-up.local as below script shows.
Sorry for the largeness here but I hope it make you understand what I've
done.
If ipparam isn't specified it assumes it's ADSL as that damn thing doesn't
work with ipparam.. weird I know.

---------------------------------------

#!/bin/bash
LINK=$6
if [ ! $LINK ]; then
        LINK="adsl"
        echo "Setting LINK to ADSL" | logger -p local0.notice -t
"IP-UP.LOCAL"
fi

# These are the parameters passed to script by PPPD
# interface-name tty-device speed local-IP-address remote-IP-address ipparam

echo "IP-UP.LOCAL Script Started for ($LINK)" | logger -p local0.notice -t
"IP-UP.LOCAL"
DATETIME="IP-UP    [`date +%d/%b/%Y:%H:%M:%S`]"

case $LINK in
        pptpcd)
                echo "($LINK): PPTP-Citadel connection started." | logger -p
local0.notice -t "IP-UP.LOCAL"
                echo "$DATETIME ($LINK) PPTP-Citadel connection started." >>
/var/log/pppconnect.log
                #
                # Add route for Citadel private network
                #
                echo "($LINK) Adding routes for clients." | logger -p
local0.notice -t "IP-UP.LOCAL"
                echo "$DATETIME ($LINK) Adding routes for clients." >>
/var/log/pppconnect.log
                route add -net x.x.x.x/24 gw $5 # Our client
                route add -net x.x.x.x/24 gw $5 # Citadel
                ;;

        3pm)
                echo "($LINK): PPTP-3PM connection started." | logger -p
local0.notice -t "IP-UP.LOCAL"
                echo "$DATETIME ($LINK) PPTP-3PM connection started." >>
/var/log/pppconnect.log
                #
                #
                # Add route for 3PM private network
                #
                echo "($LINK) Adding routes for client." | logger -p
local0.notice -t "IP-UP.LOCAL"
                echo "$DATETIME ($LINK) Adding routes for client." >>
/var/log/pppconnect.log
                route add -net x.x.x.x/24 gw $5 # 3PM
                ;;

        adsl)
                echo "($LINK): ADSL connection up" |  logger -p
local0.notice -t "IP-UP.LOCAL"
                echo "$DATETIME ($LINK) ADSL connection up" >>
/var/log/pppconnect.log
                sleep 3
                /etc/rc.d/init.d/iptables restart
                ddclientupdate
                ;;

        dialin)
                echo "($LINK): DIALIN connection up." | logger -p
local0.notice -t "IP-UP.LOCAL"
                echo "$DATETIME ($LINK) DIALIN connection up." >>
/var/log/pppconnect.log
                ;;
        *)
                echo "($LINK): Unknown PPP invocation" | logger -p
local0.notice -t "IP-UP.LOCAL"
                echo "$DATETIME ($LINK) Unknown PPP invocation" >>
/var/log/pppconnect.log
                ddclientupdate
                ;;
esac





thanks,
George Vieira
Systems Manager
Citadel Computer Systems P/L


-----Original Message-----
From: Scott Ragen [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 27 November 2001 9:31 AM
To: [EMAIL PROTECTED]
Subject: [SLUG] IP Changes


Hi all,
I've been looking for a good hardy script/program that will run commands I
specify when an ip address on ppp0 (adsl) changes.
I need to run commands like iptables restart, ddclient (to change the
dyndns.org dns) and restart the vpn.
Does anyone have any suggestions, ddclient apparently can, but I couldn't
get it to work because I think it performs the commands after it changes the
domain name, which it can't because of iptables firewall.

Regards,

Scott

Scott Ragen
Technical Support - Roadtech Systems Ltd
Phone: 02 98073516 Fax: 02 98085294
www.roadtechsystems.com.au



-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to