finding my own ip

Peter Smerdon psmerdon-J4oS66wZXds at public.gmane.org
Thu Dec 27 15:52:05 UTC 2007


Hello Everyone and seasons greetings..

My job takes me on the road a lot, but I like to keep my server running
so I can ssh into it from anywhere I happen to be. This way my email and
newsgroups for example are all in one location. 

The problem is my IP address is dynamic and dsl, every few days it changes.
My isp (magma.ca) used to provide a webpage that I could see what my
current IP is but now that Primus bought them, this page has gone and I
have no way of knowing what my IP at home is.

My solution was to set a cron job to use curl and the website
`whatismyip.com' to email the IP address to my throwaway yahoo.ca
address.

,----[ crontab ]
| */60 * * * * /usr/bin/curl
|  http://www.whatismyip.com/automation/n09230945.asp >>
|  /home/peter/cronlog 2>&1 | mail -s my-ip petersmerdon-FFYn/CNdgSA at public.gmane.org
`----

This seems to work, once an hour I get an email in my yahoo inbox
containing my IP but I am wondering if there is a `proper' way to do
this? It just seems like a bit of a kludge to rely on an outside website.
I use a netgear wireless router at home which I cannot ssh
into directly, and ifconfig only shows ip's from my internal network so
I wasn't sure how else to find my internet address without using an
external service like that website.

thoughts?

-- 

Peter Smerdon
psmerdon-J4oS66wZXds at public.gmane.org
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list