[lug] Detect remote IP Address

Rob Riggs rob at pangalactic.org
Tue Oct 9 20:54:55 MDT 2001


I thought about this some more, and if you want the uber-cheap way to do 
this, add a line like:

lynx -dump http://my.webserver/bogus?ip=$4 > /dev/null

in your /etc/ppp/ip-up script ($4 should be the local IP passed to the 
ip-up script). You can then "grep bogus /var/log/httpd/access_log | tail 
-1 | sed 's/.*ip=\([^ ]*\) .*/\1/'" for the latest IP. No CGI needed.

(This assumes that the machine uses PPP to make its connection.)

Riggs, Rob wrote:

>I did this many years ago using a very simple CGI script. The dynamic box
>had a script that posted its new IP to the CGI on the remote, static server.
>The remote server just kept a log of the IPs for me.
>
>-----Original Message-----
>From: Ferdinand Schmid [mailto:fschmid at archenergy.com]
>
>My current way of identifying this system is to have an on site person
>initiate 
>an ssh connection to one of my systems that doesn't accept ssh and then I
>look 
>up the IP address in my firewall logs.
>






More information about the LUG mailing list