mirror of
https://github.com/amnezia-vpn/amneziawg-linux-kernel-module.git
synced 2026-10-14 05:41:56 +00:00
[GH-ISSUE #191] Do upgraded amneziawg-tools + kernel module keep legacy (1.x) interfaces in 1.x mode, or force 2.0 ranged headers on all interfaces? #114
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
amnezia-vpn/amneziawg-linux-kernel-module#114
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Originally created by @iia-arg on GitHub (Jul 24, 2026).
Original GitHub issue: https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/issues/191
Hi, and thanks for AmneziaWG.
We run several self-hosted AmneziaWG servers using the raw
amneziawg-tools+ DKMS kernel module directly (wg-quick-style configs), not the AmneziaVPN desktop app. Our servers are currently on the 1.x protocol, and we have a number of active peers on 1.x configs plus server-to-server mesh links.We're planning a gradual migration to AmneziaWG 2.0 and need to confirm one thing the app-level docs don't cover for raw-tools deployments:
When we upgrade
amneziawg-toolsand the kernel module to the 2.0-capable version, will existing interfaces whose configs use only 1.x parameters (no rangedH1-H4, noI1-I5) keep operating in legacy 1.x mode and stay interoperable with existing 1.x peers?We ask because of #162: the 2.0 ranged-headers refactor appears to have made
mh_genheader()unconditional and left the per-peeradvanced_securityflag as dead code. If header generation is now unconditional, upgrading the module might force 2.0-style headers on all interfaces and break our 1.x peers on software-upgrade alone — before we've migrated anyone.Concretely:
Thanks in advance.
@bivlked commented on GitHub (Aug 4, 2026):
I run raw tools plus DKMS self-hosted as well and had the same question before upgrading, so I built a test for it today. Everything below is on
v3.0.20260731-04from the PPA with toolsv3.0.20260730, two namespaces on one host.Jc/Jmin/Jmax,S1,S2, scalarH1-H4, noS3/S4, noI1-I5S1-S4, rangedH1-H4,I1HeaderProtectionKeyand the new timer keysAll four came up and passed traffic at the same time, 0% loss on each.
That is not only cosmetic. I captured the handshake initiation for two of the four:
01 00 00 00, soMESSAGE_HANDSHAKE_INITIATIONS1 = 100andH1 = 1234567: payload is 248 bytes (100 + 148), at offset 100 sits87 d6 12 00, which is 1234567 little-endian, and ahead of it are four junk packets of 41 to 63 bytes fromJc = 4So a scalar
Hputs that exact constant on the wire, at the offsetS1gives it. The values are ranges internally now, but the parser turns a value with no dash intohi = lo, anddevice.cinitialises the unset ones toMESSAGE_HANDSHAKE_INITIATIONthroughMESSAGE_DATA, so a one-element range has nothing to randomise.First,
H1-H4andS1-S4are per-interface, not per-peer, so they cannot differ between peers on one interface. TheSvalues have to be equal on both ends, since the receiver reads the message type at exactly that offset. TheHvalues have to be compatible rather than identical, because the sender picks from its own range and the receiver only checks that the value falls inside its own, though with per-interface scoping that distinction rarely buys you anything.Second, and this is the one that would have caught me out:
awg setconfcannot unset these parameters. I setJc,S4,H1,I1,ContentPaddingAdditionandRekeyAfterTimeon an interface, then applied a config with nothing in it butPrivateKeyandListenPort, and all six were still in place afterwards. So an interface cannot be walked back a generation in place, it has to be deleted and recreated.Which makes the route you sketched the right one: a second interface on a second port, peers moved across one at a time, old interface removed once it is empty.
On #162, the per-peer field is gone from
peer.h. The netlink attributeWGPEER_A_ADVANCED_SECURITYis still there and configs still acceptAdvancedSecurity, but nothing reads it. I setAdvancedSecurity = onat both ends of one peer andawg showconfstill reportsoff.The mixed-mode case that issue is about does still fail, and I checked rather than assumed: I pointed a client with no AWG parameters at the 1.x-style interface above and got no handshake, 100% loss. That is the per-interface scoping again rather than anything the upgrade did to you.
What I did not test is a genuinely old 1.x build on the far end, since one kernel means one module. What I did show is that the current module puts 1.x bytes on the wire when it is given a 1.x config.