For my home network, I recently switched to netbird to have an easy-to-use, policy-based VPN with clients for all of my devices.
After initially having a peer on my hypervisor, I wanted to move it over to my router, a Turris Omnia NG.
Base setup
My router is OpenWrt based, so there was already a package for netbird available:
opkg update
opkg install netbird
I was then able to enable the service under System > Startup in the LuCI UI and connect using netbird up --management-url https://my-netbird-server.tld --setup-key <SETUP-KEY>.
Fixing connectivity
Sadly, this wasn’t the full deal yet. My peer showed up in the netbird dashboard, but despite the right ACL rules, no packets came through.
This boiled down to two things:
- Netbird runs on a separate
wt0interface, which my router didn’t allow any traffic from by default - Netbird uses IP sets for the filtering, so without the correct kernel module, this wouldn’t work
The first thing could be fixed in LuCI under Network > Firewall by adding a new zone:
- Name:
netbird - Input:
accept, Output:accept, Intra zone forward:reject - Masquerading: off, netbird already does that by itself
- Advanced Settings > Covered devices:
wt0(shows up as a device) - Allow forward to destination zones:
lan
Input can be set to accept without worries, since netbird puts its own ACL chain in front of anything coming in on wt0 anyway.
Traffic still got dropped after that. The client log (/var/log/netbird/client.log) was full of errors like this:
create ipset nb-ec584761: invalid argument
So I installed the ipset kernel module and restarted netbird:
opkg update
opkg install kmod-ipt-ipset
/etc/init.d/netbird restart
After that, the route rules finally got created.
Fixing DNS
I realized that after netbird was up, router-local DNS stopped working. Netbird replaces /etc/resolv.conf with its own nameserver, but its DNS listener can’t bind to port 53 since the router’s own resolver already sits there. So the router ended up asking a nameserver that doesn’t exist. I had to start netbird without its built-in DNS management, which isn’t too much of a problem, since it runs as a routing peer only anyways:
netbird down
netbird up --disable-dns
The setting sticks in /etc/netbird/config.json, so it survives restarts.
Conclusion
I wrote this post due to the lack of any concrete guides for Turris OS / OpenWrt in general and hope this helps someone struggling with the same issues.
kthxbye