Mesh VPN
This guide provides detailed instructions for configuring
ZeroTier VPN within Clan. Follow the
outlined steps to set up a machine as a VPN controller (<CONTROLLER>
) and to
include a new machine into the VPN.
Concept
By default all machines within one clan are connected via a chosen network technology.
If you select multiple network technologies at the same time. e.g. (zerotier + yggdrassil) You must choose one of them as primary network and the machines are always connected via the primary network.
1. Set-Up the VPN Controller
The VPN controller is initially essential for providing configuration to new peers. Once addresses are allocated, the controller's continuous operation is not essential.
- Designate a Machine: Label a machine as the VPN controller in the clan,
referred to as
<CONTROLLER>
henceforth in this guide. - Add Configuration: Input the following configuration to the NixOS configuration of the controller machine:
- Update the Controller Machine: Execute the following: Your machine is now operational as the VPN controller.
2. Add Machines to the VPN
To introduce a new machine to the VPN, adhere to the following steps:
- Update Configuration: On the new machine, incorporate the following to its
configuration, substituting
<CONTROLLER>
with the controller machine name: -
Update the New Machine: Execute:
Replace<NEW_MACHINE>
with the designated new machine name.For Private Networks
-
Retrieve Zerotier Metadata
Retrieve the ZeroTier IP: In the clan repo, execute:
The returned address is the Zerotier IP address of the machine.
-
Authorize the New Machine on the Controller: On the controller machine, execute:
-
-
Verify Connection: On the
The status should now be "ONLINE":new_machine
, re-execute:
Congratulations!
The new machine is now part of the VPN, and the ZeroTier configuration on NixOS within the Clan project is complete.
Further
Currently you can only use Zerotier as networking technology because this is the first network stack we aim to support. In the future we plan to add additional network technologies like tinc, head/tailscale, yggdrassil and mycelium.
We chose zerotier because in our tests it was a straight forwards solution to bootstrap. It allows you to selfhost a controller and the controller doesn't need to be globally reachable. Which made it a good fit for starting the project.