Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netbird: add kmod-wireguard dependency #23926

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

wehagy
Copy link
Contributor

@wehagy wehagy commented Apr 14, 2024

Maintainer: Oskari Rauta / @oskarirauta
Compile tested: mips_24kc, ar71xx-ath79, generic, TP-Link, Archer C7, v4, OpenWrt SNAPSHOT r25907-ab9a29a320
Run tested: mips_24kc, ar71xx-ath79, generic, TP-Link, Archer C7, v4, OpenWrt SNAPSHOT r25907-ab9a29a320

Description:

  • netbird supports the wireguard kernel module, but it can work without it in user mode, losing some performance, but we know in advance that netbird will run as root, therefore supporting the wireguard kernel mode with better performance.

Edit:

  • Rebase and resolve conflicts
  • Made requested changes
  • Rebase
  • I thought maybe on some really limited space devices this might be a problem, but from openwrt packages repo netbird_0.26.6-r1_mips_24kc.ipk it is 9922.5 KB and from openwrt kmods repo kmod-wireguard_6.1.82-r1_mips_24kc.ipk it is 37.7 KB and my compiled locally netbird_0.27.3-r1_mips_24kc.ipk is 9977 KB, nah, if kmod-wireguard can't be installed, netbird probably can't either.

net/netbird/Makefile Outdated Show resolved Hide resolved
@1715173329
Copy link
Member

Ping @oskarirauta

@wehagy
Copy link
Contributor Author

wehagy commented May 11, 2024

I found that installing only netbird results in the following error, making it unusable:

# netbird status -d
Error: status failed: new wg interface: couldn't check or load tun module

This error is due to the lack of the kmod-tun module to work in userspace mode, after the installation works normally:

# netbird status -d
[...REDACTED PEERS...]
Daemon version: 0.27.3
CLI version: 0.27.3
Management: Connected to https://api.netbird.io:443
Signal: Connected to https://signal.netbird.io:443
Relays:
  [stun:stun.netbird.io:5555] is Available
  [turns:turn.netbird.io:443?transport=tcp] is Available
Nameservers:
  [REDACTED] for [.] is Available
  [REDACTED] for [netbird.io] is Available
FQDN: REDACTED.netbird.cloud
NetBird IP: REDACTED
Interface type: Userspace
Quantum resistance: false
Routes: -
Peers count: 4/6 Connected

But since netbird works in kernelspace too there is also no reason to install kmod-tun, it makes more sense to install kmod-wireguard and use kernelspace which is more performant, after the install of the kmod-wireguard module:

# netbird status -d
[...REDACTED PEERS...]
Daemon version: 0.27.3
CLI version: 0.27.3
Management: Connected to https://api.netbird.io:443
Signal: Connected to https://signal.netbird.io:443
Relays:
  [stun:stun.netbird.io:5555] is Available
  [turns:turn.netbird.io:443?transport=tcp] is Available
Nameservers:
  [REDACTED] for [.] is Available
  [REDACTED] for [netbird.io] is Available
FQDN: REDACTED.netbird.cloud
NetBird IP: REDACTED
Interface type: Kernel
Quantum resistance: false
Routes: -
Peers count: 2/6 Connected

also kmod-wireguard size 35.59 KiB and kmod-tun size 26.47 KiB

Compile tested: x86, 64, x86_64, QEMU (x86_64), qemu-system-x86_64, 8.2.2, qemu, OpenWrt SNAPSHOT r26280-8113169cad
Run tested: x86, 64, x86_64, QEMU (x86_64), qemu-system-x86_64, 8.2.2, qemu, OpenWrt SNAPSHOT r26280-8113169cad

netbird supports the wireguard kernel module, but it can work without it in userspace,
losing some performance, but we know in advance that netbird will run as root,
therefore supporting the wireguard kernelspace with better performance.

Signed-off-by: Wesley Gimenes <wehagy@proton.me>
@wehagy
Copy link
Contributor Author

wehagy commented May 23, 2024

Sorry closed by mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants