Is there a way for a box behind a firewall to tell what IP address the firewall is using
As DamnDirtyApe notes, a static hostname is a good way of solving this particular problem, but an alternative is something like...
use LWP::Simple; if (get('http://www.whatismyip.com/') =~ /(\d+[.]\d+[.]\d+[.]\d+)/) { print $1; }
Another solution (if you have control over the firewall), is to install SNMP and then query the firewall remotely using Net::SNMP (alt.) or Net::SNMP::Interfaces (alt.).
--k.
Update: Fixed snippet.
In reply to Re: Getting an IP address from DHCP
by Kanji
in thread Getting an IP address from DHCP
by Snuggle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |