Date: Fri, 10 Nov 2000 12:37:27 +0100 From: "Andre Goeree" <abgoeree@uwnet.nl> To: freebsd-stable@freebsd.org Subject: user-ppp fails to pass MYADDR to script(s) Message-ID: <20001110123727.A10989@freebee.attica.home>
next in thread | raw e-mail | index | archive | help
Hello all,
Since a while ago, i am having a small problem with user-ppp.
It seems that ppp does not allways correctly pass the MYADDR
variable to the script i call from /etc/ppp/ppp.linkup.
All other variables used in ppp.linkup are passed correctly to
the script.
First of all i thought my ISP was to blame, they have been
changing their ip-numbers (or whatever), but then i took
a closer look at /var/log/ppp.log.
It turns out that ppp correctly negotiates an ip-number and then
calls the script with the variables.
Somehow the MYADDR variable doesn't come through while all the
other variables do...
It also seems to happen randomly and it doesn't depend on the
ISP i use...
So far i have tried:
* changing the order of variables in ppp.linkup
* rewritten my ppp-linkup.sh script, but it's that simple
that it never could be a problem
* tried several things like changing "set ifaddr" and other
options in ppp.conf
* reread the ppp manpage and docs in /usr/share/doc to see
if i missed something
* different ISP's.
Yet i didn't make any progress in solving this problem...
Is any of you experiencing the same thing?
Are my ISP's to blame?
Any ideas are welcome, below you will find all necessary info.
Regards,
Andre.
############## Additional info #########################################
[snip from /var/log/ppp.log]
Nov 10 10:53:26 freebee ppp[10970]: tun0: IPCP: \
myaddr XXX.XXX.XXX.XXX hisaddr = XXX.XXX.XXX.XXX
Nov 10 10:53:26 freebee ppp[10970]: tun0: Command: MYADDR: \
!bg /home/ago/bin/ppp-linkup.sh start MYADDR HISADDR DNS0 DNS1 LABEL
Nov 10 10:53:26 freebee ppp[10970]: tun0: Command: MYADDR: \
!bg /usr/local/bin/waveplay /home/ago/etc/connect.wav /dev/null 2>&1
Nov 10 10:53:26 freebee ppp[10970]: tun0: Chat: Parent notified of success
Nov 10 10:53:26 freebee ppp[10969]: tun0: Phase: Parent: PPP enabled
[end of /var/log/ppp.log]
[ snip from /etc/ppp/ppp.conf ]
# $FreeBSD: src/etc/ppp/ppp.conf,v 1.2.2.1 2000/08/18 08:33:02 jhb Exp $
#################################################################
default:
ident user-ppp VERSION (built COMPILATIONDATE)
# Ensure that "device" references the correct serial port
# for your modem. (cuaa0 = COM1, cuaa1 = COM2)
#
set device /dev/cuaa1
set log Phase Chat LCP IPCP CCP tun command
set speed 115200
set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \
\"\" AT OK-AT-OK ATE1Q0 OK \\dATDT\\T TIMEOUT 40 CONNECT"
#set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0
set ifaddr 10.0.0.1/0 10.0.0.2/0 0.0.0.0 0.0.0.0
set timeout 120 # 3 mintue idle timer (the default)
add default HISADDR # Add a (sticky) default route
enable dns # request DNS info (for resolv.conf)
#disable pred1
#deny pred1
#disable lqr
#deny lqr
#set openmode active
#
# edit the next three lines and replace the items in caps with
# the values which have been assigned by your ISP.
#
{Accounts and passwords}
[end of /etc/ppp/ppp.conf]
freebee# cat /etc/ppp/ppp.linkup
MYADDR:
!bg /home/ago/bin/ppp-linkup.sh start MYADDR HISADDR DNS0 DNS1 LABEL
!bg /usr/local/bin/waveplay /home/ago/etc/connect.wav /dev/null 2>&1
[end of /etc/ppp/ppp.linkup]
freebee# cat /etc/ppp/ppp.linkdown
MYADDR:
!bg /home/ago/bin/ppp-linkup.sh stop
[end of /etc/ppp/ppp.linkdown]
ago@freebee$ cat /home/ago/bin/ppp-linkup.sh
#!/bin/sh
ACTION=${1}
MYADDR=${2:-0.0.0.0}
HISADDR=${3:-0.0.0.0}
DNS0=${4:-0.0.0.0}
DNS1=${5:-0.0.0.0}
ISP=${6:-unknown}
DATE=$(date +%Y/%m/%d)
TIME=$(date +%H:%M:%S)
DATABASE="test"
DATATABLE="ppp_log"
QUERYTMP="/tmp/data-string"
case ${ACTION} in
start)
#echo ${MYADDR} >/tmp/dialup-ip
echo -n "insert into ${DATATABLE} values ('${DATE}',
'${TIME}','${MYADDR}','${HISADDR}','${DNS0}','${DNS1}',
'${ISP}'" > ${QUERYTMP}
;;
stop)
echo ",'${TIME}');" >>/tmp/data-string
/usr/local/pgsql/bin/psql -f ${QUERYTMP} -d test
#rm -f ${QUERYTMP}
;;
esac
[end of /home/ago/bin/ppp-linkup.sh]
ago@freebee$ cat /tmp/data-string
insert into ppp_log values ('2000/11/10','10:53:26','0.0.0.0','XXX.XXX.XXX.XXX',
'XXX.XXX.XXX.XXX','XXX.XXX.XXX.XXX','wish','10:53:40');
ago@freebee$ uname -a
FreeBSD freebee.attica.home 4.2-BETA FreeBSD 4.2-BETA #0: Thu Nov 9 19:00:58 CET 2000
root@freebee.attica.home:/usr/obj/usr/src/sys/CUSTOM i386
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001110123727.A10989>
