参考 视频: 内网穿透工具ZeroTier,从简单到复杂的玩法,无保留,一期全放送
视频网盘备份: 内网穿透工具ZeroTier,从简单到复杂的玩法,无保留,一期全放送
搭建教程从视频的11分开始
ZeroTier: ZeroTier | Global Networking Solution for IoT, SD-WAN, and VPN
Key Networks: Key Networks
GitHub项目: 一分钟私有部署zerotier-planet服务
搭建流程 moon搭建
放行服务器9993(TCP/UDP)端口,TCP/UDP都要放行
1 2 3 4 curl -s https://install.zerotier.com | sudo bash Success! You are ZeroTier address [ 7777777777 ].
1 2 cd /var/lib/zerotier-onezerotier-idtool initmoon identity.public >>moon.json
1 2 3 4 nano moon.json "stableEndpoints" : ["1.1.1.1/9993" ,"2606:4700:4700::1111/9993" ]
1 2 3 4 zerotier-idtool genmoon moon.json wrote 0000000000000000.moon (signed world with timestamp 1111111111111)
1 mkdir /var/lib/zerotier-one/moons.d
1 cp 0000000000000000.moon ./moons.d/
1 systemctl restart zerotier-one
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 zerotier-cli orbit 7777777777 7777777777 systemctl restart zerotier-one.service zerotier-cli join 6666666666666 (将服务器加入内网保证安全) zerotier-cli peers zerotier-cli.bat orbit 7777777777 7777777777 zerotier-cli.bat join 6666666666666 zerotier-cli.bat peers zerotier-cli.bat peers Linux:/var/lib/zerotier-one/moons.d/ Windows:C:\ProgramData\ZeroTier\One\moons.d\ MacOS:/Library/Application Support/ZeroTier/One/zerotier-one/moons.d/
节点控制器搭建
放行服务器3000/3443(TCP)端口,两个端口2选1,根据自己实际情况放行TCP协议。
1 2 3 4 5 6 7 8 9 10 11 12 13 curl -O https://s3-us-west-1.amazonaws.com/key-networks/deb/ztncui/1/x86_64/ztncui_0.8.14_amd64.deb dpkg -i ztncui_0.8.14_amd64.deb sh -c "echo ZT_TOKEN=`sudo cat /var/lib/zerotier-one/authtoken.secret` > /opt/key-networks/ztncui/.env" sh -c "echo HTTPS_PORT=3443 >> /opt/key-networks/ztncui/.env" sh -c "echo HTTP_ALL_INTERFACES=yes >> /opt/key-networks/ztncui/.env" sh -c "echo NODE_ENV=production >> /opt/key-networks/ztncui/.env" chmod 400 /opt/key-networks/ztncui/.envchown ztncui.ztncui /opt/key-networks/ztncui/.envsystemctl enable ztncui systemctl restart ztncui
访问 1.1.1.1:3000 进入WEB UI,将1.1.1.1替换为服务器ipv4
初始账号: admin
初始密码: password
卸载过程 1 2 3 4 5 6 7 8 9 10 11 12 13 14 sudo apt remove --purge ztncuisudo rm -rf /opt/key-networks/ztncui/etc/tlssudo rm -rf /opt/key-networkssudo apt autoremovedpkg -l | grep ztncui sudo dpkg -P zerotier-onesudo rm -rf /var/lib/zerotier-one