How to see public IP address of outgoing internet traffic when connected via router?

Another quick service is curl ifconfig.me

Add an echo afterwards to complete the line:

curl ifconfig.me && echo

enter image description here


You can pick one of the many external services who parrot your public IP address back to you when you query them. For example,

curl -s http://ipecho.net/plain; echo

I personally use it often enough so I wrap it in a shell function called myip, inspired by a shell function from the Bash-it library:

function myip()
{
    res=$(curl -s http://ipecho.net/plain; echo)
    echo -e "Your public IP is: ${echo_bold_green} $res ${echo_normal}"
}

Update: I edited the answer to use curl instead of wget because the latter does not come with macOS (thanks to user klanomath for pointing this out.)


We (at work and while troubleshooting family/friends) always go to http://myipaddress.com in a web browser. As Synoli stated, there are dozens of sites out there that show you the IP address the world sees when you browse and perform other tasks.

You may find that some ISP's, especially mobile network operators like AT&T, Verizon, etc. proxy everything behind a pool of IP addresses, and very often web traffic goes through a different set of proxies than everything else.

If your network is IPv6 capable, that could complicate things, with some providers doing 6to4, carrier-grade NAT, and others passing IPv6 straight through.