add: WireGuard bypass tunnel #217
Loading…
Reference in a new issue
No description provided.
Delete branch "add/wireguard-bypass-216"
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?
Closes the last WireGuard capability gap (#216), on the #176 seams.
Change:
WireGuard.rolesgrows "bypass" (devicewg_aqomui_b, already reserved);TUNNEL_BYPASS["WireGuard"]flips, which alone lifts the gui gate.default dev wg_aqomui_b table 11: the WireGuard analogue of bypass_up.sh, minus the $route_vpn_gateway a tun-like device doesn't need.wg()is role-aware:_bypasssuffix on statuses, role state on "bypass", no resolved entry (#59's rule - the service's bypass resolver reads the role's dns fields; conf DNS lands there, reachable through the tunnel it belongs to).bypass_protocolconstructed at connect, torn down ondisconnect("bypass")withtunnel_terminated_bypassannounced and a cgroup rebuild - the wg default in table 11 dies with the device, and the physical-link one must return for still-bypassed apps.Verification: suite 541 passed - bypass routing policy (pin-no-default), table-11 default, resolved-untouched with dns riding the role state, nudge route install/cleanup, service teardown + cgroup rebuild.
Live checks before merge (needs #215's rule too - merge order free, they're disjoint):
aqomui-bypass curl icanhazip.comshows the bypass server's exit; plain curl shows the main tunnel's.ip route show table 11→ default viawg_aqomui_b;resolvectl domain→~.on the main link only.Closes #216.
🤖 Generated with Claude Code
0520f9091531341b0bc431341b0bc45075e187b5Live round 1 findings, fixed in
97162df:tun_aqomui_bonly. Packets enteredwg_aqomui_bwith the physical link's source and Proton's cryptokey check dropped them on arrival. Now one rule per protocol's bypass device; test pins both.Round 2 needs a reinstall from the branch, then the same checks: bypass egress via
aqomui-bypass curl(and a fresh bypassed app),ip route show table 11, teardown fallback.97162df0eba5b9a6c675Round 2 root cause, fixed in the commit above: a WireGuard routing loop. The inner tcpdump on wg_aqomui_b showed the leg's own outer packets (192.168.0.205:41957 → endpoint:51820) re-entering the device and growing 64 bytes per pass until they fragmented - the outer data packets carry the bypassed app's fwmark, consult table 11, and its default steers them straight back in. Handshakes are WireGuard's own unmarked packets, so the tunnel came up fine and reported established; only data looped. Gigabytes counted as sent, nothing on the wire, no bypassed connection ever reached the server.
Same reason the OpenVPN bypass pins its endpoint in both tables - the WireGuard docstring's claim that outer packets never inherit the mark was wrong and is gone. The bypass leg now pins in table 11 as well; link_down clears both. Suite green. Round 3: reinstall, WG bypass, the same three checks.
e6bb2a412ed60eadc220Round 3 passed live (2026-09-17): WireGuard bypass carries bypassed traffic to the bypass server's exit, with the endpoint pinned in both tables and the gluetun network entry on table 12 (#222). Three faults fixed on the way, each with its own commit and test: the missing wg_aqomui_b masquerade, the outer-packet routing loop through table 11, and (separately merged) network entries riding the bypass tunnel. Ready to merge.