迁移
移动三个可执行文件外的配置文件
使用zerotier-idtool正常生成moon
cd /var/lib/zerotier-one
zerotier-idtool initmoon identity.public > moon.json
### Edit stableEndpoints
vim moon.json
zerotier-idtool genmoon moon.json
moon.json示例,将SERVER_IPV4/6、SERVER_PORT等更换为实际的IP和端口,IPV6不需要带引号,注意需开放对应的UDP端口
{
"id": "1111111111",
"objtype": "world",
"roots": [
{
"identity": "1111111111:0:11111111111111111111...",
"stableEndpoints": [ "SERVER_IPV4/SERVER_PORT","SERVER_IPV6/SERVER_PORT" ]
}
],
"signingKey": "111111111111111111111111111111...",
"signingKey_SECRET": "111111111111111111111111111111...",
"updatesMustBeSignedBy": "111111111111111111111111111111...",
"worldType": "moon"
}
使用kmahyyg/ztncui-aio项目,启动并进入容器,使用原有的previous.c25519
和current.c25519
生成world.bin
,即为新的planet
cd /var/lib/zerotier-one
### Move old configs to current dir
./mkworld -j
planet机器的local.conf
,其中ZT_PORT
对应moon.json
中的SERVER_PORT
:
{
"settings": {
"secondaryPort": ZT_PORT
}
}
tcp relay
使用zerotier/pylon搭建tcp relay,将下面的RELAY_IP
和RELAY_PORT
更换为实际的IP和端口,注意需要开放对应的TCP端口
services:
ztpylon:
image: zerotier/pylon:latest
ports:
- RELAY_PORT:443
在客户端编写local.conf(Windows下一般在C:\ProgramData\ZeroTier\One\local.conf
;Linux下一般在/var/lib/zerotier-one/local.conf
)
{
"settings":{
"tcpFallbackRelay":"RELAY_IP/RELAY_PORT"
}
}
参考:
TCP Relay | ZeroTier Documentation
Views: 4