Howto get your external IP address via command line

September 28, 2013

I just had to find out the external IP address (as seen from the Internet) of a Linux server which is behind a NAT router. The normal way to goto WhatsMyIP didn’t work as I was only connected via SSH to this server.  But the solution is quite easy thanks to the guys from ipecho, just type:

wget -O - -q ; echo

Thats so easy! And even faster than using a browser in the first way ….. 🙂


RSS feed for comments on this post. TrackBack URI

  1. Why not just:

    Comment by Craig — September 28, 2013 #

  2. After I discovered I totally stopped using other similar sites. It helps to remember the URL that it is named after a unix utility.

    IIRC if not specified it will use the User-Agent field to format the response. So you don’t even have to specify plaintext. Example:


    Comment by Henrik — September 29, 2013 #

  3. I never heard about it before. great alternative 🙂

    Comment by Monika — October 9, 2013 #

  4. @Henrik

    Relying on the site’s interpretation of the User-Agent sounds seriously dangerous, if you’re going to use that in an application or some automated script.

    So in that regard is A LOT safer.

    Comment by Mario — February 9, 2014 #

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Powered by WordPress
Entries and comments feeds. Valid XHTML and CSS. 39 queries. 0.094 seconds.