Re: alias address in REMOTE_ADDR

From: Date: Sat, 12 May 2012 06:32:56 +0000
Subject: Re: alias address in REMOTE_ADDR
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-317855@lists.php.net to get a copy of this message
On Saturday, May 12, 2012, shiplu wrote: > > > On Saturday, May 12, 2012, Tóth Csaba wrote: > >> Hi Everyone, >> >> I've run into a curious problem, not even really sure it's PHP, but >> that's where >> I caught it, so here it is: >> >> I have two servers hanging on the net, without proxies. Let's call them >> Server1 >> and Server2. Server1 has multiple IP addresses, configured as aliases. My >> problem: >> When I do a wget --spider from 1 to 2, I get the eth0 (not alias) address >> in >> Apache's accesslog on Server2. But when I do a file_get_contents( >> http://server2.tld), >> and observe the $_SERVER['REMOTE_ADDR'] on Server2, I get one of the >> alias IP addresses >> back. What can cause this? I really need the eth0 IP address back in >> REMOTE_ADDR. >> >> > > On server2 make sure the metric of both interface in the routing table is > not same. Same metric can cause this behavior. Change the metric of eth0 to > a lower value than the other. Then try again. > > Correction. "On server2" should be "On server1". -- Shiplu.Mokadd.im ImgSign.com | A dynamic signature machine Innovation distinguishes between follower and leader

« previous php.general (#317855) next »