|
Home > Archive > IIS ASP > February 2007 > REMOTE_ADDR Gives my External IP Instead of LAN Address
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
REMOTE_ADDR Gives my External IP Instead of LAN Address
|
|
| danknauf@gmail.com 2007-02-13, 1:17 pm |
| 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?
| |
| Anthony Jones 2007-02-13, 7:18 pm |
|
<danknauf@gmail.com> 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 "<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?
|
|
|
|
|