sOKOle has asked for the wisdom of the Perl Monks concerning the following question:

To check user IP we have the enviroment table $ENV: $address=$ENV{REMOTE_ADDR}; but if the user connects through LAN his IP is always Does anybody knows what should I do to get the user real IP, even when he connects through LAN? RSVP sOKOle

Replies are listed 'Best First'.
Re: IP
by blakem (Monsignor) on Aug 14, 2001 at 14:35 UTC
    There are various setups that will cause the remote_addr to be the local machine ( Most that I've seen will set some other environment variable before overwriting $ENV{REMOTE_ADDR}, You might try $ENV{HTTP_PROXY} $ENV{FORWARDED_FOR} or $ENV{X_HTTP_FORWARD}. Since it varies between systems, my advice would be to just dump your %ENV and take a look, like so:

    print "$_ => $ENV{$_}\n" for (keys %ENV);


Re: IP addresses
by RatArsed (Monk) on Aug 14, 2001 at 14:17 UTC
    Are your users connecting via a proxy, on the same host? the remote address is always the IP address of the remote socket.


      via a proxy I think, anyway the problem remains, regardles how do they connect I always see the same :( sOKOle