How to obtain the external IPv4 address via Terminal I'm trying to figure out how to obtain my external IP (IPv4) via Terminal without connecting to a remote website or service. 

Here's what I've found so far - these all use remote/external checking:


curl ifconfig.me
curl icanhazip.com
curl -s checkip.dyndns.org | grep -Eo '[0-9.]+'
dig +short myip.opendns.com @resolver1.opendns.com


Is it even possible without checking some external source?
It is not possible without checking an external source.  

In a typical networking environment, nothing on your computer knows the external IP address the computer is using to communicate with the public internet.  Instead, the computer has a private IP address and sends all traffic to the private IP address of a router which then forwards the traffic the the public internet using a public IP address.

The only reliable way to determine the public IP address associated with your computer's traffic is to contact an external source and have it tell you what IP address it sees your traffic coming from.