Question : Allow Access to Website Only from Certain IP Addresses

A little background info:
Our company uses two seperate networks, one that we manage, one that we do not and can't (It's a State network).  We have implemented an intranet, that we've had to make public, in order to allow the other network users that work in our company access to it.  We've put in the necessary measures to prevent our intranet from being crawled by search engines, but essentially anyone can access it.  We've also disabled Anonymous Authentication and require users to enter their domain usernames and passwords in order to view the intranet (All users on the other network, also have a userID on our network, so they need to enter it to authenticate).
What I would like to do: I'd like to setup a temporary site, that will record the IP addresses of anyone that accesses it.  What we will do is over a period of time, we will record the ranges of IPs that access the site.  Then we would like to implement either using java, php, or asp on our own IIS server,  something that will allow access to our intranet site only from the IP addresses that we specify.

What I need:
-The coding for the temporary site, to gather the IPs and save them in a text file.
-The coding for the Intranet site, that will check the IP address of the requester, if matches the IP list then it's allowed, if it's not one of the IPs, it gets redirected to another site.

Thank you.

Answer : Allow Access to Website Only from Certain IP Addresses

If this is in IIS I would recommend you look closer at the suggestion at http:#a25801360 .  Have the web server do it if the firewall option won't work.  The server can and then it doesn't require changing each server page (it isn't clear if you use ASP or JSP) and can be set up by site, folder, etc.  The logs would work for the start and then you can go into IIS and set up to deny all but the IPs you enter.

If you need details on this option please let us know what web server you use and version (I just assumed IIS based on what you had above).

bol
Random Solutions  
 
programming4us programming4us