This Gist will guide you on how to install the No-IP DUC (Dynamic Upadate client) on a RaspberryPi and to automatically start it on boot. For this I am going to use a RaspberryPi 4B 2GB, but I have already done the same on a RaspberryPi 3B. I am going to use Raspberry Pi OS.
As a prerequisite you should register on https://no-ip.com and create the host entry that will be used later with your Pi.
First thing is to open a Terminal and create a directory to work with during the installation.
mkdir noip
cd noipThen we download the No-IP DUC itself, which comes as a tar.gz compressed file. We decompress the file and move to the folder containing the decompressed files.
wget https://www.noip.com/client/linux/noip-duc-linux.tar.gz
tar vzxf noip-duc-linux.tar.gz
cd noip-2.1.9-1ls
Now we install the software:
sudo make
sudo make installAfter the second command we will be asked for our No-IP credentials and then we will have to select the host name to be used for the updates. Finally we have to choose the time interval for the updates in minutes. I usually choose to update it every 15 minutes.
After the installation is done, we have to start the DUC daemon.
sudo noip2
To check that the service is running, we can use the following command:
sudo noip2 -S
The problem now is that in case that something makes our Pi run, the DUC will not run automatically. You can check this by rebooting the Pi and running the last command again.
To install the DUC as a service to be run at boot time, we should locate the file debian.noip2.sh which is in the directory where we made the installation, which should be noip/noip-2.1.9-1. Then we copy it to /etc/init.d/noip2.sh and change its owner and give it permission to be run.
sudo cd debian.noip2.sh /etc/init.d/noip2.sh
cd /etc/init.d/
sudo chown root.root noip2.sh
sudo chmod +x noip2.sh
Now we edit (as root) the noip2.sh file with our favourite editor to add the init info headers. We should insert the following lines between after the second line:
### BEGIN INIT INFO
# Provides: noip2.sh
# Required-Start: $remote_fs $local_fs
# Required-Stop: $remote_fs $local_fs
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: No-IP DUC
# Description: Updates the configured NoIP hosts with the current public IP
### END INIT INFOFinally we update the our rc.d files, which are the script that are responsible to start, stop and restarting the daemons when we boot, restart or shutdown our device. We do this with the following command:
sudo update-rc.d noip2.sh defaults
To check that everything is working as we planned, we just have to reboot our Pi and run sudo noip2 -S and see if there is any noip2 process running.
The above article is based on the following documentation:
How to Install the No-IP DUC on Raspberry Pi
Rasbperry – NO-IP configuration to be ran at boot time
yeah that someone is me