Skip to content

fix: the overlay's MTU is set live, and an old handshake is drift (keel#139, keel#140) - #143

Merged
marcos-mendez merged 1 commit into
mainfrom
fix/overlay-mtu-live
Oct 10, 2026
Merged

marcos-mendez merged 1 commit into
mainfrom
fix/overlay-mtu-live

Conversation

@marcos-mendez

@marcos-mendez marcos-mendez commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #139 and #140. Evidence: Keel-Linux/handbook#63, findings N7, N6 and N10.

#139 (N7)

After the upgrade to 0.23.13, wg0.conf had MTU = 1280 and the live wg0 kept 1420. Only wg-quick up reads the line, so apply planned nothing and diff had no MTU line.

  • keel/network/mtu.py (new): reads the live MTU (ip link show) and sets it with ip link set dev <iface> mtu N. This restarts nothing.
  • keel/network/switch.py (live_plan, mtu_line, wg_mtu): the live path sets the new file's MTU when the interface has another one. With no live MTU, a change of the MTU line is still a bounce, as is a file that drops it.
  • keel/system/overlay.py, keel/system/ovstate.py: a kept file whose interface has another MTU gets the ip link set action, said as drift.
  • keel network mtu (keel/cli.py, keel/commands.py) does it for each WireGuard interface that is up. The new debian/keel.postinst runs it on configure, so an upgrade needs no reboot. A failure is said and never fails the upgrade.
  • keel/diff/handshakes.py (mtu_fields): network.overlay.wireguard.mtu, the live MTU against the file's, on the live system.

#140 (N6, N10)

  • A last handshake older than 180 s is drift in keel diff and keel mesh status (WireGuard does a new handshake every 2 minutes while packets flow).
  • The drift says that the member does not answer and is unreachable. It no longer tells the operator to run keel mesh sync on that member.

Docs: docs/apply.md, docs/diff.md, docs/mesh.md. Version 0.23.15 (#136 holds 0.23.14).

Tests

  • Unit: tests/test_network_mtu.py (new), tests/test_system_overlay.py, tests/test_diff_handshakes.py, tests/test_mesh_create_status.py.
  • Bats: tests/postinst.bats (new), run from tests/test_hook_bats.py.
  • Real wg in a network namespace (tests/test_network_overlay_live_netns.py, in "mesh / trixie"): wg0 is set to 1420 under a file of MTU = 1280. A live change of the peers sets 1280 with no wg-quick, the same interface index and the same handshake. Then keel network mtu sets 1420 back to 1280.

CI

All 23 checks pass. vip-upgrade / trixie failed one time (run 38074400820, test_a_the_holder_restarted_as_an_upgrade_does: the VIP dropped for 4.47 s after the holder's try-restart). That test does not use the code of this PR, and the same job also failed one time on main. One rerun of the failed job passed.

…el#139, keel#140)

keel#139 (N7). After the upgrade to 0.23.13, wg0.conf had MTU = 1280
and the live wg0 kept 1420. Only wg-quick up reads the line: keel spec
apply planned nothing, keel diff had no MTU line, and only a reboot or
a manual wg-quick down/up fixed it.

- keel.network.mtu reads the live MTU (ip link show) and sets it with
  ip link set dev <interface> mtu N, which restarts nothing.
- The live path of keel.network.switch sets the new file's MTU when the
  interface has another one; with no live MTU, a change of the MTU line
  is still a bounce, as is a file that drops it.
- keel spec apply: a kept file whose interface has another MTU gets the
  same action, said as drift (keel.system.overlay).
- keel network mtu does it for each WireGuard interface that is up, and
  the package's postinst (debian/keel.postinst) runs it, so an upgrade
  needs no reboot. A failure is said and never fails the upgrade.
- keel diff reports network.overlay.wireguard.mtu: the live MTU against
  the file's, on the live system.

keel#140 (N6, N10). keel diff said "same" for a handshake 8 h old. A
last handshake older than 180 s is now drift in keel diff and keel mesh
status: WireGuard does a new handshake every 2 minutes while packets
flow. The drift says the member does not answer and is unreachable, and
no longer tells the operator to run keel mesh sync on it.

Tests: unit tests for the MTU read, the live plan, apply, keel network
mtu and keel diff; bats for the postinst; on the real wg in a network
namespace, wg0 set to 1420 under a file of MTU = 1280: a live change of
the peers sets 1280 with no wg-quick, the same interface and the same
handshake, and keel network mtu sets it again. Stale handshakes in keel
diff and keel mesh status.

Version 0.23.15 (#136 holds 0.23.14).
@marcos-mendez
marcos-mendez merged commit 7f7fe45 into main Oct 10, 2026
45 of 46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

an MTU change in wg0.conf is not applied live and keel diff does not show it

1 participant