0
使用此代碼:
在服務器AI有這樣的:
$handle = fopen('http://www.server_b.com/get_ip.php', 'r'); //This is just a PHP file that echoes the REMOTE_ADDR
echo "IP looks like ".fread($handle, '100000')." to external server.\n";
fclose($handle);
echo "IP looks like ".$_SERVER['SERVER_ADDR']." to this server.";
服務器上BI有這樣的:
echo $_SERVER['REMOTE_ADDR'];
我越來越從服務器A的輸出如下:
IP looks like xxx.xxx.223.90 to external server. //xxx.xxx on both lines are the same
IP looks like xxx.xxx.223.94 to this server.
爲什麼我得到兩個不同的IP?請注意,我們擁有的IP地址範圍是.90-.94
所以,你得到一個遠程計算機的IP地址,你想知道爲什麼它是從當前機器的地址不同? –
「服務器A」是多宿主的,即有多個網卡? –
也許「A」通過.90機器代理? –