Operations 4 min read

How to Build a Private Virtual LAN with ZeroTier in Minutes

ZeroTier lets you create a peer‑to‑peer virtual network that bridges devices across different physical locations without a public IP, and this guide walks you through its core concepts, registration, network creation, client installation, joining, IP assignment, connectivity testing, and optional Moon relay setup.

Java Architecture Diary
Java Architecture Diary
Java Architecture Diary
How to Build a Private Virtual LAN with ZeroTier in Minutes

ZeroTier

Basic Concept

ZeroTier is a smart Ethernet switch for planet Earth.

In simple terms, ZeroTier is a peer‑to‑peer (P2P) network where the root server records request paths similar to DNS resolution. Its main function is to connect devices on different networks as if they were on the same LAN.

ZeroTier configures a virtual subnet, e.g.,

172.17.2.0/24

. Adding a device to this network lets it reach a company machine at

172.17.2.101

.

Key Terminology

PLANET: Root server of ZeroTier.

MOON: User‑deployed private root server that acts as a proxy for acceleration.

LEAF: Network client, i.e., each device that connects to the network.

Getting Started

1. Register

Visit https://my.zerotier.com/ to create an account.

2. Create a Network

3. Install Client on Target Machine

Linux

<code>curl -s https://install.zerotier.com | sudo bash</code>

Other operating systems

Download from https://www.zerotier.com/download/ .

4. Join the Created Network

<code>zerotier-cli join a0cbf4b62af33545 # 16‑digit network ID</code>
<code>200 join OK</code>

5. Approve Client Access

In the ZeroTier web console, open the network details and approve the client. Assign it a LAN IP, e.g.,

172.28.153.245

, which can be adjusted in the Advanced settings.

You can add other devices to the same network similarly.

6. Verify Connectivity

Check that the devices can ping each other.

Network is operational.

Extension

Because ZeroTier’s official servers are overseas, domestic clients may experience high latency or connectivity issues during peak times. Deploying a Moon relay server locally can act as a jump‑box to accelerate traffic between internal machines.

Refer to the official site https://www.zerotier.com for simple Moon setup instructions.

networkingVPNvirtual networkremote accessZeroTierMoon relay
Java Architecture Diary
Written by

Java Architecture Diary

Committed to sharing original, high‑quality technical articles; no fluff or promotional content.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.