I'm using Request.UserHostAddress to get client IP address. But it returns wrong IP. My IP address is 87.107.35.63, but it returns 80.253.128.74. I have tested with other websites and they return correct IP address.
Don't forget to click "Mark as Answer" on the post that helps you!
are you behind a corporate firewall or VPN'ing into your company network? if thats the case then it will most likely return the Firewall's IP address or the ip that you use to vpn into.
I'm unsure. Perhaps there is a proxy server. I know that something has changed in the network, because it was working before.
In my home, I'm behind a router with NAT. Also, ZoneLabs Security Suite is installed on my PC.
There is a way to get correct IP address though, because
this page shows my correct IP address.
Don't forget to click "Mark as Answer" on the post that helps you!
lordfkiller
Member
380 Points
98 Posts
Request.UserHostAddress returning wrong IP address
Dec 12, 2006 02:21 PM|LINK
mcmcomasp
Contributor
6834 Points
1436 Posts
Re: Request.UserHostAddress returning wrong IP address
Dec 13, 2006 02:44 PM|LINK
are you behind a corporate firewall or VPN'ing into your company network? if thats the case then it will most likely return the Firewall's IP address or the ip that you use to vpn into.
hth,
mcm
lordfkiller
Member
380 Points
98 Posts
Re: Request.UserHostAddress returning wrong IP address
Dec 13, 2006 05:41 PM|LINK
I'm unsure. Perhaps there is a proxy server. I know that something has changed in the network, because it was working before.
In my home, I'm behind a router with NAT. Also, ZoneLabs Security Suite is installed on my PC.
There is a way to get correct IP address though, because this page shows my correct IP address.
mcmcomasp
Contributor
6834 Points
1436 Posts
Re: Request.UserHostAddress returning wrong IP address
Dec 13, 2006 05:44 PM|LINK
not for me, it whatsmyip shows my firewall's ip address, not my actual computers ip address.
hth,
mcm
PhaedoHD
Member
436 Points
156 Posts
Re: Request.UserHostAddress returning wrong IP address
Dec 13, 2006 05:54 PM|LINK
this always seems to work for me:
ip = Request.ServerVariables[
"HTTP_X_FORWARDED_FOR"]; // If there is no proxy, get the standard remote address if ((ip == null) || (ip == "") || (ip.ToLower() == "unknown"))ip = Request.ServerVariables[
"REMOTE_ADDR"];RateMyEverything