Find out your router’s external IP address using the Linux command line

By | August 15, 2009

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

9 thoughts on “Find out your router’s external IP address using the Linux command line

  1. Pingback: Twitted by papyromancer

  2. Pingback: «? ? Ubuntu» » ??? ?????? ??????? IP ?? ????????? ?????? Linux

  3. Pingback: CLI command finds router External IP « Linux & Stuff

  4. Pingback: Bash script for Sitelutions.com dyndns | Leave a Penny, Take a Penny

  5. Louis

    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

    Reply
  6. notmyrealname

    I had no issues with the wget command, but even simpler is this:

    curl canhazip.com

    cheers!

    Reply
  7. Anonymous

    @notmyrealname
    Yeah that works slick once I fix the typo of the site name! It looks like it would even work for a shellscript.

    Reply
  8. Nashua2823

    Hi,

    How would you have that text file containing the ip address emailed say every hour?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *