ZeroTier 搭建 Moon 中转服务器

  • 云服务器开通 9993/UDP 端口
  • 进入 ZeroTier 官网,创建私有网络
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
28
29
# 安装ZeroTier
$ curl -s https://install.zerotier.com/ | sudo bash
$ zerotier-cli info
# 加入网络并授权
$ zerotier-cli join <NetworkID>
$ zerotier-cli listnetworks
# 配置Moon
$ cd /var/lib/zerotier-one
$ zerotier-idtool initmoon identity.public >> moon.json
$ vim moon.json
{
"id": "...",
"objtype": "world",
"roots": [
{
"identity": "...",
"stableEndpoints": ["x.x.x.x/9993"] # 公网IP
}
],
"signingKey": "...",
"signingKey_SECRET": "...",
"updatesMustBeSignedBy": "...",
"worldType": "moon"
}
$ zerotier-idtool genmoon moon.json
wrote xxx.moon
$ mkdir moons.d
$ mv xxx.moon moons.d
$ systemctl restart zerotier-one
  • 客户端安装 ZeroTier,加入网络
1
2
$ zerotier-cli listpeers
$ zerotier-cli orbit <MoonClientID> <MoonClientID> # moon.json里的ID值