Vandithar 0 Light Poster

Hi,

I want to get the ip address of the clients who is accessing my web pages.

I have the following information.

IP Address. . . . . . . . . . . . : 192.168.3.219
  Subnet Mask . . . . . . . . . . . : 255.255.248.0
  Default Gateway . . . . . . . . . : 192.168.1.254

I think ip address of my system is 192.168.3.219.

I tried like this to get ip address.

$host = $ENV{'REMOTE_HOST'};
print "<br>Remote host:  $host <br>";
$addr = $ENV{'REMOTE_ADDR'};
print "<br> host address: $addr <br>";

I didn't get any output for REMOTE_HOST ($host) where as i got output for REMOTE_ADDR ($addr).

Output is:

host address:  192.168.1.254  (which is default gateway)
# i think i have to get:  192.168.3.219

How can i get exact ip address of client machine in Perl/CGI?

Regards
Vanditha