Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save luiscbr92/0baec606a2446b45b684aa34b9483882 to your computer and use it in GitHub Desktop.

Select an option

Save luiscbr92/0baec606a2446b45b684aa34b9483882 to your computer and use it in GitHub Desktop.
Install No-IP DUC on Raspberry Pi and start it on boot

How to install No-IP on Raspberry Pi

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 noip

Then 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-1

⚠️ Watch out for possible updates that might change the version number in the last command. Just check the name of the folder prior the last command by listing the directory with ls

Now we install the software:

sudo make
sudo make install

After 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

How to make the DUC run on boot

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 INFO

Finally 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.

Bibliography

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


Written with ❤️ by Luis Alberto Centeno Bragado (@luiscbr92) on 04.07.2021
@masterbanger
Copy link

Thanks for the write up, very helpful.

FYI you have a typo, cd instead of cp

sudo cd debian.noip2.sh /etc/init.d/noip2.sh

sudo cp debian.noip2.sh /etc/init.d/noip2.sh

It might confuse someone :)

Thanks

yeah that someone is me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment