zerotier.is
AdLuoboyunAn account comes with 1 GB of trial traffic for 24 hours, used with Clash / MihomoPays by Alipay, WeChat, cryptoGet the trialLuoboyun: 1 GB on registrationFor 24 hours, Alipay / WeChat / cryptoGet the trialAd
  1. Home
  2. How to
  3. Your own moon and relay

Your own moon and relay

Run a moon on a public server: make the file, open the port, orbit from clients; a TCP relay with pylon where UDP is blocked; limits on phones.

Your own relay brings connections closer and steadier
Your own relay brings connections closer and steadier ROmas, Public domain

Who does what

JobUseful when
Official rootsIntroduce devices, forward if neededAlways there
MoonYour own root, nearer to youThe official ones are far
TCP relayStands in when there is no UDPA company blocks UDP

Making a moon

You need a server with a public IP and UDP 9993 open.

On the server
cd /var/lib/zerotier-one
sudo zerotier-idtool initmoon identity.public | sudo tee moon.json

In moon.json set stableEndpoints to ["PUBLIC_IP/9993"], then:

Generate and place it
sudo zerotier-idtool genmoon moon.json
sudo mkdir -p moons.d && sudo mv 000000*.moon moons.d/
sudo systemctl restart zerotier-one

Clients

Computers and servers
sudo zerotier-cli orbit MOON_ADDRESS MOON_ADDRESS
sudo zerotier-cli listmoons

The official Android and iOS apps have no place for it; requests 1604 and 2351 are still open.

TCP relay

Without UDP the built-in TCP relay is slow. You can run your own with the official pylon:

A public server with Docker
docker run --init -d -p 443:443 -p 9993:9993/udp zerotier/pylon:latest reflect

In the client's local.conf:

local.conf
{ "settings": { "tcpFallbackRelay": "SERVER_IP/443", "forceTcpRelay": true } }
A moon, and still relayed?

A moon introduces and forwards; whether a direct path opens depends on both NATs, see this post.

Do without the official servers entirely?

Not by adding a moon; the official roots stay listed. It was asked in 2017 and there is no ready switch.

Up nextYour first network in five steps

Pages nearby

Marks: ZeroTier Moon setup, ZeroTier relay server, zerotier-idtool initmoon