The use of ZeroTier can have various different reasons. I like it for being straight forward and easy in usage. Even though it depends on a centralized component (the management / Web UI), the traffic is encrypted and Peer to Peer. A self hosted solution would be WireGuard / Tailscale.
The last couple of weeks I’m diving in the world of *BSD with FreeBSD (you can expect an dedicated article about this from me here soon ;-) ) and I wanted to connect a FreeBSD machine to my ZeroTier network. I stumbled upon an error which I never stumbled upon in the Linux world. So I wanted to share the solution to this very specific error with you here for better visibility.
Installing ZeroTier on FreeBSD
Installing ZeroTier on FreeBSD was even easier than on any Linux distribution. ZeroTier is already included within the FreeBSD pkg repositories and so you can easily install it with the following command:
root@freebsd:~# pkg install zerotier
To finish the installation you have to enable the ZeroTier service in FreeBSD. For this, simply create a new rc file under /etc/rc.conf.d/ or add the following line to your /etc/rc.conf.local file. Whatever suits you more:
zerotier_enable=”YES”
Now we can finally start the service:
root@freebsd:~# service zerotier start
Error 401
After the service started, you can start to work with the zerotier-cli command. For e.g. you can join a network like this:
root@freebsd:~ # zerotier-cli join <myNetworkID>
However, you will most likely be greeted with the following error:
401 join {
The 401 HTTP error code just means “unauthorized” which is very unspecific here. It completely blocks you from using ZeroTier at all. After searching the web, I found out that there is a config file missing after installation which actually allows you to interact with your running ZeroTier service. You have to create the file local.conf manually and place it under /var/db/zerotier-one with the following content:
{
"settings": {
"allowManagementFrom": [
"127.0.0.1",
"::1",
"10.0.0.0/8",
"ffff:127.0.0.1"
]
}
}
Finally restart your ZeroTier service and you should be ready to go:
root@freebsd:~# service zerotier restart
This has also been a topic on the official ZeroTier forums. The users aew and edlitmus have posted this solution here.
If you liked this article, please consider supporting me by either subscribing or using one of my referral links listed here.