DDNS NOIP.com 設定 karl_kao@yahoo.com / giga1144 hckaopi3.ddns.net https://www.youtube.com/watch?v=8xp4kkbsZi0&feature=youtu.be http://projpi.com/raspberry-pi-tips-and-hacks/raspberry-pi-2-on-dynamic-ip-and-noip/ http://unix.stackexchange.com/questions/199178/run-automatically-noip2-when-the-machine-is-booted To install the DUC on the Raspberry Pi, Enter the following commands at the terminal : “sudo mkdir /home/pi/noip ” ( Create a folder for noip’s DUC) “cd /home/pi/noip” (Change working folder to the new folder just created) “sudo wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz” (Download the Software) “sudo tar vzxf noip-duc-linux.tar.gz” (Extract the downloaded software) “ls” (to show the newly folder created by extracting the archive) “cd noip-2.1.9-1” (Change working directory to noip-2.1.9-1 or what ever is the newly created folder by the step above) You will now need to compile and install the downloaded DUC by entering : sudo make sudo make install (during the install process you will need to enter your email and password that you created at noip.com) the Dynamic Update client is started by running “sudo /usr/local/bin/noip2” . The DUC service will now run until the Pi is shutdown. To make the DUC startup automatically and run in the back ground, We will need write a small script that will execute at startup. “sudo nano /etc/init.d/noipscript” (use nano the word editor to create a file called noipscript) Enter the following lines into nano : #! /bin/sh ### BEGIN INIT INFO # Provides: noip2 # Required-Start: $syslog # Required-Stop: $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: noip.com client service ### END INIT INFO # . /lib/lsb/init-functions case "$1" in start) echo "Starting noip2." /usr/local/bin/noip2 ;; stop) echo "Shutting down noip2." killall noip2 #killproc /usr/local/bin/noip2 ;; *) echo "Usage: $0 {start|stop}" exit 1 esac exit 0 To exit nano, press ctrl+x and Y to save changes to the file. We will now need to make the script executable by changing its permissions and update the rc.d scripts by entering : sudo chmod +x /etc/init.d/noipscript sudo update-rc.d noipscript defaults ---------------------------- sudo crontab -e (choose your favorite text editor if prompted) Add this line at the bottom of the file... @reboot su -l && sudo noip2 Now the Dynamic Update Client of No-ip should start everytime your Pi starts up and update your IP address. You will need to configure your Home Router to port forward the relevant port to your PI. i.e., If you are hosting a website, you will want to forward Port 80 and Port 443 to the IP address of the Pi. 路徑 pi@raspberrypi:/usr/local/etc $ sudo cat no-ip2.conf pi@raspberrypi:/usr/local/bin $ ls noip2 pi@raspberrypi:/usr/local/bin $ sudo noip2 -S 1 noip2 process active. Process 485, started as noip2, (version 2.1.9) Using configuration from /usr/local/etc/no-ip2.conf Last IP Address set 1.160.32.131 Account karl_kao@yahoo.com configured for: host hckaopi3.ddns.net Executing username=karl_kao%40yahoo.com&pass=giga1144&h[]=hckaopi3.ddns.net upon successful update. Updating every 30 minutes via /dev/eth0 with NAT enabled.