Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Get External IP

Reply
Thread Tools

Get External IP

 
 
Marc Rivait
Guest
Posts: n/a
 
      04-23-2004
I have been struggling this one. As part of a application we want to
control IP addresses which come to our site.

On the web page we get the IP of the client computer using
Request.UserHostAddress(). However, if a user is coming to us from behind a
NAT, all we get is the internally assigned IP. We need to see the external
IP. I have not been able to find a method for getting this.

Thanks,
Marc.


 
Reply With Quote
 
 
 
 
Curt_C [MVP]
Guest
Posts: n/a
 
      04-23-2004
You won't, not with a server technology at least. If they are coming through
some sort of VPN/etc and getting a NAT then that's what you'll get really.
Same thing if people are behind a proxy, you may get ONE IP for an entire
company.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com


"Marc Rivait" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> I have been struggling this one. As part of a application we want to
> control IP addresses which come to our site.
>
> On the web page we get the IP of the client computer using
> Request.UserHostAddress(). However, if a user is coming to us from behind

a
> NAT, all we get is the internally assigned IP. We need to see the

external
> IP. I have not been able to find a method for getting this.
>
> Thanks,
> Marc.
>
>



 
Reply With Quote
 
 
 
 
Raterus
Guest
Posts: n/a
 
      04-23-2004
Actually I think you have it backwards, NAT takes the internal ip and rewrites the packet with the external ip, if your visitors are hitting your site with an internal IP, they never had an external ip to begin with, and there would be no way of getting it unless you reroute traffic.

It's probably much easier and more secure to control IP access at IIS rather than in your asp.net application., you should be able to make it so only certain IP's can access your site.

"Marc Rivait" <(E-Mail Removed)> wrote in message news:%(E-Mail Removed)...
> I have been struggling this one. As part of a application we want to
> control IP addresses which come to our site.
>
> On the web page we get the IP of the client computer using
> Request.UserHostAddress(). However, if a user is coming to us from behind a
> NAT, all we get is the internally assigned IP. We need to see the external
> IP. I have not been able to find a method for getting this.
>
> Thanks,
> Marc.
>
>

 
Reply With Quote
 
 
 
Reply

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create references to external scipt files from within an external script file Mellow Crow Javascript 6 11-04-2005 01:16 PM
How 2 get single JDOM doc of XML schema that also includes external schemas kyancy@gmail.com Java 3 03-09-2005 07:19 PM
Any idea where I can get this answered? Acomdata 160 Gig USB external HD. Partitioning problem. Larry@lost.and.confused. Computer Support 21 01-18-2005 08:49 AM
unresolved external symbol/using an external dll Scott Allen C++ 8 05-02-2004 06:11 PM



Advertisments