What is My IP Address? How Do I Get My External IP Address in Mac OS X?
One of the quickest ways to get your external IP address in Mac OS X or unix is by launching the Terminal and typing one of the following commands with curl. To be perfectly clear here, we’re looking for the external public IP address of the hardware in use, this is what broadcasts to the world, this is not the same as a LAN IP or local IP, which is usually not public.
To get started open the command line and choose one of the syntax approaches below to retrieve an external IP.
Use curl with ipecho.net to get the public IP address:
curl ipecho.net/plain ; echo
Using ifconfig and curl to get the external IP address of a computer:
This will report back your IP address by pulling the result from one of the two web services, there are actually quite a few of these services out there so you can try curl with many of them to retrieve the public IP addy.
Alternatively, you could view those type of sites in your web browser and also get your external IP address, but that’s not as quick as using Terminal for many users.
And yes, this works in all versions of OS X on all Macs, and all versions of Linux too. Technically you can visit those above URL’s on any web browser rather than running through curl and you’ll also get their external IP addresses too.