2020年5月8日

tinc VPN 試用心得


選擇用tinc的原因是因為官網的這句話.
Automatic full mesh routingRegardless of how you set up the tinc daemons to connect to each other, VPN traffic is always (if possible) sent directly to the destination, without going through intermediate hops.
不過到我架設起來為止並沒有成功的建立起P2P的連線. 反而是ZeroTier 成功了, 而且ZeroTier不用自己架Server, 滿方便的.

Install
Debian Linux: sudo apt install tinc
Windows: 官網載點
tinc架設方式, 把sun-moon兩台windows 作VPN連線, moon 可以遠端桌面到sun這台PC上.
Server & Client所需的設定檔基本上是一樣的, key 在3台設備都要有
server client1 client2
tinc.conf tinc.conf tinc.conf
tinc-down rsa_key.priv rsa_key.priv
tinc-up hosts/main hosts/main
rsa_key.priv hosts/client1 hosts/client1
hosts/main hosts/client2 hosts/client2
hosts/client1    
hosts/client2    

設定
Windows可參考 官方教學windows-install

測試
client1(192.168.100.100) ping Server (192.168.100.1), latency 194ms
client2(192.168.100.101) ping server (192.168.100.1), latency  198ms
client2(192.168.100.101) ping client1 (192.168.100.100) , latency 394 ms
基本上就是透過server relay 封包的時間( client1 to server + server to client2). 
雖然client1 可以看到 client2 外部ip 地址 (而非server), 但P2P似乎沒有生效. 


Note1. 實際上client1 & Client2 都是在同一個地區, Server架在美國, 點對點 ping 值應為12ms
Note2. ZeroTier 後來在sun(北部)和moon(中部)試了一下 ,結果也失敗了, ping 值有兩種, 在129ms或327ms 左右. 而且有時會斷斷續續的, 不太穩定.

References


coap-client 4.3.0 Windows build

coap-client  is a  wget -like tool to generate simple requests for retrieval and modification of resources on a remote server.  Got the sour...