Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is Request.UserHostAddress reliable?
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01418265
Message ID:
01419044
Views:
50
>Hi,
>
>I need to log IP of the user who is using my ASP.NET application (access is anonymous). I found (by Googling) the call to Request.UserHostAddress as a way to get the IP. It works on my notebook where I see "127.0.0.1". How reliable this approach is when the user will be accessing the application on real Intranet or Internet?
>
>Thank you in advance for your help.

It works fine. The only "issue" is that if the people are behind a NAT firewall you will see the address of the firewall, not the user. For example, my IP address is 192.168.1.100 and I hit a website. The website will see the address of our firewall which is 12.*.*.* (not the 192.*.*.* address). All users behind that firewall will appear to come from the same addres. I say "issue" because some people mistake this for a problem when it's exactly the correct behavior.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform