2017年7月22日 星期六

[Tips] 使用 DynDNS 連回自己的電腦

1. 先使用 10 minute mail 註冊一個 noip 帳號, 要記得帳號密碼

2. 然後下載原始碼後編譯
$ cd ~
$ wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz
$ tar xf noip-duc-linux.tar.gz
$ cd noip-2.1.9-1/
$ sudo make install

接著就會問你問題, 參考如下
if [ ! -d /usr/local/bin ]; then mkdir -p /usr/local/bin;fi
if [ ! -d /usr/local/etc ]; then mkdir -p /usr/local/etc;fi
cp noip2 /usr/local/bin/noip2
/usr/local/bin/noip2 -C -c /tmp/no-ip2.conf

Auto configuration for Linux client of no-ip.com.

Multiple network devices have been detected.

Please select the Internet interface from this list.

By typing the number associated with it.
0    eth0
1    eth0
2    wlan0
3    eth1
3
Please enter the login/email string for no-ip.com  foo@bar.net
Please enter the password for user 'foo@bar.net'  *******

Only one host [foo.ddns.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)  y
Please enter the script/program name  foo

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

3. 啟動 client, 會重新註冊 IP
sudo /usr/local/bin/noip2

如果沒問題的話, 應該就可以從外部看到 foo.ddns.net 的結果了


reference:
* http://www.darwinbiler.com/dynamic-dns-using-raspberry-pi/
* http://www.awesomeweirdness.com/projects-diy/raspberrypi/setup-noip-client-raspberry-pi/

這篇寫得不錯, 應該會有兩個東西要設定, 另一個是把 DUC 當 service 跑起來
DUC Client 和 No-IP DUC Client service
* http://sizious.com/2017/04/30/how-to-properly-install-no-ip-dynamic-update-client-duc-under-raspbian/

備註; 如果在防火牆後面可以使用 dataplicity 這服務 

沒有留言: