Wednesday, March 16, 2011

Your IP addresses in Gnome panel with Giplet

This is quite an old Gnome panel applet but I didn't hear about it until today when I found this post (in Portuguese).
It's very easy to install and place in your panel (I'm using Ubuntu 10.10). I just installed with

sudo apt-get install giplet

and then added to the panel in the usual way.
Now giplet offers the option to display either the internal IP of your computer (something like 192.168.x.y) or the external IP of your router which will apply equally to all computers on your LAN.
Preferences for giplet (rightclick on applet and then click on Preferences) shows an Interface(s) box. By default this contains the following
eth0 wlan0 www.whatismyip.org

Apparently, giplet searches each of these in the order shown and displays the first IP it finds.
So, if wired interface to your computer is indeed eth0, this computers internal IP will be displayed. If your connection has a different name, just edit the interface(s) box appropriately.
On the other hand, if you want to display your external IP (as I did), just delete "eth0 wlan0" from the interface(s) box and rely on www.whatismyip.org.
Problem is that www.whatismyip.org is, and has been for years, offline.
It seems that giplet had been using another url for this purpose more recently called www.getmyip.org but, that too, is currently offline.
As I really wanted BOTH internal and external IPs displayed in my panel (by adding the applet twice), I trawled through google looking for a url that actually provides my external IP.
Note that I used the curl command to test every candidate
$ curl www.candidate-url.com

and I eventually found one that worked with the name www.icanhazip.com
Once I had included this in the interface(s) preferences box, my external IP appeared alongside of my internal IP in the gnome panel.

No comments:

Post a Comment