How to grab you external IP in the bash shell

4 04 2013

Just for the record: I was wondering what command line tool would display my external IP address while surfing the internet. Actually I want to refine my servers security settings and block out IPs for incoming traffic which I would not use. Instead of doing this systematically I want to just list some IPs at different computers I use.

It appears you need some script (PHP, JAVA, etc) to do the job on an external host. Many “whatsmyip”-like websites produce a lot of unwanted noise around the information, but tonight i stubled over which simply displays the IP, so here it goes:

wget -O - -o /dev/null



Just tonight i stumbled over





Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your 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

%d bloggers like this: