netbirdio / netbird

Connect your devices into a secure WireGuard®-based overlay network with SSO, MFA and granular access controls.
https://netbird.io
BSD 3-Clause "New" or "Revised" License
10.4k stars 464 forks source link

openwrt netbird service need to be modified to use netbird dns by using wireguard in userspace. #1676

Open masx200 opened 5 months ago

masx200 commented 5 months ago

Describe the problem

openwrt netbird service need to be modified to use netbird dns by using wireguard in userspace.

When the netbird is running in kernel mode, the netbird dns cannot be accessed 100.124.255.254.

A clear and concise description of what the problem is.

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error
    ping: sendto: Required key not available

Expected behavior

nslookup openwrt-2.netbird.cloud      
Server:         100.124.255.254         

 Address:        100.124.255.254:53

Non-authoritative answer:                              

Name:   openwrt-2.netbird.cloud                        

Address: 100.124.74.200                                                                                       

Non-authoritative answer:                              

A clear and concise description of what you expected to happen.

Are you using NetBird Cloud?

Please specify whether you use NetBird Cloud or self-host NetBird's control plane.

NetBird version

netbird version

NetBird status -d output:

If applicable, add the `netbird status -d' command output.

Daemon version: 0.26.2
CLI version: 0.26.2
Management: Disconnected, reason: rpc error: code = DeadlineExceeded desc = context deadline exceeded
Signal: Connected
Relays: 2/2 Available
FQDN: openwrt.netbird.cloud
NetBird IP: 100.124.70.241/16
Interface type: Userspace
Quantum resistance: false
Peers count: 2/4 Connected

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

edit file /etc/init.d/netbird


#!/bin/sh /etc/rc.common

. /lib/netifd/netifd-proto.sh

START=99                                               

STOP=10

USE_PROCD=1                                                                                                   

service_triggers() {
        procd_add_interface_trigger "interface.*" "wan" /etc/init.d/netbird restart
}

start_service() {
        local device
    export NB_WG_KERNEL_DISABLED=true
        procd_open_instance
        procd_set_param command /usr/bin/netbird
        procd_append_param command service run
        procd_set_param env NB_WG_KERNEL_DISABLED=true         
procd_set_param pidfile /var/run/netbird.pid
        procd_close_instance
}
masx200 commented 5 months ago

https://github.com/netbirdio/netbird/issues/254

wehagy commented 3 months ago

I've been using netbird, but not self hosting, for about 30 days on two devices, tplink_archer c7 v4 and totolink_x5000r, with wireguard kernelspace in openwrt snapshot without any problems so far, to be honest at sometimes tplink_archer c7 v4 disconnects, but I think the problem is the hardware, few resources, because totolink_x5000r is fine.

And I opened https://github.com/openwrt/packages/pull/23926 to add kmod-wireguard as a dependency for netbird, and to work in userspace you probably also need kmod-tun, maybe I add kmod-tun as dependency too? I just don't think it's good to change the default to use wireguard userspace