Determining the External IP Address

Here’s how to find out your external IP address courtesy of this hint:

curl --silent
    | awk '{print $6}' | cut -f 1 -d "<"

If you are using Apple’s Airport Extreme Basestation (mine is particularly the Time Capsule and this is where I have tested this), and you have the SNMP interface enabled, you can run the following command

prompt$ snmpwalk -Os -c public -v 1 ipAdEntAddr IpAddress 
    | grep -E -v '(127.0.0|169.254|' 
    | cut -d : -f 2 | sed 's/ //g'

Leave a Reply