mirror of
https://github.com/fosrl/newt.git
synced 2026-07-16 03:46:25 -05:00
[GH-ISSUE #403] --native-main main tunnel never completes the WireGuard handshake (gateway 100% unreachable) on self-hosted Pangolin 1.19.4; netstack mode works #8329
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pauldovi on GitHub (Jul 6, 2026).
Original GitHub issue: https://github.com/fosrl/newt/issues/403
Originally assigned to: @oschwartz10612 on GitHub.
Describe the Bug
Claude generated this bug report as it helps me work through updating my newt instance to 1.14 and try to use kernel mode wireguard.
Summary
Newt 1.14.0's new --native-main mode brings up the kernel TUN interface and the control websocket, assigns the tunnel IP, and adds routes — but the main tunnel's WireGuard data path never comes up: the tunnel gateway is 100% unreachable. The default netstack mode works perfectly against the identical server, binary, and credentials. The failure is isolated to native mode and is not the clients/Olm-mesh subsystem.
Expected
--native-main establishes the main tunnel over a kernel TUN interface (as netstack mode does over gVisor), so the tunnel gateway is reachable.
Actual
The newt TUN interface comes up with the assigned tunnel IP and routes, the websocket connects — but the handshake to Gerbil never completes and the gateway is unreachable:
Manual ping over the interface confirms 100% loss:
IWhat it is NOT (isolation)
Hypothesis
Under --native-main the WG UDP socket is owned by the kernel/native interface, so Newt's userspace hole-punch may be unable to emit from the correct source port → Gerbil never learns the site endpoint → the peer handshake never completes. (clientsStartDirectRelay() also appears to be skipped when UseNativeMainInterface is set.) The 1.14.0 commit history describes this as a "first draft on native on main tunnel," so it may be known-incomplete. Happy to run any diagnostic — wg dump, tcpdump of the WG UDP, or a debug build.
Environment
To Reproduce
NEWT_ID=… NEWT_SECRET=… PANGOLIN_ENDPOINT=https://pangolin.example.com
newt --native-main -disable-ssh -dns
Run as root, or unprivileged with CAP_NET_ADMIN + /dev/net/tun present + a writable /run/wireguard and $HOME.
Expected Behavior
--native-main establishes the main tunnel over a kernel TUN interface (as netstack mode does over gVisor), so the tunnel gateway is reachable.
@oschwartz10612 commented on GitHub (Jul 7, 2026):
I would caution that the native modes are pretty experimental right now. I would only use them if needed. Will look into this as soon as possible.
@AstralDestiny commented on GitHub (Jul 7, 2026):
Well the native method wouldn't be using a /dev/net/tun, It uses the SYS_MODULE which you' have to pass to it if you want it to auto load the module if not loaded by the host system already however when it's in userspace it'll piggyback off /dev/net/tun.
lsmod | grep wireguardTo make sure the kernel is loaded and it won't use a tun interface as that's not how a native wireguard functions.
Will look in a bit, need some food first.