To know the IP address you use to go out on the Internet, you can use a site like http://www.whatismyip.com
In text mode with no Web browser, it’s a bit more complicated. You can use the following command:
wget --user-agent="Mozilla/5.0" -O - http://www.whatismyip.com 2>/dev/null | grep -o "Your IP Address Is: [0-9.]*"
We have to simulate a real browser, or the site refuses us.
To find your external IP address, an even more elegant way:
dig +short myip.opendns.com @resolver1.opendns.com
The best way: