Keeping your domain name updated
To easily be able to access the services on the router from the Internet, it's important that the domain name is constantly updated with your current external IP address whenever it changes. In the FreeBSD Ports Collection there is a small client called Ipcheck that you can run with a crontab job to accomplish this automatically. If you have a static IP address, this is of no concern to you and you can skip this guide.
First compile the client:
# cd /usr/ports/dns/ipcheck # makePython programming language and you will be given the opportunity to change its compilation options. The defaults are fine so simply highlight OK and press Enter. Python will take a while to compile but it's a popular script language these days and it doesn't hurt to have it installed. If no errors are reported, you can install the compiled binaries.
# make install clean
You have to run Ipcheck manually once to create the configuration file that will store your DynDNS username and password. In the command below, make sure you exchange userid and password for your own. The interface listed should be the name of your router's external interface and the domain must of course be the one you are using yourself.
# cd /usr/local/etc # /usr/local/bin/ipcheck.py --makedat -w -l -i em1 userid password pp.dyndns.biz ipcheck.py: pp.dyndns.biz good 18.104.22.168 -update successful
Edit root's crontab.
# setenv EDITOR ee # crontab -e
Add the following line to crontab to have Ipcheck run automatically once every minute. It isn't possible to run anything more frequent than that when using cron and care should be taken when deciding what jobs to run this often. Ipcheck will only make an update if it finds that the IP address has changed since the last time it checked. It will also force an update after 25 days to prevent your domain from becoming removed from DynDNS.
* * * * * cd /usr/local/etc ; /usr/local/bin/ipcheck.py -w -l -i em1 userid password pp.dyndns.biz
As before you make sure the external interface, userid, password and domain match your own.