Sorry just realised I could also remove --ip_server_name switch from
script /etc/init.d/dynamicdns which makes inadyn use
http://checkip.dyndns.org/ by default (must support
HTTP_X_FORWARDED_FOR)

 

Looks like dyndns.org have two sites

 

http://checkip.dyndns.org <http://checkip.dyndns.org/>  which supports
HTTP_X_FORWARDED_FOR (get my real IP) and http://getip.dyndns.org
<http://getip.dyndns.org/>  (get my ISP's proxy IP)

 

 

Cheers Guy

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Guy
Neale
Sent: Saturday, 1 December 2007 3:17 PM
To: AstLinux Users Mailing List
Subject: [Astlinux-users] Dyndns is updated with the ISP's proxy IP,not
real IP

 

Hi Kristian

 

I'm not to sure if this has effects anyone else or has been discussed
before (can't find anything in the mail list).

 

I found a problem if the ISP uses a HTTP proxy. Inadyn updates Dynamic
DNS with the Proxy's IP, fortunately if the proxy is a transparent type
it provides the real IP in HTTP_XFORWARDED_FOR 

 

REMOTE_ADDR = Proxy's IP 

HTTP_VIA = Proxy's IP 

HTTP_X_FORWARDED_FOR = YOUR IP (host making the HTTP request) 

 

After a little investigation and thanks to
http://www.thepcspy.com/read/getting_the_real_ip_of_your_users#php I
created the following page http://getip.thatsgreat.com.au
<http://getip.thatsgreat.com.au/>  which tests HTTP_XFORWARDED_FOR
(can't guarantee this will stay up), all worked well on my test box
after pointing inadyn to this new page.

 

If there's no adverse effect is it worth testing for
HTTP_X_FORWARDED_FOR on your http://getip.krisk.org/ site (thanks for
providing this service) for others

 

 

Sample 

<?php  

 

echo GetUserIP(); 

 

function GetUserIP() {

 

    if (isset($_SERVER)) {

 

        if (isset($_SERVER["HTTP_X_FORWARDED_FOR"]))

            return $_SERVER["HTTP_X_FORWARDED_FOR"];

        

        if (isset($_SERVER["HTTP_CLIENT_IP"]))

            return $_SERVER["HTTP_CLIENT_IP"];

 

        return $_SERVER["REMOTE_ADDR"];

    }

 

    if (getenv('HTTP_X_FORWARDED_FOR'))

        return getenv('HTTP_X_FORWARDED_FOR');

 

    if (getenv('HTTP_CLIENT_IP'))

        return getenv('HTTP_CLIENT_IP');

 

    return getenv('REMOTE_ADDR');

}

 

?>

 

Regards Guy

 

All, if you are interested in finding out if you're behind a proxy and
what type of proxy it is, go to
http://www.proxyblind.org/proxy_lookup.shtml (if its a Anonymous type
proxy I think your pretty much stuffed with automatically updating
Dyndns with inadyn) 

 

 

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Astlinux-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/astlinux-users

Donations to support AstLinux are graciously accepted via PayPal to [EMAIL 
PROTECTED]

Reply via email to