This guide provides a comprehensive walkthrough for setting up ZeroTier on an OpenWRT router. ZeroTier enables secure, high-performance virtual networking between devices across the globe—making it ideal for IoT deployments, remote management, and peer-to-peer networks.
ZeroTier is a powerful tool for Internet of Things (IoT) scenarios due to:
- ⚡ High performance: Low latency, high throughput virtual interfaces.
- 🔐 Built-in encryption: End-to-end secure communication.
- 🌍 Global connectivity: Seamlessly connects devices behind NAT/firewalls.
- ⚙️ Auto IP management: No need for static IPs or port forwarding.
- 🧩 Ease of deployment: Minimal setup and maintenance.
Open a terminal session on your OpenWRT router and run:
opkg update && opkg install zerotier
This command updates the package list and installs ZeroTier.
Now configure ZeroTier with your network ID:
uci set zerotier.openwrt_network=zerotier
uci add_list zerotier.openwrt_network.join='YOUR_NETWORK_ID'
uci set zerotier.openwrt_network.enabled='1'
uci commit zerotier
📝 Note: Replace
'YOUR_NETWORK_ID'
with your actual network ID from your ZeroTier Central account.
Enable and start the ZeroTier service:
/etc/init.d/zerotier enable
/etc/init.d/zerotier start
This ensures ZeroTier starts automatically after a reboot.
Check if a ZeroTier virtual interface has been created:
ifconfig | grep zt
You should see an interface like ztxxxxxxxx
, confirming successful connection.
To complete the connection:
- Go to https://my.zerotier.com
- Log in and select your network.
- Find your router (Node ID or MAC address).
- ✅ Check the "Auth?" box.
- (Optional) Assign a fixed IP like
192.168.100.2
. - (Optional) Give the device a friendly name.
Wait a few minutes for ZeroTier to fully establish the connection. You can now communicate with your router over the virtual network as if it were local.
- If the interface doesn't appear, double-check your Network ID.
- Ensure your router has internet access.
- Restart the router and try again.
ZeroTier provides a seamless, secure, and powerful way to connect your OpenWRT router to any network—especially in IoT, remote support, and mesh network scenarios.
For suggestions or tweaks, feel free to fork this Gist or leave a comment!
━━━━━━━━ Secure ● Flexible ● Ideal for IoT ━━━━━━━━