Skip to content
KernelSU Modules

Magisk NetBird

Immutable release Synced

NetBird mesh VPN client for rooted Android devices

Description

NetBird logo

Magisk NetBird

Release Downloads NetBird Magisk Arch

English · 中文

Minimal Magisk module wrapper for the NetBird CLI daemon. Official NetBird binaries (currently v0.83.1) are bundled for three architectures.

DNS interception is off by default. Enable it with the WebUI's Use NetBird DNS switch or netbird.service dns on.

Download

Zip Devices
magisk-netbird-<version>.zip arm64-v8a, armeabi-v7a, and x86_64

Latest release: https://github.com/ahsaboy/magisk-netbird/releases/latest

The release ZIP contains all three NetBird binaries and installs on arm64-v8a, 32-bit ARM, and x86_64. Magisk-compatible managers can check for updates from the module's update information. The ACTION button needs Magisk v28+.

Usage

Connect and check status:

su -c 'netbird.service up --setup-key <KEY> --management-url <URL>'
su -c 'netbird.service status'
su -c 'netbird.service down'   # disconnect; daemon stays running
su -c 'netbird.service stop'   # stop the daemon
su -c 'netbird.service start'
su -c 'netbird.service peers'
su -c 'netbird.service log --once'

On KernelSU without a mount metamodule installed, the module's system/bin overlay is not mounted and netbird.service may be missing from PATH after a reboot. The module re-creates /dev/netbird and /dev/netbird.service symlinks on every boot; use those as a drop-in replacement:

su -c '/dev/netbird.service status'

To keep the setup key out of shell history and ps output, prefer a file:

su -c 'echo -n <KEY> > /data/adb/netbird/setup.key && chmod 600 /data/adb/netbird/setup.key'
su -c 'netbird.service up --setup-key-file /data/adb/netbird/setup.key --management-url <URL>'

Inspect peers with netbird.service peers for connection type, latency, traffic, and last-handshake details.

The module ACTION button is a shortcut for manager users. KernelSU users can open the WebUI for status, routes, health, profiles, and scheduled automation controls. down disconnects without stopping the daemon or watcher; use stop to stop the daemon.

Magisk NetBird KernelSU WebUI

Configuration

Defaults are set in netbird/settings.sh; override any of them via environment variables (environment outranks CLI flags in NetBird):

Variable Default Effect
NB_DISABLE_DNS true Also enforced on up via --disable-dns.
NB_DISABLE_IPV6 false When true, up appends --disable-ipv6; this disables NetBird overlay IPv6 and is not a firewall compatibility workaround.
NB_DISABLE_FIREWALL false When true, up appends --disable-firewall (client stops managing firewall rules).
NB_FORCE_USERSPACE_FIREWALL auto Automatically forced when Android has no usable ip6tables nat table; set explicitly to override detection.
NB_WG_KERNEL_DISABLED auto Automatically forced with the userspace-firewall fallback unless explicitly set.
NB_DISABLE_SSH_CONFIG true Skips writing /etc/ssh/ssh_config.d (read-only on Android).
NB_SKIP_NFTABLES_CHECK true Skips the nftables probe, which always fails on Android.
NB_SKIP_DNS_PROBE true Skips the local-resolver startup probe.
NB_NETWORK_MONITOR true Upstream defaults to false on Linux; enabled for faster reconnects after network switches.
NB_STATE_DIR /data/adb/netbird Writable location for state.json / WireGuard keys (upstream default /var/lib/netbird does not exist on Android).
NB_LOG_LEVEL info NetBird log level.
NB_LOG_MAX_SIZE_MB 5 NetBird's own log-rotation cap for client.log in MiB (upstream default 15).
NB_WATCHDOG on Watchdog: auto-restart the daemon when its status stops responding; off disables.
NB_WATCHDOG_FAILS 3 Consecutive failed status probes before a restart (30s apart while connected, 300s while disconnected).
NB_WATCHDOG_MAX_RESTARTS 10 Restart budget; reset after 5 healthy probes.

All of the variables above (and any other variable the official client supports) can be persisted in /data/adb/netbird/.env as KEY=VALUE lines (# starts a comment); a real environment variable still wins over the file. Start from the installed template:

cp /data/adb/netbird/netbird.env.example /data/adb/netbird/.env

Daemon-read variables (e.g. NB_LOG_LEVEL) apply after the next netbird.service restart; no reboot is needed. On Android builds without a usable IPv6 nat table, the module automatically enables NetBird's userspace firewall and userspace WireGuard so native ip6tables initialization cannot block startup.

Flags added by up persist in config.json and are applied on (re)connect, so after changing them run netbird.service down followed by netbird.service up (or netbird.service restart).

The watcher checks daemon process state every 30 seconds. It probes NetBird status every 30 seconds while connected and every 300 seconds after an intentional disconnect; the watchdog restarts an unresponsive daemon after the configured number of failed probes. netbird.service down only disconnects. netbird.service stop stops the daemon, while start or up starts it again. Uninstall removes the module's network rules.

Dynamic status

While the daemon is running, module.prop is refreshed periodically. Because module descriptions are single-line metadata, status is shown as compact paired fields such as IP/peers, management/signal, relay/interface, memory, CA count, and refresh time. The peers field carries a direct/relay bracket ([P3 R1] = 3 direct, 1 relayed); WD=n shows accumulated watchdog restarts.

Custom CA trust

For self-hosted NetBird servers with a private CA, place PEM certificates in /data/adb/netbird/certs/ as .crt, .pem, or .cer files. /data/adb/netbird/ca.crt is also loaded automatically. Restart NetBird after changing certificates:

su -c 'netbird.service restart'
su -c '/data/adb/netbird/scripts/cert-trust.sh status'

The module injects /system/etc/resolv.conf for the Linux binary runtime. netbird.service up keeps NetBird's Linux host DNS manager disabled; the optional module DNS switch controls Android DNS interception independently.

NetBird DNS

su -c 'netbird.service dns on'
su -c 'netbird.service dns status'
su -c 'netbird.service dns check'
su -c 'netbird.service dns off'

Only the default network is redirected. Lookups bound to IMS, MMS, or other non-default networks are untouched. Fallback supports link-local IPv6 resolvers.

Plain UDP/TCP DNS on port 53 is redirected to a local helper that asks NetBird's resolver first, so peer names, custom zones and domain-specific nameservers work without listing domains in the module. NetBird answers REFUSED only for names no NetBird handler owns; those queries go to the resolver the app originally asked, with the app's original Android routing mark. The same fallback applies while NetBird's resolver is unreachable, except for known NetBird names described below. With a primary (catch-all) nameserver configured in NetBird management, NetBird answers all other names itself. NetBird's own NXDOMAIN and SERVFAIL are returned unchanged, so while NetBird answers, names in its zones are not sent to other resolvers. While NetBird's resolver is unreachable, names under the peer domain and NetBird match domains get SERVFAIL; every other name, including records of NetBird custom zones (they are not listed in the client status), is sent to the original resolver so that the phone keeps resolving.

Queries that enter another VPN's TUN stay with that VPN. When a resolver listens on the phone itself (a local DNS proxy on 127.0.0.1:53 or [::1]:53), queries addressed to it reach it unchanged; without one, loopback queries are redirected, because root tools that cannot reach Android's resolver send their lookups to 127.0.0.1:53. Plain DNS that such a VPN sends from the phone to its own upstreams is redirected like any other query; names NetBird does not own still reach the upstream the VPN chose. DNS over DoH, DoT, DoQ, a remote proxy or a nonstandard port, and DNS from hotspot clients, cannot be redirected transparently; point that tool at NetBird's resolver explicitly if needed. The WebUI warns when Android's Private DNS is strict or has validated encrypted DNS on the current network, because those system queries bypass the redirect. Encrypted DNS chosen inside another VPN or app cannot be detected.

Root processes are redirected too, except queries to NetBird's upstream nameservers and the module's bootstrap resolv.conf servers, which NetBird itself uses. Queries using the upstream routing exception are source-NATed to the physical interface's address. Set NB_DNS_ROOT=bypass in /data/adb/netbird/.env when a root-run transparent proxy already captures root DNS.

The setting survives reconnects and reboot. Disconnecting or stopping NetBird removes the redirect; reconnecting restores it. Network and VPN changes are reconciled within a few seconds. Cleanup only removes module-owned chains, routing rules and translated DNS connections; with the switch off, lifecycle hooks do nothing.

The helper serves UDP/TCP on 127.0.0.1:5354 and [::1]:5354. IPv6 uses NAT when available, otherwise local-only TPROXY (table 7121, preference 85). Without either, IPv6 plain DNS is rejected so Android retries over an intercepted IPv4 server; if the network only offers IPv6 DNS, IPv6 queries are left alone and the WebUI says so. Devices with IPv6 disabled only use IPv4 interception. Module marks use bits 21-31 (0x4e400000 upstream exception at preference 84, 0x4e600000 TPROXY, 0x4ea00000 helper traffic, mask 0xffe00000), leaving Android's netId and policy bits intact. Conflicting chains, rule priorities or the reserved table prevent activation.

DNS helper development: cd tools/nb-dns && go test -race ./.... Run sh tests/dns.test.sh for module lifecycle tests. Release packaging builds the helper for all three supported architectures.

Direct NetBird commands should include the module daemon address:

su -c 'netbird --daemon-addr unix:///data/adb/netbird/run/netbird.sock status'

Releases

v1.5.1-0.83.2

Latest

Version code 10501 v1.5.1

Download

v1.5.1 — NetBird v0.83.2

  • Fixed an Android DNS lifecycle race where Toybox tr could spin at 100% CPU if the helper exited while its /proc/<pid>/cmdline was being checked; stream the read through cat so errors become EOF and cleanup can proceed. (PR #5)
  • Made settings PATH setup idempotent, preventing repeated sourcing from duplicating the module and /system/bin entries. (PR #5)
  • Updated the official NetBird client to v0.83.2 for x86_64, arm64-v8a, and armv7; release packaging verifies upstream SHA-256 checksums. The client now falls back to the system hostname when the device name is empty.
  • 修复 Android DNS 生命周期竞态:helper 退出时检查 /proc/<pid>/cmdline 可能导致 Toybox tr 占满单核;改为通过 cat 读取,使读取错误转为 EOF,避免阻塞清理。(PR #5)
  • 将 settings.sh 中的 PATH 初始化改为幂等,避免重复 source 时反复追加模块路径和 /system/bin。(PR #5)
  • 更新官方 NetBird 客户端至 v0.83.2,覆盖 x86_64、arm64-v8a 和 armv7;发布打包时校验上游 SHA-256。该版本在设备名为空时回退使用系统主机名。

Assets 1

magisk-netbird-10501-v1.5.1-0.83.2.zip 46.9 MiB

SHA-256 8798b02bd709036b88926273d2db0078445ecf70efc7574dd22217ecccaa2c82 · Attestations

Version code 10500 v1.5.0

Download

v1.5.0 — NetBird v0.83.1

  • Added opt-in Android DNS interception for the default network, with a WebUI switch and netbird.service dns on|off|status|check. The bundled helper sends peer, custom-zone, and match-domain queries to NetBird, and falls back to the original resolver for names NetBird does not own. DNS interception remains off by default. (PR #4)
  • Added IPv4/IPv6 DNS handling, VPN-aware routing, health-based fallback, and ownership-tracked firewall cleanup. Encrypted DNS and non-default networks remain outside the interception scope. (PR #4)
  • Updated the bundled official NetBird client to v0.83.1 for x86_64, arm64-v8a, and armv7; release packaging verifies upstream SHA-256 checksums.
  • 新增默认关闭的 Android DNS 接管功能,可通过 WebUI 开关或 netbird.service dns on|off|status|check 控制。随包提供的 helper 会将 Peer、自定义区域和匹配域名查询交给 NetBird;NetBird 不负责的名称则回退到原解析器。(PR #4)
  • 新增 IPv4/IPv6 DNS 处理、兼顾 VPN 的路由、健康检查回退及按归属清理防火墙规则;加密 DNS 和非默认网络不在接管范围内。(PR #4)
  • 更新官方 NetBird 客户端至 v0.83.1,覆盖 x86_64、arm64-v8a 和 armv7;发布打包时校验上游 SHA-256。

Assets 1

magisk-netbird-10500-v1.5.0-0.83.1.zip 46.9 MiB

SHA-256 56f9bdb3b14052b0edb331d003161957abd188753a64fb109f4a35a3557abab1 · Attestations

Version code 10413 v1.4.13

Download

v1.4.13 — NetBird v0.82.1

  • Updated the official NetBird client to v0.82.1 for x86_64, arm64-v8a, and armv7; release packaging verifies upstream SHA-256 checksums.
  • Hardened SSH authentication and lifecycle handling: reject username changes during JWT authentication, close handshakes and unauthorized sessions, run SFTP through su, and default SSH off for stored configs without a peer key.
  • Fixed userspace firewall handling of unspecified local addresses, prevented forwarded traffic from exiting its ingress interface, and corrected nftables peer-protocol matching behind IPv6 extension headers.
  • Removed peers from the interface when they leave the network map and their lazy connection is idle.
  • 更新官方 NetBird 客户端至 v0.82.1,覆盖 x86_64、arm64-v8a 和 armv7;发布时校验上游 SHA-256。
  • 加固 SSH 认证与会话管理:拒绝 JWT 认证期间变更用户名,关闭握手中及已失去授权的会话,SFTP 通过 su 启动;缺少 peer key 的旧配置默认关闭 SSH。
  • 修正用户态防火墙对未指定本地地址的识别,阻止转发流量从入站接口原路发出,并修复 IPv6 扩展头后的 nftables peer 协议匹配。
  • peer 离开 network map 且 lazy connection 空闲时,从接口移除该 peer。

Assets 1

magisk-netbird-10413-v1.4.13-0.82.1.zip 43.2 MiB

SHA-256 b58076527ef5bac981a3417887af59e9f43f6e1764754d1713ac980e0e7aa5f8 · Attestations

Version code 10412 v1.4.12

Download

v1.4.12 — NetBird v0.82.0

  • Updated the official NetBird client to v0.82.0 for x86_64, arm64-v8a, and armv7; release packaging verifies upstream SHA-256 checksums.
  • Fixed Android underlay routing to match NetBird's fwmark, preserving tethered traffic instead of matching every UID 0 packet. Thanks to York Wu for the contribution.
  • Compact peer rows and paginated automation history; redesigned automation rules with stable ordering, search/filters, editing, and execution details.
  • NetBird updates since v0.81.4 include safer SSH session handling (v0.81.5), more stable HA route selection, status --table, and Rosenpass deprecation (v0.82.0).
  • 更新 NetBird 官方客户端至 v0.82.0,覆盖 x86_64、arm64-v8a 和 armv7;发布打包时校验上游 SHA-256。
  • 修正 Android 下层路由规则,改为匹配 NetBird fwmark,避免 UID 0 规则错误影响热点转发流量。感谢 York Wu 的贡献。
  • 精简 Peer 列表并为自动化历史分页;重做规则界面,支持稳定顺序、搜索筛选、编辑和执行详情。
  • NetBird 自 v0.81.4 后的更新包括加固 SSH 会话(v0.81.5)、提升 HA 路由稳定性、新增 status --table 及弃用 Rosenpass(v0.82.0)。

Assets 1

magisk-netbird-10412-v1.4.12-0.82.0.zip 43.1 MiB

SHA-256 05be942fb7c23da88dda6eb153cb363e6b4f16ce94af226650e6f8853dfd9dc4 · Attestations

Version code 10411 v1.4.11

Download

v1.4.11 — NetBird v0.81.4

  • Added scheduled connect/disconnect rules with priorities and a persistent execution journal.
  • Kept the daemon watcher independent from connection state, with 30-second heartbeats and 30/300-second status probes.
  • Updated the official NetBird client to v0.81.4 and improved WebUI feedback and mobile behavior.

Assets 1

magisk-netbird-10411-v1.4.11-0.81.5.zip 43.0 MiB

SHA-256 dde91fe41419682d2667200bddb0d3a0e9c756343df1c4a37bc8dd161b6e7ac2 · Attestations

Version code 10410 v1.4.10

Download

v1.4.10 — NetBird v0.81.3

  • Optimized the status watcher: one shared status --json call per cycle (was up to three netbird CLI spawns) with the module.prop description now parsed from JSON, and an idle mode while the client is disconnected — route re-checks and watchdog restarts are skipped and the cycle relaxes to NB_IDLE_UPDATE_INTERVAL (default 300s), so a downed client costs almost nothing. webui up starts a dead daemon on demand (detached, with auto-connect) and refreshes underlay routes immediately on reconnect.
  • Added confirmed connection controls to the WebUI overview: Reconnect/Disconnect (fast daemon-IPC up/down reusing persisted flags) and Start/Stop daemon. Daemon lifecycle runs detached (nohup) with the page polling status, so closing the WebUI cannot interrupt it; every control requires a confirmation dialog. New fixed webui service actions: up, down, daemon-start, daemon-stop.
  • Fixed the WebUI misreading a disconnected client as a stopped daemon: netbird's daemonStatus reports the connection state, so the page now tracks process state and connection state separately. After webui down the banner shows "disconnected" (with the stop/start controls intact) instead of switching to the start-daemon card; Connect/Disconnect buttons disable according to the current connection state and a needs-login state is surfaced.
  • Restyled WebUI notices as centered translucent-gray toasts with rounded corners.
  • Silenced the 5-second refresh cooldown on implicit loads (tab switches no longer pop an "updated recently" toast), deduplicated concurrent identical commands, and added a background Networks prefetch so the first Networks view renders instantly.
  • Tab switches now render the destination view with its loading placeholder first and defer the data read until the slide transition finishes (240ms), removing the animation stutter caused by firing the root-command bridge mid-transition; stale timers are ignored when switching again quickly.
  • Fixed the English "Refresh system routes"/"Refresh runtime rules" labels overflowing their two-column action buttons (shortened copy plus wrapping allowed in the action grid).
  • Implicit-load failures now surface in-page instead of as toasts: Networks shows an error placeholder with retry, diagnostics show the error in the output area, and status-bridge errors appear as a detail line inside the banner. Toasts are reserved for explicit switch/confirm actions.
  • When the daemon is stopped, views drop cached rows and show a "daemon is stopped" placeholder (Networks and Peers), and no doomed read commands are fired; the Networks cache is invalidated the moment status reports the daemon stopped, so stale rows never survive inside the 5-second cooldown.
  • A running-but-disconnected client no longer triggers the raw "failed to list network: not connected" error: Networks shows a friendly not-connected placeholder (or a connecting indicator), the route rows and bulk enable/disable actions are hidden outside the healthy state, and the doomed networks list call is skipped; remaining error messages drop the CLI's "Error: " prefix.
  • Fixed the watchdog restart path: kill "$pid"2>/dev/null was missing a space, so TERM/KILL targeted a nonexistent PID and a wedged daemon was never actually killed before the restart attempt.
  • Deduplicated the busybox-timeout wrappers in the status watcher (nb_with_timeout) and made client_cmd delegate to webui_client.
  • Removed the WebUI forwarding-rules view: NetBird dropped the forwarding CLI command in v0.81.0 together with management-side ingress ports, so the view always failed with unknown command "forwarding".
  • The webui forwarding service action now returns an explicit "no longer available in NetBird v0.81.0+" error instead of passing the raw CLI failure through, so stale cached WebUI pages show a clear message.
  • The Networks view now shows a loading state while retrying after a failed load, matching the removed forwarding view's behavior.
  • Moved the WebUI bridge sources (view-model.mjs, kernelsu.js) out of module/webroot/ into ui/src/, so the shipped webroot contains only build output; removed the duplicate ui/src/lib/utils.ts and two unused i18n strings.
  • Install-time extraction now skips the update.json / updates/*.json download manifests (managers fetch updates via the updateJson URL in module.prop, so the copies in MODPATH were dead weight).

Assets 1

magisk-netbird-10410-v1.4.10-0.81.3.zip 43.0 MiB

SHA-256 37d92573e10d92c255c5cc45795a95d057db86787ff0ca08ea7051694a22f553 · Attestations

Version code 10409 v1.4.9

Download

v1.4.9 — NetBird v0.81.3

  • Updated the bundled official NetBird client from 0.80.0 to 0.81.3 for x86_64, arm64-v8a, and armv7 packages, each archive SHA-256 verified against the official release checksums before packaging.
  • Carries the upstream v0.81.x client changes: relayed connections in kernel mode no longer require eBPF (replaced by loopback endpoint addressing), one unreachable relay no longer churns the other relay connections, ICE session IDs survive remote restarts with fewer unnecessary reconnects, and the signal stream registration wait is bounded for faster failure detection.
  • Re-created the /dev/netbird and /dev/netbird.service entry-point symlinks on every boot, so the CLI stays reachable after reboot on KernelSU without a mount metamodule (and in late-load mode), where /dev is wiped and the module's system/bin overlay is not mounted.
  • On KernelSU, the dynamic module status is now also published through the ksud module config override.description key; Magisk and older managers keep reading the periodically refreshed module.prop.

Assets 1

magisk-netbird-10409-v1.4.9-0.81.3.zip 43.0 MiB

SHA-256 02eabf37931324834e9306b0a653d767c3ec0c8fa86637c373adbe1e20ca7fd6 · Attestations

Transparency

Tag
v1.5.1 Immutable release
Tag commit
20d9d60d9a01
Content commit
257e5c7bcd84
SHA-256
8798b02bd709036b88926273d2db0078445ecf70efc7574dd22217ecccaa2c82
Last change synced

Verify it yourself

KernelSU Modules does not sign or audit modules. The SHA-256 only proves the download matches this index. Verify the release yourself with the GitHub CLI:

gh release verify v1.5.1 -R ahsaboy/magisk-netbird
gh release verify-asset v1.5.1 magisk-netbird-10501-v1.5.1-0.83.2.zip -R ahsaboy/magisk-netbird