Compile and Install No-IP on Raspberry Pi and Run it at Startup

 
PhDDNS was down in middle of August, and I had to use No-IP instead, and here I share some experience with you guys here:
No-IP is a Dynamic DNS service provider, whose counterpart in China is PhDDNS. Users can access remotely their devices running No-IP client without knowing the IP addresses of their devices.

After getting a free user account on No-IP official website, apply for a free domain name, and we can move forward:
 

Compile and install noip2

 
Type the following command lines in Terminal to compile and install No-IP Dynamic Update Client:
 

cd /usr/local/src/
wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz
tar xf noip-duc-linux.tar.gz
cd noip-2.1.9-1/
make install

 
The script will then setup a configuration file interactively, just answer the following questions:
 

Please enter the login/email string for no-ip.com:

Please enter the password for user:

Please enter an update interval: [30]
(Increments in minutes that you want no-ip client to check if your router’s external dynamic IP address has changed and updates it accordingly.)

Do you wish to run something at successful update? [N] (y/N)

 
The install script will move compiled client of noip2 to the directory /usr/local/bin/, and generate a file no-ip2.conf in the directory /usr/local/etc/. This file contains your login ID and password to noip.com. Do not worry, because it is encrypted.
 

Run noip2 client at startup

 
No-IP DUC is not going to start with the system boots, we can add a script to make it start automatically. Type the following command in Terminal:

nano /etc/init.d/noip2

The scripts below was altered by me and it works with no problem, just enter them and save the file:

#!/bin/sh
### BEGIN INIT INFO
# Provides:          noip2
# Required-Start:    $remote_fs $network
# Required-Stop:     $remote_fs $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start/stop noip2.
### END INIT INFO
case $1 in
    start)
		/usr/local/bin/noip2 -c /usr/local/etc/no-ip2.conf -d
		;;
    stop)
		killall noip2
		;;
*)
echo "Usage: $0 (start|stop)"
;;
esac

 
We need to update rc.d after the script is edited:

sudo update-rc.d noip2 defaults

 
In case you change your password to noip.com, use this command to re-configure the file no-ip2.conf:

/usr/local/bin/noip2 -C

 
Reference:
How to Install the Linux Dynamic Update Client on Ubuntu
 


已发布

分类

, , ,

来自

标签:

评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注