jeffchannell.com

Update no-ip Behind A Router

Posted in Linux
2009-05-23 19:02:21 +0000 UTC

My mom isn't very computer literate, and I dreaded the thought of having to clean up malware on a monthly basis, so I set her up with an Ubuntu install, which did what she needed: simple word processing, scanning & printing photos, and web browsing. With only a rudimentary knowledge of Windows, she had a penchant for calling me to help her do things she didn't know how to do. Eventually I decided it would be best to have remote access, so I could just share her screen and show her how to do whatever it was she was trying to do (instead of having her explain what was on the screen). The problem I found was her service provider, like most, assigned her a dynamic ip address. Also, her router didn't have any support for no-ip.org. What I ended up doing is posting a tiny PHP script to my site that outputs the ip address of the visitor:

<?php echo $_SERVER['REMOTE_ADDR']; ?>

Then, I installed the no-ip.org update program, and sudo added this to mom's crontab:

/usr/local/bin/noip2 -i `lynx -dump http://jeffchannell.com/ip.php | sed '/^$/d' | sed 's/^[ \\t]*//;s/[ \\t]*$//'` > /var/log/noip2-last 2>&1

Take notice that I'm piping the output of lynx through sed to strip blank lines, as well as trim whitespace. Also, it's not very robust, as there is no error handling or anything.

Feel free to grab your ip address here, but please don't hammer it or I'll have to take it down.