Bypass never comes up after a reboot - and takes the bypass_networks exemptions down with it #168

Closed
opened 2026-08-26 13:39:15 -04:00 by mysticalsoap · 1 comment
Owner

After a machine reboot nothing rebuilds the bypass: reconcile_bypass at service start only restores a bypass whose leftover cgroup survived (a fresh boot has none), service_recovered in the gui only fires when the service restarts under a running gui, and no plain gui-startup path calls bypass(). The whole stack — cgroup, fwmark rule, table-11 default, and set_network_rules — stays down until the user happens to hit Apply in options.

Confirmed live 2026-08-26: last 'Creating bypass' log line Aug 24 22:46, machine rebooted Aug 25 morning (resolved PID change), multiple gui launches and tunnel sessions since — zero rebuilds, iptables-legacy -t mangle -S shows no aqomui_bypass_net chain. Consequence, captured on the wire: with the tunnel up, gluetun's WireGuard endpoint traffic (172.18.7.0/24 udp/51820, exactly the configured bypass_networks entry) leaves via tun_aqomui instead of enp5s0 — the container VPN double-tunnels through the OpenVPN connection, carrying the full seeding load. That is the confirmed mechanism behind (at least the post-reboot share of) #118's tunnel UDP-loss windows.

Fix shape, two independent halves:

  • The uid-independent parts (set_network_rules, the fwmark rules and table-11 default) belong to service startup whenever bypass=1 — forwarded-traffic exemptions need no cgroup owner and shouldn't wait for one. The service already derives its own network facts (#89), and network_changed can re-assert them.
  • The cgroup half still needs a desktop uid: the gui should call bypass() on every startup, not only in service_recovered — and note the early-call failure seen Aug 24 18:22 (polkit refusal of a caller mid-service-start, #162's vanished-caller case) has no retry, so even that path can silently leave the bypass down.

🤖 Generated with Claude Code

After a machine reboot nothing rebuilds the bypass: `reconcile_bypass` at service start only restores a bypass whose leftover cgroup survived (a fresh boot has none), `service_recovered` in the gui only fires when the *service* restarts under a running gui, and no plain gui-startup path calls `bypass()`. The whole stack — cgroup, fwmark rule, table-11 default, and `set_network_rules` — stays down until the user happens to hit Apply in options. Confirmed live 2026-08-26: last 'Creating bypass' log line Aug 24 22:46, machine rebooted Aug 25 morning (resolved PID change), multiple gui launches and tunnel sessions since — zero rebuilds, `iptables-legacy -t mangle -S` shows no `aqomui_bypass_net` chain. Consequence, captured on the wire: with the tunnel up, gluetun's WireGuard endpoint traffic (`172.18.7.0/24` udp/51820, exactly the configured `bypass_networks` entry) leaves via `tun_aqomui` instead of `enp5s0` — the container VPN double-tunnels through the OpenVPN connection, carrying the full seeding load. That is the confirmed mechanism behind (at least the post-reboot share of) #118's tunnel UDP-loss windows. Fix shape, two independent halves: - The uid-independent parts (`set_network_rules`, the fwmark rules and table-11 default) belong to service startup whenever `bypass=1` — forwarded-traffic exemptions need no cgroup owner and shouldn't wait for one. The service already derives its own network facts (#89), and `network_changed` can re-assert them. - The cgroup half still needs a desktop uid: the gui should call `bypass()` on every startup, not only in `service_recovered` — and note the early-call failure seen Aug 24 18:22 (polkit refusal of a caller mid-service-start, #162's vanished-caller case) has no retry, so even that path can silently leave the bypass down. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

Live-verified 2026-09-16 on the first aqomui start after a 2026-09-13 reboot (pristine state confirmed beforehand: no fwmark rule, no table 11, no chain). Service init applied ownerless routing, GUI start built the cgroup — no manual Apply. ip rule shows fwmark 0xb → table 11 (default via enp5s0), and iptables-legacy -t mangle -S shows the aqomui_bypass_net mark rule for 172.18.7.0/24 udp/51820.

Live-verified 2026-09-16 on the first aqomui start after a 2026-09-13 reboot (pristine state confirmed beforehand: no fwmark rule, no table 11, no chain). Service init applied ownerless routing, GUI start built the cgroup — no manual Apply. `ip rule` shows fwmark 0xb → table 11 (default via enp5s0), and `iptables-legacy -t mangle -S` shows the aqomui_bypass_net mark rule for 172.18.7.0/24 udp/51820.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mysticalsoap/aqomui#168
No description provided.