REMOTE_ADDR Gives my External IP Instead of LAN Address

D

danknauf

I have a webserver which is behaving strangely. The server is a fresh
copy of Windows 2003 running IIS with default options + Active Server
Pages installed. The server is connected to a Linksys router, and has
a static IP address of 192.168.1.10.

When I access a page with the following script directly from the
server, my WAN IP address is returned (24.x.x.x.), instead of my LAN
address.

<%
Dim sIPAddress

sIPAddress = Request.ServerVariables("REMOTE_ADDR")

Response.Write "<h1>IP Address = <b>" & sIPAddress & "</b></h1>"
%>

Everything I've read about the REMOTE_ADDR server variable tells me
that it should return the IP address of the machine accessing the
page. Shouldn't this return the 192 address?

When I view the page as //localhost/dev/ip.asp, it returns the 127.
address, but when I view the page using my domain name, it returns the
external IP.

Any suggestions?
 
A

Anthony Jones

I have a webserver which is behaving strangely. The server is a fresh
copy of Windows 2003 running IIS with default options + Active Server
Pages installed. The server is connected to a Linksys router, and has
a static IP address of 192.168.1.10.

When I access a page with the following script directly from the
server, my WAN IP address is returned (24.x.x.x.), instead of my LAN
address.

<%
Dim sIPAddress

sIPAddress = Request.ServerVariables("REMOTE_ADDR")

Response.Write "<h1>IP Address = <b>" & sIPAddress & "</b></h1>"
%>

Everything I've read about the REMOTE_ADDR server variable tells me
that it should return the IP address of the machine accessing the
page. Shouldn't this return the 192 address?

When I view the page as //localhost/dev/ip.asp, it returns the 127.
address, but when I view the page using my domain name, it returns the
external IP.

Any suggestions?

When you say domain name do you mean the machine host name?
OR the fully qualified domain name?

If you ping using the your host name and FQDN what IP address does it hit?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top