|go ahead... be a heretic
Discriminating between local and remote IP'sby Avitar (Acolyte)
|on Oct 04, 2004 at 18:15 UTC
Avitar has asked for the wisdom of the Perl Monks concerning the following question:
I have a local intranet that will not require an extensive logon, but if you are accessing it via the internet, it will require a more though logon proceder as per my bosses request. The Intranet server also has a direct connection to the internet so the box has a public and private IP. Which makes matters worse is that it is also a NAT box with DNS and DHCP in it for the local intranet. The intranet hosted via an Apache server on this box.
I know how to get IP's but i need to know how to determine if the range is on the local network, or accross the web.
For instance: Say the range of my LAN is 192.168.0/24 ... There is also a internet ip of 192.168.0.1 which would have reduced security on it.
What would be an abstract way of telling these two apart?
I was considering getting the remote MAC addresses and storing them in a database that would be cross referenced with the users IP, but that would require setting up another machine maybe to run the script, and would require manual intervention every setup.
Is there a way to force perl to look at the NIC it is using to talk to the client? I am sure this has been done somewhere in cpan, just having problems with the best approach to solve the problem.
Others sharing their wisdom with the Monastery: (1)
As of 2024-02-22 01:23 GMT