[GH-ISSUE #132] Latest master fails to establish connection between two peers: Invalid handshake initiation from #83

Open
opened 2026-10-13 21:06:21 +00:00 by bsakaguchi · 3 comments
Owner

Originally created by @abashurov on GitHub (Jan 7, 2026).
Original GitHub issue: https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/issues/132

Server A configuration:
Debian 13 6.12.57+deb13-amd64
Kernel module built from tip of the master (problem reproduces using the packages from the PPA as well)

awg1.conf:

[Interface]
Address = 10.0.88.2/30
PrivateKey = <...>
ListenPort = 52000
Table = off

Jc = 7
Jmin = 50
Jmax = 1000
S1 = 92
S2 = 89
H1 = 187940053
H2 = 1494842072
H3 = 1171910757
H4 = 2102394274

[Peer]
PublicKey = <...>
Endpoint = IP1:52000
AllowedIPs = 0.0.0.0/0

dmesg:

[Thu Jan  8 02:32:29 2026] amneziawg: awg1: Handshake for peer 6 (IP1:52000) did not complete after 5 seconds, retrying (try 6)
[Thu Jan  8 02:32:29 2026] amneziawg: awg1: Sending handshake initiation to peer 6 (IP1:52000)
[Thu Jan  8 02:32:29 2026] amneziawg: awg1: Sending dummy junk packets to 6 (IP1:52000)
[Thu Jan  8 02:32:34 2026] amneziawg: awg1: Handshake for peer 6 (IP1:52000) did not complete after 5 seconds, retrying (try 7)
[Thu Jan  8 02:32:34 2026] amneziawg: awg1: Sending handshake initiation to peer 6 (IP1:52000)
[Thu Jan  8 02:32:34 2026] amneziawg: awg1: Sending dummy junk packets to 6 (IP1:52000)

Server B configuration:
Debian 13, 6.12.57+deb13-amd64
Kernel module built from tip of the master (problem reproduces using the packages from the PPA as well)

awg0.conf:

# Egress
[Interface]
PrivateKey = <...>
Address = 10.0.88.1/24
ListenPort = 52000

Jc = 7
Jmin = 50
Jmax = 1000
S1 = 92
S2 = 88
H1 = 187940053
H2 = 1494842072
H3 = 1171910757
H4 = 2102394274

PreUp = <...>
PostDown = <...>

[Peer]
PublicKey = <...>
Endpoint = IP2:52000
AllowedIPs = 10.0.88.2/32

dmesg from server B:

[Thu Jan  8 02:32:29 2026] amneziawg: awg0: Unknown message from IP2:52000 encountered, packet dropped
[Thu Jan  8 02:32:29 2026] amneziawg: awg0: Unknown message from IP2:52000 encountered, packet dropped
[Thu Jan  8 02:32:29 2026] amneziawg: awg0: Unknown message from IP2:52000 encountered, packet dropped
[Thu Jan  8 02:32:34 2026] amneziawg: awg0: Unknown message from IP2:52000 encountered, packet dropped
[Thu Jan  8 02:32:34 2026] amneziawg: awg0: unknown peer from IP2:52000
[Thu Jan  8 02:32:34 2026] amneziawg: awg0: Invalid handshake initiation from IP2:52000
Originally created by @abashurov on GitHub (Jan 7, 2026). Original GitHub issue: https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/issues/132 Server A configuration: Debian 13 6.12.57+deb13-amd64 Kernel module built from tip of the master (problem reproduces using the packages from the PPA as well) awg1.conf: ``` [Interface] Address = 10.0.88.2/30 PrivateKey = <...> ListenPort = 52000 Table = off Jc = 7 Jmin = 50 Jmax = 1000 S1 = 92 S2 = 89 H1 = 187940053 H2 = 1494842072 H3 = 1171910757 H4 = 2102394274 [Peer] PublicKey = <...> Endpoint = IP1:52000 AllowedIPs = 0.0.0.0/0 ``` dmesg: ``` [Thu Jan 8 02:32:29 2026] amneziawg: awg1: Handshake for peer 6 (IP1:52000) did not complete after 5 seconds, retrying (try 6) [Thu Jan 8 02:32:29 2026] amneziawg: awg1: Sending handshake initiation to peer 6 (IP1:52000) [Thu Jan 8 02:32:29 2026] amneziawg: awg1: Sending dummy junk packets to 6 (IP1:52000) [Thu Jan 8 02:32:34 2026] amneziawg: awg1: Handshake for peer 6 (IP1:52000) did not complete after 5 seconds, retrying (try 7) [Thu Jan 8 02:32:34 2026] amneziawg: awg1: Sending handshake initiation to peer 6 (IP1:52000) [Thu Jan 8 02:32:34 2026] amneziawg: awg1: Sending dummy junk packets to 6 (IP1:52000) ``` Server B configuration: Debian 13, 6.12.57+deb13-amd64 Kernel module built from tip of the master (problem reproduces using the packages from the PPA as well) `awg0.conf`: ``` # Egress [Interface] PrivateKey = <...> Address = 10.0.88.1/24 ListenPort = 52000 Jc = 7 Jmin = 50 Jmax = 1000 S1 = 92 S2 = 88 H1 = 187940053 H2 = 1494842072 H3 = 1171910757 H4 = 2102394274 PreUp = <...> PostDown = <...> [Peer] PublicKey = <...> Endpoint = IP2:52000 AllowedIPs = 10.0.88.2/32 ``` dmesg from server B: ``` [Thu Jan 8 02:32:29 2026] amneziawg: awg0: Unknown message from IP2:52000 encountered, packet dropped [Thu Jan 8 02:32:29 2026] amneziawg: awg0: Unknown message from IP2:52000 encountered, packet dropped [Thu Jan 8 02:32:29 2026] amneziawg: awg0: Unknown message from IP2:52000 encountered, packet dropped [Thu Jan 8 02:32:34 2026] amneziawg: awg0: Unknown message from IP2:52000 encountered, packet dropped [Thu Jan 8 02:32:34 2026] amneziawg: awg0: unknown peer from IP2:52000 [Thu Jan 8 02:32:34 2026] amneziawg: awg0: Invalid handshake initiation from IP2:52000 ```
Author
Owner

@abashurov commented on GitHub (Jan 7, 2026):

This does look like the problem that was present in #88, however, as I can see, the from that issue is merged into master.
Unfortunately, I could not bisect the problem, as it is persistent throughout all the commits in master within the last 2 years.

UPD Problem does not reproduce when running on Ubuntu 24.04 with 6.8.0-90-generic kernel

<!-- gh-comment-id:3720871410 --> @abashurov commented on GitHub (Jan 7, 2026): This does look like the problem that was present in #88, however, as I can see, the from that issue is merged into master. Unfortunately, I could not bisect the problem, as it is persistent throughout all the commits in master within the last 2 years. UPD Problem does not reproduce when running on Ubuntu 24.04 with 6.8.0-90-generic kernel
Author
Owner

@h1de0x commented on GitHub (Jan 9, 2026):

This may seem strange, but could you try changing the jmin parameter to 10 and jmax to 80?

<!-- gh-comment-id:3729913812 --> @h1de0x commented on GitHub (Jan 9, 2026): This may seem strange, but could you try changing the jmin parameter to 10 and jmax to 80?
Author
Owner

@ygurov commented on GitHub (Jan 10, 2026):

Hi
As from configuration, you have

S1 = 92
S2 = 89

for the 1st device

And

S1 = 92
S2 = 88

for the 2nd one.

So 1st dev is able to transfer correct initial message, and 2nd dev recognizes it and responds with invalid handshake response, which 1st dev cannot handle properly

Please try to use the same padding sizes from both sides, that should resolve the issue

<!-- gh-comment-id:3732787019 --> @ygurov commented on GitHub (Jan 10, 2026): Hi As from configuration, you have ``` S1 = 92 S2 = 89 ``` for the 1st device And ``` S1 = 92 S2 = 88 ``` for the 2nd one. So 1st dev is able to transfer correct initial message, and 2nd dev recognizes it and responds with invalid handshake response, which 1st dev cannot handle properly Please try to use the same padding sizes from both sides, that should resolve the issue
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
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
amnezia-vpn/amneziawg-linux-kernel-module#83
No description provided.