Never Ending Security

It starts all here

Public IP from Command Line Cheatsheet

Public IP From Command Line

How can you detect the public (or WAN) IP address assigned to the NAT router from command line?

First you will need to install curl since we are gonna rely on an external web server to get the public IP address.

On Debian, Ubuntu or Linux Mint:

$ sudo apt-get install curl

You can use the following is a list of commands to determine your public IP address. You can use them ‘as-is’, you can define an alias to a command or use them in your shell scripts.

$ curl ifconfig.me
$ curl icanhazip.com
$ curl ident.me
$ curl ipecho.net/plain
$ curl whatismyip.akamai.com
$ curl tnx.nl/ip
$ curl myip.dnsomatic.com
$ curl ip.appspot.com
$ curl ip.telize.com
$ curl curlmyip.com
$ curl -s checkip.dyndns.org | sed 's/.*IP Address: \([0-9\.]*\).*/\1/g'

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s