Determining your internal and external IP

Commands to find out your external IP:

My favorite one as it returns the following format:
“ip”: “192.168.1.100”,
“hostname”: “host.com”,
“city”: “Mountain View”,
“region”: “CA”,
“country”: “US”,
“loc”: “37.4192,-122.0574”,
“org”: “Google Inc.”,
“postal”: “94043”

You can get the same result using curl.

The following command returns the internal IP: