What is my public IP | Linux

Written by Guillermo Garron .
Date: 2007-12-29 10:36:30 -0400

Lots of times you need to determine your public IP address, if you are using Linux operating system to power your PC, you may use some good console commands to guess your public IP address.

Most of these methods will return you the local IP and not the public IP of your proxy if you are behind one.


wget -q -O -|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'

That will return your local IP


curl -s|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'

That one is going to give your current IP, being it public or private. Something like running ifconfig or ip adds


That is going to return you the public IP you are using to access internet. If you are behind a NAT or proxy, it will the IP of that proxy.


lynx -dump | grep 'IP Address'

That is also going to return your public IP.

As you can see, there are a lot of ways to check your Public IP address using console commands in Linux. Of course you can always open a browser and enter any of those URIs and check there.


If you enjoyed the article, please share it

twitter | facebook | google+ | linkedin | email | reddit

comments powered by Disqus



My name is Guillermo Garron. I am telecommunications engineer from Bolivia

I like technology a lot, and this site is mainly dedicated to that

Social feeds

rss | twitter | email | google+

Posts via email

If you use the letter icon above and subscribe to my tinyletter newsletter, you will get one to two emails, related to this site, or not. If what you want is to get the posts of this site via email, use the form below

Enter your email address:

Delivered by FeedBurner