為了管理方便,所以在家裡的 Banana Pi M3 上加裝 no-ip2
因為套件庫中沒有 noip 套件,所以要自行編譯安裝
參考網站:
How To Install No-ip2 On Ubuntu 12.04 LTS In Order To Host Servers On A Dynamic IP Address
How to Install the Linux Dynamic Update Client on Ubuntu
1. 安裝編譯相關套件
# apt-get install build-essential checkinstall[@more@]2. 下載 no-ip2 官網程式
# cd /usr/local/src/
# wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz
3. 解壓縮
# tar xf noip-duc-linux.tar.gz
4. 切換目錄
# cd noip-2.1.9-1
5. 進行安裝
# make install
Please enter the login/email string for no-ip.com abc@ilc.edu.tw
Please enter the password for user ‘abc@ilc.edu.tw’ ***********
Only one host [bplinux.sytes.net] is registered to this account.
It will be used.
Please enter an update interval:[30]
Do you wish to run something at successful update?[N] (y/N) N
New configuration file ‘/tmp/no-ip2.conf’ created.
mv /tmp/no-ip2.conf /usr/local/etc/no-ip2.conf
設定檔位置:/usr/local/etc/no-ip2.conf
6. 建立開機啟動檔
# vim /etc/init.d/noip2
#! /bin/sh
### BEGIN INIT INFO
# Provides: no-ip2
# Required-Start: $local_fs $remote_fs $network $syslog $named
# Required-Stop: $local_fs $remote_fs $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop no-ip2
### END INIT INFO
case “$1” in
start)
echo “Starting no-ip2”
/usr/local/bin/noip2
;;
stop)
echo -n “Shutting down no-ip2”
for i in `noip2 -S 2>&1 | grep Process | awk ‘{print $2}’ | tr -d ‘,’`
do
noip2 -K $i
done
;;
*)
echo “Usage: $0 {start|stop}”
exit 1
esac
exit 0
7. 更改檔案執行權限
# chmod 755 /etc/init.d/noip2
8. 執行 no-ip2
# /etc/init.d/noip2 start
Starting no-ip2
# ps aux | grep noip2 | grep -v grep
nobody 1605 0.0 0.0 2036 628 ? Ss 05:12 0:00 /usr/local/bin/noip2
9. 設定開機時執行
# sed -i ‘/export/ an#Starting no-ip2…n/etc/init.d/noip2 start’ /etc/rc.local
或
# update-rc.d noip2 defaults
10. 如果不需要編譯套件也可以移除
# apt-get remove –purge binutils build-essential checkinstall cpp cpp-5 dpkg-dev fakeroot file g++ g++-5 gcc gcc-5 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan2 libatomic1 libc-dev-bin libc6-dev libcc1-0 libdpkg-perl libfakeroot libfile-fcntllock-perl libgcc-5-dev libgomp1 libisl15 libmagic1 libmpc3 libstdc++-5-dev libubsan0 linux-libc-dev make manpages manpages-dev patch