Introduction to Linux - A Hands on Guide | Linux Bible | Linux From Scratch | A Newbie's Getting Started Guide to Linux | Linux Command Line Cheat Sheet | More Linux eBooks



Thursday, 23 January 2014

How To : Determine Your Public IP Address From Terminal

how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal, how-to-determine-your-public-ip-address-from-linux-terminal,

     Most of the machines in various institutes and organizations are set up behind a NAT router and thus, they are allocated with a private IP address, either manually or by the DHCP server.To the outer world, your (public) IP address is same as that of the NAT router. There are many techniques with which you can detect the public IP address of your machine. This mini-article will be helpful to you to know the public IP address of your NAT router using Terminal.

    You would be taking help of an external web server in order to detect your public IP address. So, make sure that your system is connected to internet. As you are dependent on that particular web server, you need to have curl installed in our system.

If you don't have curl installed, just enter following command:

For Ubuntu, Linux Mint or other Debian based systems:

sudo apt-get install curl

For Fedora, CentOS or other RHEL based systems:


sudo yum install curl

    Once this is done, you can use any of the following commands listed below to get your public IP address. You can run them in terminal or you can also use them in bash scripts. Here is the list:

curl ident.me
curl ifconfig.me
curl tnx.nl/ip
curl icanhazip.com
curl ipecho.net/plain
curl ip.appspot.com
curl whatsmyip.akamai.com

So Simple !!

10 comments:

  1. You can also use http://ifconfig.me/. They offer also more details and are straight forward.

    ReplyDelete
  2. Nice information. I had checked my External ip address using this site IP-Details.com

    ReplyDelete
  3. Great job...very helpful! You can also use ipchicken.com

    ReplyDelete
  4. vote for ident.me, easy to remember, highest speed in responding !

    ReplyDelete
  5. indent.me didn't work with me. The rest worked perfectly

    ReplyDelete
  6. This works really well... but /how/ does it work?

    ReplyDelete
  7. Curl makes HTTP request to a service which will then send you the IP back from which it got the request.

    ReplyDelete