I love this site. By incorporating many past hints, I've developed a simplistic "poor man's" way of getting remote access to a Mac that is behind a router on a dynamic DSL account. Let's say you want to have remote access to your Mac - secure telnet and FTP access for example. If you are like me, you have the following problems:
While the "ifconfig -a" command works great for the local IP address, it doesn't give me the router's IP address to the outside world. However, there is a web-site that provides this service (which I found in a comment at MacOSX Hints). Going to http://checkip.dyndns.org gives you the WAN IP address. The "curl" command allows us to save this page to a file.
Next, we need a convenient place to post this file so you can look-up the current IP address to your computer. The Sites folder in your iDisk will work perfectly. You'll be able to look-up your IP address with a web-browser.
Finally, we need a way to have this file updated on a regular basis. We'll use the "cron" program that was explained a while ago on this site.
Okay, create the following file anywhere in your Home folder:
# $NetBSD: crontab,v 1.13 1997/10/26 13:36:31 lukem Exp $Those are TABS, not spaces. Replace "iDisk_name" with whatever your iDisk is called when mounted. Replace "myip1234.html" with whatever you wish to call the file. If you don't wish to have your IP address advertised, I reccomend you give it a cryptic name--and don't post the link on your web-page ;-). This is set to update the file at the top of every hour. If you like, you can make it update every 30 minutes by replacing "0" with "*/30". Save the file as "mycrontab" or something similar.
#
# ~/Unix/crontab - my crontab
#
SHELL=/bin/sh
PATH=/bin:/sbin:/usr/bin:/usr/sbin
HOME=/var/log
#min hour mday month wday command
0 * * * * curl http://checkip.dyndns.org>/Volumes/iDisk_name/Sites/myip1234.html
crontab mycrontabThat's it! From here on you can view the IP address of your remote machine by browsing to http://homepage.mac.com/iDisk_name/myip1234.html or whatever you named the .html file.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20011114214229220