|Perl: the Markov chain saw|
Getting an IP address from DHCPby Snuggle (Friar)
|on Jul 30, 2002 at 20:31 UTC||Need Help??|
Snuggle has asked for the wisdom of the Perl Monks concerning the following question:
A question for your perusal...
I have a cable modem, and a linux box behind a broadband router. The ISP provides IPs through DHCP, and the IP that my network uses changes from time to time. I like to access my boxen through telnet from work a lot, and the problem is that the IP is always expiring and changing. So here is what I was wondering...
Is there a way for a box behind a firewall to tell what IP address the firewall is using, and more to the point, is there a perl module that anyone has experience using that can divine this info elegantly. My plan is to implement some cron jobbed perl to check the IP address, compare it to a last IP found, and email my office if the IP has changed.
Thanks for the opinions.
Anyway, no drug, not even alcohol, causes the fundamental ills of society. If we're looking for the source of our troubles, we shouldn't test people for drugs, we should test them for stupidity, ignorance, greed and love of power.
--P. J. O'Rourke