Tuesday 15 April 2014

Install NO IP Update Service on Raspberry Pi

Install the No-IP client The next step is downloading and installing the No-IP client that will update your DNS with your dynamic IP. Note, if you have several machines all behind the same external IP then you really only need to install the No-IP client on one of your servers. So we'll run a few commands to download the client, unpack it, build it, and install it. wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz tar xzf noip-duc-linux.tar.gz cd noip-* sudo make sudo make install Upon running the final command you should be presented with some configuration questions. The first two will ask you for your No-IP username and password. After you've entered your credentials the installer will tell you how many hosts (domains/subdomains) you have available and if you'd like to update them all. If you select No it will go through each host and allow you to pick which ones you'd like to update. After you've made your selections it will ask for an interval (in minutes). This controls how often the service will check to see if your IP has changed. 30 is a good default value, if you know that your IP changes more frequently then you may want to lower this value. The final question will ask you if you'd like to run a program upon completing a DNS update. Most people can go ahead and say No here. Now we just need to create an init script that will automatically start the service when Debian boots. As root, copy the following bash script and save it to /etc/init.d/noip2. ####################################################### #! /bin/sh case "$1" in start) echo "Starting noip2." /usr/local/bin/noip2 ;; stop) echo -n "Shutting down noip2." killall -q -TERM /usr/local/bin/noip2 ;; *) echo "Usage: $0 {start|stop}" exit 1 esac exit 0 ####################################################### Next we need to modify the permissions on the script so that it's executable and add the service. sudo chmod 755 /etc/init.d/noip2 sudo update-rc.d noip2 defaults Go ahead and restart your installation and the No-IP service should now be running. Port Forwarding One more important thing to note is that if your servers aren't directly mapped to an external IP, meaning they have a local address (e.g. 192.168.x.x) and pass traffic through a router, then you'll need to setup port forwarding on your router so that the proper traffic makes its way to your appropriate servers. Note, you only need to setup port forwarding if you want your server(s) to be available via the internet. Here are some common ports you may need to forward for certain functions. TCP port 53 (DNS) - If you run an authoritative nameserver you'll need this TCP port 25 (SMTP) - Required for a mail server, the server receives mail on this port TCP port 80 (HTTP) - Required for a web server, allows you to serve web pages TCP port 143 (IMAP) - Required if you want to download your mail from your server over the internet using a desktop client like Thunderbird or Outlook TCP port 443 (HTTPS) - Required if you want to serve secure web pages using SSL

Amazon

Donate

Donate Towards More Raspberry PI's for Projects