Find out your router’s external IP address using the Linux command line
If you want to find out what external IP address your router has assigned to it, you can either search the Internet for sites that can display that said IP address or you can use the Linux command line:
wget -O - -q icanhazip.com



It gives the wrong address.
This one works if you know pppoe:
pppoe-status | grep -w ‘inet addr’ | tr ‘\t’ ‘ ‘ | cut -d ‘:’ -f 2 | cut -d ‘ ‘ -f 1
else replace pppoe-status with ifconfig iface
@T4L: thanks, nice tip .
@Louis: your command displays private IP address (internal), not external one
I had no issues with the wget command, but even simpler is this:
curl canhazip.com
cheers!
@notmyrealname
Yeah that works slick once I fix the typo of the site name! It looks like it would even work for a shellscript.