Go to TogaWare.com Home Page.
GNU/Linux Desktop Survival Guide
by Graham Williams
Google

No-IP


A Dynamic DNS service is provided by No-IP. After signing up for the free service, perhaps with a hostname of ktware.redirectme.net, you can install noip2. Then configure the daemon:

$ wajig reconfigure noip2
Username: kayon@togaware.com
Password: *******
Interval: 10
Host or Group: kayon.redirectme.net
Network devince name: <blank>
Disable NAT: No
Shutting down dynamic address update: noip2.

Auto configuration for Linux client of no-ip.com.

2 hosts and 1 group are registered to this account.
Host kayon.redirectme.net selected.

New configuration file '/var/lib/noip2/noip2.conf' created.

Starting dynamic address update: noip2.

Using no-ip we configure the daemon with:

$ sudo no-ip -C

Auto configuration for Linux client of no-ip.com.

Please enter the login/email string for no-ip.com  kayon@togaware.com
Please enter the password for user kayon@togaware.com'    ********

1 host registered to this account.
Do you wish to have host [ktware.redirectme.net] updated?[N] (y/N)  y
Please enter an update interval:[30]  
Do you wish to run something at successful update?[N] (y/N)  

New configuration file '/etc/no-ip.conf' created.

$ wajig start no-ip

This is now setup and operating.

Previous to the no-ip (and then the noip2) package becoming available in Debian you would download the noip2 client that you run on your local machine. The following refers to this approach for running no-ip.

With appropraite setup this can run as a daemon and will forward your IP address to the DNS server to update your symbolic name for your host. The client can also automatically identify if your host is sitting behind a router and will do the right thing, by getting the IP address stored in the router (rather than the IP address of your host which is probably something like 192.168.0.2).

To get the client:

  $ wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz
  $ tar xvf noip-duc-linux.tar.gz
  $ cd noip-2.1.7/
  $ make

To test things as a normal user, create a local configuration:

  $ ./noip2 -c CONFIG -C

We are asked to enter the no-ip username and password, and there is also an option to run a command each time it is successfully updated.

Then you can manually update the server with:

  $ ./noip2 -c CONFIG -i <ipaddress>

Then try it out (may take a little time to propagate for some hosts -- my ANU machine takes up to 30 minutes but my home desktop is immediate):

  $ ping ktware.redirectme.net

It should get your IP address.

Then you can set it up as a daemon as root, using the supplied Debian script to stop and start the daemon. As root, compile the client as above, then do an install:

  # make install

You will be asked to supply your No-IP username (the email address you supplied on signing up) and password. The default update interval is 30 minute, but you can change it if you like (I use 5 minutes). The configuration file will be /usr/local/etc/no-ip2.conf

You can now simply run noip2 as root and, as a daemon, it will update the server. With option -S all currently running daemons will be listed. To kill one of the daemons use the -K option.

To run the daemon automatically when the machine is booted place the following script into /etc/init.d/noip2:



#! /bin/sh
# /etc/init.d/noip2

# Supplied by no-ip.com
# Modified for Debian GNU/Linux by Eivind L. Rygge <eivind@rygge.org>

# . /etc/rc.d/init.d/functions  # uncomment/modify for your killproc

DAEMON=/usr/local/bin/noip2
NAME=noip2

test -x $DAEMON || exit 0

case "$1" in
    start)
    echo -n "Starting dynamic address update: "
    start-stop-daemon --start --pidfile /var/run/noip2.pid \
        --make-pidfile --exec $DAEMON
    echo "noip2." 
    ;;
    stop)
    echo -n "Shutting down dynamic address update:"
    start-stop-daemon --stop --pidfile /var/run/noip2.pid \
        --oknodo --retry 30 --exec $DAEMON
    echo "noip2." 
    ;;

    restart)
    echo -n "Restarting dynamic address update: "
    start-stop-daemon --stop --pidfile /var/run/noip2.pid \
                            --oknodo --retry 30 --exec $DAEMON
    start-stop-daemon --start --pidfile /var/run/noip2.pid \
                            --exec $DAEMON
    echo "noip2." 
    ;;

    *)
    echo "Usage: $0 {start|stop|restart}"
    exit 1
esac
exit 0

Make sure it is executable:

  # chmod a+rx /etc/init.d/noip2

Now you can start the daemon and check that it is running:

  $ wajig start noip2
  $ sudo noip2 -S
  1 noip2 process active. 

  Process 7065, started as noip2
  Using configuration from /usr/local/etc/no-ip2.conf
  Last IP Address set 230.127.57.182
  Account kayon.toga@togaware.com
  configured for:
          group ktware
  Updating every 30 minutes via /dev/eth0 with NAT enabled.

To have the daemon start and stop at boot and shutdown time create the following symbolic links:



  $ cd /etc/rc2.d
  $ sudo ln -s ../init.d/noip2 S95noip2
  $ cd /etc/rc0.d
  $ sudo ln -s ../init.d/noip2 K05noip2

Copyright © 1995-2008 Togaware Pty Ltd
Support further development through the purchase of the PDF version of the book.
Brought to you by Togaware.