REMOTE_ADDR Gives my External IP Instead of LAN Address
am 13.02.2007 17:14:36 von 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 "
IP Address = " & sIPAddress & "
"
%>
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?
Re: REMOTE_ADDR Gives my External IP Instead of LAN Address
am 13.02.2007 22:41:15 von Anthony Jones
wrote in message
news:1171383276.323772.113460@p10g2000cwp.googlegroups.com.. .
> 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 "IP Address = " & sIPAddress & "
"
> %>
>
> 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?