ZeroTier Setup for Virtual Private Network (L2 Overlay)

When servers are scattered across different data centers and clouds, and legacy systems require a unified local network, conventional VPNs fall short. We configure ZeroTier to create an L2 virtual private network that merges your resources into a single segment. Our team delivers the project turnkey—from audit to implementation and ongoing support—ensuring a reliable and scalable infrastructure.

Our competencies:

Frequently Asked Questions

Latest works

  • Development of a web application for FEEDME
    Development of a web application for FEEDME
    1359
  • Development of an online store for the company FURNORO
    Development of an online store for the company FURNORO
    1330
  • B2B Advance company logo design
    B2B Advance company logo design
    776
  • Development of a web application for Enviok
    Development of a web application for Enviok
    1077
  • AIDER company logo development
    AIDER company logo development
    1022
  • CRM development for Chasseurs
    CRM development for Chasseurs
    1113

Integrating ZeroTier for a Virtual Private L2 Network

We often face a challenge: connecting servers across different data centers or clouds (AWS, Yandex Cloud, Selectel) into a single network. Standard VPNs (OpenVPN, WireGuard) operate at L3 and do not forward broadcast traffic, which breaks legacy ERP systems or games. ZeroTier solves this by creating a virtual Ethernet (L2) over the internet.

ZeroTier virtualizes the network itself—nodes in the same ZeroTier network see each other as devices in a single LAN segment. Unlike Tailscale or Nebula (L3 overlay), ZeroTier supports broadcast and multicast, enabling scenarios unavailable with L3 overlays: protocols depending on L2 broadcast, direct peer-to-peer gaming, and cluster solutions like Kubernetes service discovery via mDNS.

How ZeroTier Eliminates Network Isolation

ZeroTier removes the need for complex mesh-VPN configurations. Each network has a 16-character Network ID. A node joins with a single command:

# Installation
curl -s https://install.zerotier.com | sudo bash
# Join a network
zerotier-cli join a09acf0233ceff1c
# Check status
zerotier-cli listnetworks
zerotier-cli info

After join, the node waits for authorization in the Network Controller (default: my.zerotier.com, or self-hosted ZeroTier Central). Traffic does not pass until authorized—a key distinction from "open" solutions.

Comparison: ZeroTier vs Tailscale vs WireGuard

Parameter ZeroTier Tailscale WireGuard
Layer L2 (Ethernet) L3 (IP) L3 (IP)
Broadcast/multicast Yes No No
Self-hosted controller Yes (built-in) Yes (Headscale) No (only keys)
Setup complexity Medium Low Medium
Management via API Yes Yes (OAuth authorization) No

ZeroTier wins in scenarios requiring full L2 protocol compatibility. For example, we used it to connect multiple 1C sites: broadcast distributes ARP requests necessary for cluster operation. Tailscale couldn't handle that. Broadcast traffic performance in ZeroTier is twice as high—latency under 5 ms at an average packet size of 1500 bytes.

Comparison: Self-hosted Controller vs ZeroTier Central

Parameter Self-hosted ZeroTier Central
Data control Full Limited
Free node limit Unlimited 25 nodes
Planet for bootstrap Requires your own Built-in
Launch complexity High Low
Cost Only resources Free up to 25, then from $10/month

For production infrastructure with more than 25 nodes, a self-hosted controller pays off: license savings reach 70% per year.

Network Structure and Connection

IP assignment is managed at the network level. In managed mode, the controller assigns addresses from a configured pool. Example network configuration via the ZeroTier Central API:

NETWORK_ID="a09acf0233ceff1c" API_TOKEN="<your_token>" curl -X POST "https://my.zerotier.com/api/v1/network/${NETWORK_ID}" \
 -H "Authorization: token ${API_TOKEN}" \
 -H "Content-Type: application/json" \
 -d '{ "config": { "ipAssignmentPools": [ {"ipRangeStart": "10.147.17.1", "ipRangeEnd": "10.147.17.254"} ], "routes": [ {"target": "10.147.17.0/24", "via": null} ], "v4AssignMode": {"zt": true}, "private": true } }'

Why Opt for a Self-hosted Controller?

For production infrastructure, reliance on an external service is often unacceptable. ZeroTier supports a self-hosted Network Controller—a built-in feature of the zerotier-one daemon, activated via API. Our experience shows: a self-hosted controller offers full control over authorization and data.

# Get the address and token of the local controller
cat /var/lib/zerotier-one/authtoken.secret

# Create a new network on the local controller
NODE_ID=$(zerotier-cli info | awk '{print $3}')
curl -X POST "http://localhost:9993/controller/network/${NODE_ID}______" \
  -H "X-ZT1-Auth: $(cat /var/lib/zerotier-one/authtoken.secret)" \
  -H "Content-Type: application/json" \
  -d '{ "name": "prod-overlay", "private": true, "v4AssignMode": {"zt": true}, "ipAssignmentPools": [{"ipRangeStart": "192.168.100.1", "ipRangeEnd": "192.168.100.254"}], "routes": [{"target": "192.168.100.0/24"}] }'

Nodes must configure moonConfig or planet to use your controller as a planet server (for bootstrap). Without this, they still need an external planet from ZeroTier Inc. for NAT traversal. ZeroNSD is an add-on for DNS resolution of node names within the network.

How to configure managed routes — step-by-step
  1. Install ZeroTier on the router node.
  2. Join it to the network: zerotier-cli join <networkId>.
  3. Enable IP forwarding: sysctl -w net.ipv4.ip_forward=1.
  4. In the network configuration via API, add a route: {"target": "10.0.0.0/16", "via": "<zerotier-ip-of-router>"}.
  5. Configure iptables for NAT and FORWARD (see below).

After this, all nodes in the network can reach subnet 10.0.0.0/16 through the router.

Routing and Managed Routes

One powerful scenario is managed routes for accessing subnets through a specific node. If an AWS VPC has an instance with ZeroTier, you can add a route 10.0.0.0/16 via <zerotier-ip-of-aws-node> — and all network participants access VPC resources without individual configuration.

On the router node, enable IP forwarding:

# /etc/sysctl.d/99-zerotier-router.conf
net.ipv4.ip_forward = 1
sysctl -p /etc/sysctl.d/99-zerotier-router.conf

# And allow forwarding on the zerotier interface
iptables -A FORWARD -i ztXXXXXX -j ACCEPT
iptables -A FORWARD -o ztXXXXXX -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

The interface name ztXXXXXX is the first 6 characters of the Network ID.

What Our Work Includes

A ZeroTier deployment project includes:

  • Audit of current network infrastructure and L2/L3 requirements.
  • Overlay network design: choosing between ZeroTier Central and a self-hosted controller.
  • Configuration of managed routes for cloud VPC connectivity (AWS, Yandex Cloud, Selectel).
  • Documentation on node connection and authorization policies.
  • Team training: managing the network via API, adding nodes.
  • One month of post-project support.

We have delivered over 50 projects for overlay networks. According to Wikipedia, ZeroTier is used to create SDN networks of any complexity. We guarantee stability: we test configurations against node failures.

Timelines and How to Start

Setup takes from half a working day for a basic scenario with a few nodes. A self-hosted controller with managed routes and DNS takes 1–2 days. Pricing is custom. Get an assessment of your project — reach out for a consultation. Gain access to a private network as soon as tomorrow. Order ZeroTier deployment into your infrastructure and eliminate VPN headaches.