Repository navigation
fix(net): default WireGuard gateway and StartTunnel MTU to 1280 - #4816
Conversation
A WireGuard tunnel nested in another VPN, or on a path narrower than 1500 bytes, silently drops packets sized for the 1420-byte default: large TLS flights stall while small requests succeed (#4788). Until path-MTU detection lands, use the IPv6 minimum MTU wherever a WireGuard config states none: StartOS gateways, StartTunnel's interface, and the device configs StartTunnel exports. StartTunnel's forwarded-TCP MSS clamp follows the interface MTU. Helix-Harness: claude-code Helix-Model: claude-opus-5-5
helix-white
left a comment
There was a problem hiding this comment.
Approved at 1f962fcc7d239c8adeadb66ff119e16f2385313a. No blocking correctness findings.
Checked the shared MTU default through gateway parsing, NetworkManager settings, add/update callers, and StartTunnel's server/client configuration rendering. Explicit MTUs still win; updating an automatic-MTU gateway selects reactivation rather than the unsupported Reapply path. StartTunnel's startup and network-sync paths consume the rendered server config. The regression assertions cover the default, explicit override, reactivation decision, and both configuration templates.
git merge-tree --write-tree origin/master HEAD succeeds. Reviewed the available CI results; builds and test jobs were still pending. No builds or tests run during review.
The documented migration question remains a maintainer decision: existing StartOS profiles do not acquire this default until their configuration is updated. Approval covers that stated add/update scope, not an automatic migration.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Gateways added before MTU support sat on NetworkManager's automatic MTU, which no user chose. 0.4.3's post_up now sets every saved WireGuard profile without an explicit MTU to WIREGUARD_DEFAULT_MTU through nmcli, which keeps the profile's secrets, and reconnects the active ones. A failure is logged and startup continues. The migration revision bump re-runs it on servers already at 0.4.3. Migration code lives in its version file; start-core's AGENTS.md now states that rule. Helix-Harness: claude-code Helix-Model: claude-opus-5-5
|
@dr-bonez decided existing gateways must be migrated: no MTU could be set before #4791, so an automatic MTU was never anyone's choice. |
helix-white
left a comment
There was a problem hiding this comment.
Approved at 5f932fd78f0e8d45bbb391876e985deac4a7bcc1. No blocking correctness findings in the migration added since my previous review.
Checked automatic-versus-explicit profile selection, the targeted nmcli connection modify operation, active-profile reactivation, continued attempts after per-profile failures, and warning-only startup behavior. The shared settings helpers preserve the existing gateway-update semantics. Revision 1 correctly requeues post_up for existing 0.4.3 revision-0 installations; the added regression covers that queueing exactly once. Migration code remains in its version file as requested.
The previous migration scope question is now resolved by the recorded maintainer decision and implementation. git merge-tree --write-tree origin/master HEAD succeeds. Available CI checks show no failures, with builds and tests still pending when inspected. No builds or tests run during review; live NetworkManager/reconnect verification remains unexecuted as disclosed in the description.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Dismissed by Helix: the changes require a substantive PR brief update. The original approval covered gateway add/update and explicitly excluded automatic migration. The added 0.4.3 post_up migration changes saved automatic-MTU WireGuard profiles to 1280, reconnects active profiles, and uses migration revision 1 to run on existing 0.4.3 installations. This changes existing-install behavior and rollout, requiring replacement of the reviewed brief's statement that existing gateways remain unchanged until their configuration is updated.
…rvative-mtu Helix-Harness: claude-code Helix-Model: claude-opus-5-5 # Conflicts: # shared-libs/crates/start-core/src/version/mod.rs # shared-libs/crates/start-core/src/version/v0_4_3.rs
master published 0.4.3 revision 1 with the range-grouping up(). Revision 2 makes alpha servers already at revision 1 also run the WireGuard MTU post_up; up() stays idempotent. Helix-Harness: claude-code Helix-Model: claude-opus-5-5
|
Merged current
|
helix-white
left a comment
There was a problem hiding this comment.
Approved at c7ec6774b5267bb6f3c0790eaeba2633934ed0ec. No blocking findings since the previous approval.
Inspected 7976eacea with git show --remerge-diff: the resolution preserves master's range-grouping up() and its helpers/tests alongside the MTU post_up() and its helpers/tests. The gateway and StartTunnel implementations are unchanged from the previously reviewed head.
Revision 2 correctly requeues the MTU migration for existing 0.4.3 revision-1 installations as well as revision 0. Checked the migration loader/commit path, the expanded exactly-once queue test, and the retained range-grouping operation and idempotence assertion; rerunning that database step is consistent with its semantics.
git merge-tree --write-tree origin/master HEAD succeeds. CI was still pending when inspected; no builds or tests run during review.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Dismissed by Helix: the changes require a substantive PR brief update. The migration gate changes from revision 1 to 2. Existing 0.4.3 revision-1 installations, previously treated as complete, now rerun the range-grouping up() and queue the MTU post_up(). Although range grouping itself comes from master and the MTU implementation is unchanged, this changes rollout eligibility and migration replay. The reviewed brief must explain coverage of revision-1 installations and the idempotent replay of their existing database migration.
…rvative-mtu Helix-Harness: claude-code Helix-Model: claude-opus-5-5 # Conflicts: # shared-libs/crates/start-core/src/version/v0_4_3.rs
master published 0.4.3 revision 2 with the SSH key move. Revision 3 makes alpha servers already at revision 2 also run the WireGuard MTU post_up; up() stays idempotent. Helix-Harness: claude-code Helix-Model: claude-opus-5-5
|
Merged current
|
helix-white
left a comment
There was a problem hiding this comment.
Approved at 41e584f8db0f0edc89b44ec0d6ee6283836ef7c5. No blocking findings since the previous approval.
Inspected eb12f6ccb with git show --remerge-diff and compared its resolved migration against its master parent. The SSH-key up()/down() steps, helper and tests are preserved alongside the unchanged MTU post_up() implementation.
Revision 3 correctly queues the MTU step for existing 0.4.3 revision-2 installations. Checked the expanded exactly-once queue coverage for revisions 0, 1 and 2, and replay safety: the SSH move retains the existing destination key collection, while the range-grouping operation remains idempotent. The retained SSH tests cover metadata preservation, repeated application, rollback and migration before typed database decoding.
git merge-tree --write-tree origin/master HEAD succeeds. CI remained pending when inspected; no builds or tests run during review.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Dismissed by Helix: the changes require a substantive PR brief update. Raising the migration revision from 2 to 3 makes existing 0.4.3 revision-2 installations execute the MTU post_up(), whereas the reviewed head treated revision 2 as complete. This also replays the upstream SSH-key and range-grouping up() steps. The brief must update rollout coverage from revisions 0–1 to 0–2 and explain replay safety; this is a behavioral migration-gate change, not merely bookkeeping.
Summary
WireGuard tunnels now default to an MTU of 1280, the IPv6 minimum, wherever a config states none:
MTU =line getswireguard.mtu = 1280instead of NetworkManager's automatic MTU. An explicitMTU =still wins, with the existing validation: at least 68, and at least 1280 when the config has an IPv6 address. Updating a gateway that was on the automatic MTU now changes its MTU, so NetworkManager reconnects it once rather than applying the change in place, which it cannot do for an MTU.wireguard.mtu = 1280, and each active one reconnects once. No MTU could be set before MTU support (fix(gateway): honor WireGuard MTU on gateway import and update #4791), so an automatic MTU was never a user's choice; a profile with an explicit MTU is left alone. The change goes throughnmcli connection modify, which keeps the profile's private key and preshared keys. Writing the settings back over D-Bus would need those secrets merged in by hand. A failure is logged as a warning and startup continues, so a NetworkManager problem cannot stop the server booting; a gateway that fails stays at 1420 until its config is updated. 0.4.3 has already shipped as release candidates, andmasterhas since published two more 0.4.3 database steps to alpha: fix(core): keep a range's public IP on with its plain public domain across a renumber #4666's range grouping at revision 1, and fix(start-os): update re-added SSH keys in place and publish them to patch-db #4757's SSH-key move at revision 2. This PR raises the revision to 3, so every server already on 0.4.3, at revision 0, 1 or 2, runs this step once on its next boot. Re-running those database steps is harmless, since running either twice gives the same result.wg-start-tunnelinterface comes up at 1280, and every device config StartTunnel exports carriesMTU = 1280. StartTunnel rewrites its interface config and restarts the interface on every sync, so existing installs move to 1280 at their next restart or update, and on any device or subnet change. The forwarded-TCP clamp sizes segments from the interface MTU, so TCP forwarded to devices now uses an MSS of 1240 instead of 1380.Both products read one constant,
WIREGUARD_DEFAULT_MTUinnet/gateway.rs. The migration lives inversion/v0_4_3.rs.net/gateway.rsonly exposes the NetworkManager primitives it needs at crate visibility, and gainssettings_uuid, now shared with the gateway update path. start-core'sAGENTS.mdnow states the rule that migration code always lives in its version file.Implementation diff: +129 / −22 lines in 5 files (excludes lockfiles, tests, docs, release notes, and changelog). Most of it is the migration in
v0_4_3.rs. The count also leaves out the 8 lines inlocales/i18n.yamlthat add the warning message in five languages.Why
#4788: a service published through StartTunnel stalled after the TLS Server Hello. The server's home connection runs through another WireGuard VPN, which leaves about 1340 bytes for StartTunnel's tunnel, so StartTunnel's 1420-byte packets were silently dropped while small ones got through. The user's pings fit this: 1200-byte pings were answered, 1392-byte pings were not. Setting
wg-start-tunnelto 1280 by hand fixed it, but each re-sync reverted it. The TCP clamp already existed, but it trusts the interface MTU, so with 1420 configured it sized segments for 1420.1280 is a chosen conservative value, not a measured one. It fits WireGuard nested inside one other WireGuard tunnel over IPv6, or two over IPv4, and keeps IPv6 usable through the tunnel. The cost is about 10% less payload per full-size packet on paths that could carry 1420. Deeper nesting still breaks. Automatic path-MTU detection, and a fragmenting shim for paths below 1280, are drafted as an AGCP extension in #4817. A saved per-install MTU override, the other part of #4788, is not in this PR.
Neighbors
MTU = 1280still import there. StartWRT's own WireGuard defaults are unchanged.MTU =when importing a config, so they keep the automatic MTU even for new StartTunnel configs.Testing
make start-core-testviahelix-buildon this branch's head (41e584f8d, after merging currentmaster): 1886 passed, 0 failed, plus the ignored backup-worker suite (3 passed).MTUparses to 1280 and produces NetworkManager settings withwireguard.mtu = 1280;MTU = 1280;make start-core-format-checkand Prettier on the changelog fragments pass.nmclicalls against a live NetworkManager, the reconnect, and the nested-VPN case from WireGuard tunnel MTU can't be adapted to the path — add path-MTU detection plus a manual MTU setting in StartTunnel and StartOS gateways #4788 unverified.41e584f8d: all 38 checks that ran passed. These include start-core tests and man pages, generated bindings, formatting, StartWRT tests, and every OS image and migration-image build. The 21 deploy and image-variant jobs were skipped, as they are for every pull request.Helix-Harness: claude-code
Helix-Model: claude-opus-5-5