Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I grab the visitor's IP address using JSP pages

Status
Not open for further replies.

survivorjoe

Technical User
Dec 6, 2000
26
0
0
US
Greetings,

I want to redirect site visitors coming from our firewall (IP block beginning with 155.188.) to an internal video to download. However, when I use the following line of code:

String myIP = request.getRemoteAddr();

I get a router IP beginning with 192. Our site is JSP based. Is there something in our hardware configuration that is keeping me from getting the client's IP address instead of a router address? Does anyone have a work-around to this?

Thanks in advance for your help

------------------------------------------------------
- Joe Kamenar
- 70 software packages with resell rights!
- Make fast profits in Real Estate
------------------------------------------------------
 
I use request.getRemoteAddr() and it works fine. I am behind a firewall router which forwards HTTP requests to a certain machine ... so I guess your firewall & or router are configured incorrectly. I would talk to your sys admin !

--------------------------------------------------
Free Database Connection Pooling Software
 
When I use some of the sites out there like ipchicken.com and others that show your IP, I do see the 155.188.XXX.XXX firewall IP address. What options do I have to be able to do this from our site? We are running weblogic and have a separate web server and application server.

------------------------------------------------------
- Joe Kamenar
- 70 software packages with resell rights!
- Make fast profits in Real Estate
------------------------------------------------------
 
When you say you only see IP's of 192.* then are you sure that the IP is not 192.* ? If you are testing from within your LAN, then this sounds normal ...

--------------------------------------------------
Free Database Connection Pooling Software
 
True, but I am going to an external website that is remotely hosted, so the HTTP request still goes through our firewall. For example, here is another site that gives me the 155.188.191.4 IP:


I still can't find anything out there that does this when I put the code on our site and test it.

- Joe

------------------------------------------------------
- Joe Kamenar
- 70 software packages with resell rights!
- Make fast profits in Real Estate
------------------------------------------------------
 
How the outside world sees your IP and how you see the outside world IPs are separate - and posting "proof" that an external server sees your IP as whatever, does not help.

If I were you, I would talk to your system admins, and at least find out what box the IP address that your are seeing actually is ...



--------------------------------------------------
Free Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top