Intro
Setting up a Zerotier network coupled with an Unraid server was in my opinion a bit tricky, and I couldn’t find a single website which mentions everything needed.
This tutorial allows you to connect from a Zerotier system to any LAN system, and from any LAN system to any Zerotier system.
Requirements
- A linux installation with Zerotier installed. For Unraid I used the app from Spikhalskiy.
- A router with static routes support (You can ignore this step if you only want Zerotier systems to connect to any LAN system but not the other way around)
Details
- $LAN: 192.168.178.0/24
- $ZEROTIER: 192.168.195.0/24
- $UNRAID_LAN: 192.168.178.250 (static)
- $UNRAID_ZEROTIOER: 192.168.195.250 (static ip)
- $ZEROTIERINTERFACE: The interface name of the Zerotier interface
1. Setup a route in Zerotier
Open the Zerotier Dashboard and add a new route with the following settings:
- Destionation: $LAN
- Via: $UNRAID_ZEROTIOER
2. Setup a route in your router
Open your routers website and add a new route with the following settings:
- Network / Destination: $ZEROTIER
- Gateway / Via: $UNRAID_LAN
3. Add a user script in unraid
- (Install the users script addon if you haven’t already)
- Create a new user script and change it to run at startup
- Open up a terminal and run
ip addr
, find the Zerotier interface and note the interface name. (Starts with ZT) - Open up the user script with nano and set its content to:
(Make sure to $ZEROTIERINTERFACE with the actual interface name)
1 |
|
- Run the script
4. Test
Now you should be able to access any LAN system via Zerotier, and access any Zerotier system via your LAN network without needing to have Zerotier installed on any computer.