Find the client browser ip-adress

W

Wiseguy

KS said:
Is it possible to get a client browser ip-adress when it access my webpage?
I use JSP files.
If the client is behind a network from a company can I get the ipadress
gateway where the client is behind or is it i only possible to get the
client ipadress?

I want to somehow deny everyone except the one with the correct
ip-adress/range.

denying access to ip ranges is done thru configuration of the webserver,
not from within the webpages themselves.
 
A

Aleksander =?iso-8859-2?Q?Str=B1czek?=

KS said:
Is it possible to get a client browser ip-adress when it access my webpage?
I use JSP files.
If the client is behind a network from a company can I get the ipadress
gateway where the client is behind or is it i only possible to get the
client ipadress?

I want to somehow deny everyone except the one with the correct
ip-adress/range.
request.getRemoteAddr();
request.getHeader("x-forwarded-for");
 
K

KS

Is it possible to get a client browser ip-adress when it access my webpage?
I use JSP files.
If the client is behind a network from a company can I get the ipadress
gateway where the client is behind or is it i only possible to get the
client ipadress?

I want to somehow deny everyone except the one with the correct
ip-adress/range.
 
D

Dotty

KS said:
Is it possible to get a client browser ip-adress when it access my webpage?
I use JSP files.
If the client is behind a network from a company can I get the ipadress
gateway where the client is behind or is it i only possible to get the
client ipadress?

I want to somehow deny everyone except the one with the correct
ip-adress/range.
My experience with CGI is that all users on a UNIX box have the
same ip-address.
 
K

KS

I agree that access controll should not be done this way, but for logging
and keep an eye on who use my webpage it should be the way to do it.

Does anyone know if the ipadress normally would be from the client
computer ? By normally I dont consider some hacker that has change his
ipadress.
Im just trying to understand the consept.
 
O

Oscar kind

KS said:
I agree that access controll should not be done this way, but for logging
and keep an eye on who use my webpage it should be the way to do it.

Does anyone know if the ipadress normally would be from the client
computer ? By normally I dont consider some hacker that has change his
ipadress.
Im just trying to understand the consept.

It should be, unless the IP address is spoofed. And although firewalls can
detect this, AFAIK normal applications don't look that close to the
packets; at least Java doesn't.

But even for normal users, you cannot entirely rely on the IP address: it
may be dynamic, or the for users is behind a NAT firewall. In that last
case you'll get the address of the firewall, as the internal address is
likely in one of the unroutable ranges.

For logging purposes though, logging the IP address and preferably also
the username is enough in most cases. The username is not important when
you don't expect many corporate users to connect, or if usage is anonymous
anyway.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,266
Messages
2,571,074
Members
48,772
Latest member
Backspace Studios

Latest Threads

Top