Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
easily get your WAN IP
#1

this was just asked in the IRC channel.. he was wondering if there was a easy way in shell to get the external IP address if you are behind a router. well there is. I setup a very simple php page to report back your IP.. so if you run

 



Code:
IP=`wget -q -O - http://homer.meso.com/remoteip.php`
echo $IP




 

You should get your IP address back.. here is the 1 liner php script if anyone wants to run their own

 

 



Code:
<? echo $_SERVER["REMOTE_ADDR"]; ?>




Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)