add: bypass entries for forwarded source networks #120
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/network-bypass"
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?
Problem
The bypass only reaches local sockets: forwarded packets (containers, LAN clients) have no socket to put in the cgroup, so they ride the tunnel with no opt-out. A container running its own VPN gets silently double-tunnelled — measured at roughly half its throughput on #116 — and its connection state becomes coupled to the host VPN's.
Fix
Network bypass entries: user-listed source networks whose forwarded traffic is marked into table 11 via a dedicated mangle chain (
aqomui_bypass_net), jumped to from PREROUTING — the routing decision sits before FORWARD, so that is the only chain where the mark can steer policy routing. Optional protocol/port qualifiers keep an entry as narrow as one service's tunnel transport.config.json(bypass_networks) and ride the existing cfgupdate channel — no new D-Bus surface;load_firewallalready reloads settings before everybypass()re-apply, andreconcile_bypassrestores the rules across service restarts (the manual workaround rule from #116 did not survive a day).clear_fwmark_rules-style tolerance — idempotent, no memory of a previous service's state needed.utils.parse_network_entry(GUI at entry time, service at apply time — they end up as root iptables arguments; one bad entry is skipped and logged, not fatal to the rest).aqomui/gui/netbypass.py.firewall.ipt_cmdextracted fromadd_rule(first commit) so chain management can pick the right binary withoutadd_rule's check-then-add logging quirks.Verification
tests/test_utils.pyparse/reject cases,tests/test_bypass.pyrule-builder cases; full suite green (the twotest_mgmtsocket failures exist on trunk).172.18.7.0/24udp 51820) via the GUI, confirm zero bytes ontun_aqomuiduring an in-container download, then a service restart to confirm reconcile restores the chain.Closes #116.
🤖 Generated with Claude Code
Live round complete on the installed branch build:
Merge-ready.