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
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
Pingback: Twitted by papyromancer
Pingback: «? ? Ubuntu» » ??? ?????? ??????? IP ?? ????????? ?????? Linux
Pingback: CLI command finds router External IP « Linux & Stuff
Pingback: Bash script for Sitelutions.com dyndns | Leave a Penny, Take a Penny
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.
Hi,
How would you have that text file containing the ip address emailed say every hour?