mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-07 21:30:36 -05:00
[GH-ISSUE #1370] Inability to Forward Traffic on OpenWrt When Using --accept-clients #1878
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 @burjuyz on GitHub (Aug 28, 2025).
Original GitHub issue: https://github.com/fosrl/pangolin/issues/1370
I am trying to use
newton an OpenWrt router to provide access to my local LAN (192.168.10.0/24) for remote clients. This is often referred to as a "site-to-site" or "subnet router" configuration.The
newtclient on the OpenWrt router is configured as a "site" (gateway) and runs with the--accept-clientsflag. The local subnet is correctly configured as a "Resource" on the Pangolin server, associated with the OpenWrt client.Remote clients (e.g., a Windows machine running
newt) connect successfully. The remote client correctly receives the route for192.168.10.0/24.The Problem
While the tunnel is established, there is a fundamental issue with traffic forwarding:
newtinstance (e.g.,100.90.128.1). This confirms that the tunnel itself is up and thenewtprocess on the router is responsive.192.168.10.200). The packets are lost.Root Cause Analysis & Diagnostics
After extensive debugging, we have determined that the issue stems from the fact that
newtoperates entirely in userspace and does not create a kernel TUN/TAP interface.This creates a disconnect between the
newtprocess and the OpenWrt's kernel networking stack (which usesnftables).Here’s what we've confirmed through diagnostics:
tcpdumpon the router's WAN interface shows encrypted UDP packets arriving from the Pangolin server when the remote client sends a ping.tcpdumpon thebr-laninterface (oranyinterface) never shows the decrypted ICMP packets.nftablesFORWARDchain rules remain at zero.newtprocess to the kernel for routing and firewall processing.net.ipv4.ip_forward = 1andnet.ipv4.conf.all.rp_filter = 0.iptables-compatand nativenftablesviauci), including creating dedicated zones, masquerading (NAT), and explicitACCEPTrules for the traffic. None of these rules are ever triggered because the packets never reach the firewall subsystem.Conclusion
The core issue is a lack of integration between the userspace
newtprocess and the kernel's routing and firewall engine. For traffic forwarding to work, the decrypted packets must be injected into the kernel's networking stack. The most standard and robust way to achieve this is by using a TUN virtual network interface.Without the ability for
newtto create or bind to a TUN interface, it appears impossible to use it as a proper subnet gateway on OpenWrt (and likely other Linux-based systems). The--accept-clientsfunctionality seems to be broken for any scenario that requires kernel-level packet forwarding.Suggested Solution / Feature Request
Please consider adding a feature to the
newtclient, possibly via a new command-line flag (e.g.,--create-tun), that creates a TUN interface and forwards all site-to-site traffic through it. This would allow for seamless and standard integration with the host operating system's networking and firewall capabilities, making the subnet routing feature truly functional.@oschwartz10612 commented on GitHub (Sep 1, 2025):
Hi! I think you can do what you are after with
--nativeon newt.https://docs.digpangolin.com/manage/clients/add-client#native-mode
https://github.com/fosrl/newt?tab=readme-ov-file#cli-args
This will create a native interface. In this mode though the resource created in pangolin will not do anything and instead it is up to you on openwrt to handle the packets in the kernel - but I think this is what you want. Using the remote subnets in the dashboard will make sure the subnet is forwarded for the olm clients.
@burjuyz commented on GitHub (Sep 2, 2025):
When using Newt on an OpenWrt router behind a Carrier-Grade NAT (CGNAT) with a "grey" IP address, the default Relay Mode fails to establish a functional WireGuard tunnel.
The Newt service on the router successfully connects to the control server websocket and receives a configuration. However, the server does not provide the necessary
endpointinformation for the remote peers (Olm clients). This results in a complete failure of the WireGuard handshake process, rendering the tunnel non-functional, even though all devices appear to be configured correctly.The issue is fully resolved by manually setting the relay server's IP address as the
endpointfor the peer on the Newt device.Log Analysis & Evidence
1. Newt Service Log on OpenWrt Router (at startup)
The router log clearly shows the Newt service connecting successfully but then failing to receive endpoint information for the peers.
Key Log Entries:
2.
wg showcommand output on OpenWrt RouterThis output confirms the missing configuration. The peer corresponding to the Olm client has no
endpointand, critically, nolatest handshake.3. Olm Client Log on Windows
The client log shows that it connects to the control server and attempts to configure the peer, but ultimately fails to connect, timing out with a "disconnected" warning.
Key Log Entries:
Steps to Reproduce
newton an OpenWrt router that is behind a CGNAT (no public IP).newtin the default Relay Mode.olmclient from an external network.Added peer with no endpoint!message will appear.wg show: the peer will have noendpointand nolatest handshake.ping) through the tunnel will fail.Workaround (Manual Fix)
The connection can be made to work perfectly by manually applying the correct configuration on the router after the
newtservice has started. This proves that the underlying WireGuard relay mechanism is functional and the issue lies solely with the configuration pushed by the server.Conclusion
The control server (
Hidden domain) is not correctly providing the relay server's IP address as theendpointto Newt devices when operating in Relay Mode. This prevents the WireGuard handshake from ever occurring.Suggested Solution
The server-side logic should be updated to ensure that when a peer connects via the relay, the IP and port of the relay service are pushed as the
endpointin the WireGuard configuration to all other peers in that site.