[pptp-server] ip-up script and real client's IP

George Vieira GeorgeV at citadelcomputer.com.au
Sat Aug 4 09:11:06 CDT 2001


I know a cheat way is to read the PPPx device in ip-up.local and then find
it's parent process of the pppd command this then contains the real IP and
is fully legit... eg.

ps -ef (eg, to show where to find the real IP )
---------------
root      5104  1111  0 23:34 ?        00:00:01 pptpd [144.137.66.4]
root      5105  5104  0 23:34 ?        00:00:00 /usr/sbin/pppd local file
/etc/ppp/options.pptp 115200


cat /var/run/ppp0.pid (You get "ppp0" as $1 in ip-up.local )
---------------------
5105

if-up.local
-----------------
#  interface-name tty-device speed local-IP-address remote-IP-address
ipparam
PID=`ps -fp \`cat /var/run/$1.pid\` | tail -1`
RPID=`echo $PID | cut -f 3 -d " "`
IP=`ps -p $RPID -o cmd | tail -1 | cut -f 2 -d "[" | cut -f 1 -d "]"`
echo "Real IP Connection : $IP " >> /var/log/pptp.log


PLEASE someone find a cleaner way of doing this.. this works for me
everytime but when 100 connection come in at once I bet the CPU must go
bonkas with shell scripting....



Hope this helps the idea a bit... maybe someone can write a C code version
which compile would be passed something like "pptpip ppp0" and it'll return
the IP... Oh cool yeah!!..




-----Original Message-----
From: Yoss [mailto:bartek at host9.milc.com.pl]
Sent: Saturday, August 04, 2001 7:28 PM
To: pptp-server at lists.schulte.org
Subject: [pptp-server] ip-up script and real client's IP


Hi.
Is there any posibility to recognize real IP of the client in ip-up 
script? 
A login and pasword is for me not enough.
Until now I was makeing it with perl script, which gives me IP upon 
analysis of logs and `ps`. But now, when number of my clients will 
incerase up to one hundred this way can be uncertain.

Or Is there any posibility to change pptpd to transmit real IP of 
client to pppd? In example as linkname option? (as far as I know this 
option is unused by pptp).

Thank you in advance.

-- 
Bartłomiej Butyn aka Yoss
Nie ma tego złego co by na gorsze nie wyszło.
_______________________________________________
pptp-server maillist  -  pptp-server at lists.schulte.org
http://lists.schulte.org/mailman/listinfo/pptp-server
--- To unsubscribe, go to the url just above this line. --



More information about the pptp-server mailing list