There are times when we need to know our WAN IP, for example in certain scripts or on servers where we do not have a graphical environment, but as the saying goes, Where there is a shell, there is a way.
We just need to install curl with:
emerge -av net-misc/curl
We have two servers that we can use to check our WAN IP:
curl ifconfig.me
curl icanhazip.com
curl icanhazip.com