ZeroTier — Programmable Layer-2 Overlay Network
Open-source SD-WAN that builds encrypted peer-to-peer Layer-2 overlays spanning NATs, clouds, and edge devices with a rule engine and controller API.
What it is
ZeroTier is an open-source software-defined networking tool that creates encrypted peer-to-peer Layer-2 overlay networks. It connects devices across NATs, firewalls, clouds, and on-premises infrastructure as if they were on the same local network. A controller API and flow rule engine let you define network policies programmatically.
ZeroTier is for teams that need to connect servers, containers, IoT devices, or developer machines across different networks without traditional VPNs or complex firewall rules.
How it saves time or tokens
ZeroTier eliminates VPN server setup and maintenance. Instead of configuring WireGuard or OpenVPN servers, punching firewall holes, and managing certificates, you install ZeroTier on each device and join a network ID. Peer-to-peer connectivity is automatic, even behind double-NAT.
The controller API means network changes are programmable. Add or remove members, change IP assignments, or update flow rules via REST API calls instead of manual configuration.
How to use
- Install ZeroTier:
# Linux / macOS
curl -s https://install.zerotier.com | sudo bash
# Or via package managers
brew install zerotier-one # macOS
apt install zerotier-one # Debian/Ubuntu
- Create a network at my.zerotier.com or run a self-hosted controller.
- Join the network on each device:
sudo zerotier-cli join <network-id>
Example
Using the ZeroTier API to manage a network programmatically:
# List network members
curl -s -H 'Authorization: token YOUR_API_TOKEN' \
'https://api.zerotier.com/api/v1/network/NETWORK_ID/member'
# Authorize a new member
curl -X POST \
-H 'Authorization: token YOUR_API_TOKEN' \
-d '{"config": {"authorized": true}}' \
'https://api.zerotier.com/api/v1/network/NETWORK_ID/member/MEMBER_ID'
Once authorized, the device gets a virtual IP and can communicate with all other members as if on the same LAN.
Related on TokRepo
- AI tools for DevOps -- Infrastructure and networking tools
- Self-hosted tools -- Self-hosted alternatives for networking and services
Common pitfalls
- Leaving networks in public mode (auto-authorize). Any device that knows the network ID can join. Always use private networks and manually authorize members.
- Ignoring flow rules. ZeroTier defaults to allow-all traffic between members. Define rules to restrict access between roles (e.g., only allow SSH from admin devices).
- Expecting ZeroTier to replace a firewall. ZeroTier handles connectivity, not host-level security. Still run iptables or nftables on each device.
Frequently Asked Questions
WireGuard is a point-to-point VPN protocol that requires manual peer configuration and a central server for routing. ZeroTier is a full mesh overlay network where peers discover and connect to each other automatically, even behind NATs. ZeroTier also provides a controller for centralized policy management.
Yes. The ZeroTier controller is included in the zerotier-one package. You can run your own controller for full control over network management without using the hosted service at my.zerotier.com.
Usually yes. ZeroTier uses UDP hole punching and falls back to relay servers (called roots) when direct connectivity is not possible. Most corporate firewalls allow outbound UDP traffic, which is sufficient for ZeroTier to establish connections.
Yes. The free tier supports up to 25 devices per network. Paid plans remove device limits and add features like business SSO, central management, and priority support.
ZeroTier operates at Layer 2 (Ethernet). This means it can carry any protocol that runs on Ethernet, including IPv4, IPv6, and multicast traffic. Devices on a ZeroTier network behave as if connected to the same physical switch.
Citations (3)
- ZeroTier GitHub— ZeroTier is an open-source SD-WAN for peer-to-peer overlay networks
- ZeroTier Documentation— Layer 2 overlay with flow rule engine and controller API
- Stanford SDN Course— Software-defined networking and overlay network fundamentals
Related on TokRepo
Discussion
Related Assets
doctest — The Fastest Feature-Rich C++ Testing Framework
doctest is a single-header C++ testing framework designed for minimal compile-time overhead and maximum speed.
Chai — BDD/TDD Assertion Library for Node.js
Chai is a flexible assertion library for Node.js and browsers that supports expect, should, and assert styles.
Supertest — HTTP Assertion Library for Node.js APIs
Supertest provides a high-level API for testing HTTP servers in Node.js with fluent assertion chaining.