fix(incus): clamp TCP MSS on traffic forwarded through incusbr0 #1
Loading…
Reference in a new issue
No description provided.
Delete branch ":fix/incus-mss-clamp"
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?
Why
Forwarded traffic from Incus guests (Kubernetes nodes and pods) stalls on internet downloads. The rgxr CI runner's clones of
code.forgejo.orgdie at <100 KB/s, and rustup hangs onstatic.rust-lang.org. Every failed log stops right after the first chunk, at round sizes ("32752 / 49068 / 65504 bytes of body are still expected"). That is a path-MTU black hole: the WAN path MTU is below 1500 and full-size segments are dropped without ICMP. Handshakes succeed and bulk data never arrives.net.ipv4.tcp_mtu_probing = 1(modules/features/sysctl.nix) only protects sockets on the server itself. Pod egress is forwarded (pod → Cilium SNAT →incusbr0→ masquerade,docs/kubernetes/networking.md), and nothing clamps MSS anywhere in this repo or the gitops repos. GitHub works because it advertises a lower MSS than most hosts.What
modules/features/incus.nix: newincus-mss-clampnftables table (inet, forward hook, mangle priority). It lowers the MSS of TCP SYNs entering or leavingincusbr0to 1360, and only when above 1360.docs/kubernetes/networking.md: Path MTU paragraph under Pod Routing, with the verification command.Verify
ping -M do -s 1464 -c2 1.1.1.1should pass and-s 1472should fail. The largest passing size + 28 = path MTU; MSS = MTU − 40. 1360 is conservative (fits MTU ≥ 1400); tighten it if you like.nixos-rebuild switch:nft list table inet incus-mss-clampshows both rulescurl -o /dev/null -w '%{speed_download}\n' https://static.rust-lang.org/dist/rust-1.99.1-x86_64-unknown-linux-gnu.tar.xzruns at MB/snft -c(NixOS also runscheckRulesetat build).Notes
docs-htmlwas not regenerated (tern needs a TTY; the sandbox has none). Runnix develop path:. --command ternonce.