Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old February 13th, 2007, 04:25 PM
danknauf@gmail.com
Guest
 
Posts: n/a
Default REMOTE_ADDR Gives my External IP Instead of LAN Address

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?

  #2  
Old February 13th, 2007, 09:55 PM
Anthony Jones
Guest
 
Posts: n/a
Default Re: REMOTE_ADDR Gives my External IP Instead of LAN Address


<danknauf@gmail.comwrote in message
news:1171383276.323772.113460@p10g2000cwp.googlegr oups.com...
Quote:
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?


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles