Score:0

I can't get my WIreguard tunnel to complete a handshake

cn flag

I'm trying to setup a point-to-site wireguard tunnel between two different points on two seperate networks, but have setup similar tunnels setup in similar situations so I don't believe it has anything to do with the infrastructure between my tunnel's endpoints.

On one side I have a vm Windows Client with the following configuration

[Interface]
PrivateKey = iOoRnq+ngYGZFGpSqnRGgBsUvh9AVtWAXZGEw2Ir1FI=
Address = 10.1.3.11/32
DNS = 8.8.8.8

[Peer]
PublicKey = +IrgeRu8nRBMWZrR8Grrxfe6mhSBUihyKKeKsoPJCGM=
AllowedIPs = 0.0.0.0/0
Endpoint = 172.16.2.53:51820
PersistentKeepalive = 15

On the other side is a vm Ubuntu Server (acting as a router) with the following configuration

[Interface]
PrivateKey = +PYij5eViZfalUxsxR8XHf4xX8Jwiap7SyGn/Ok992k=[Interface]
PrivateKey = +PYij5eViZfalUxsxR8XHf4xX8Jwiap7SyGn/Ok992k=
Address = 10.1.3.10/32
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT
PostUp = iptables -t nat -A POSTROUTING -o ens33 -j MASQUERADE
PostUp = iptables -t nat -A POSTROUTING -o ens37 -j MASQUERADE
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT
PostDown = iptables -t nat -D POSTROUTING -o ens33 -j MASQUERADE
PostDown = iptables -t nat -D POSTROUTING -o ens37 -j MASQUERADE
ListenPort = 51820

[Peer]
PublicKey = T54bRdcw6J5QqOm1VsIjX0bH9GJvhreZQTwzBFCEgnc=
AllowedIPs = 10.1.3.11/32
~

I know both ends are talking to each other because I can see the transfer stats on the windows side showing data being recieved and sent.

In the logs on the windows client, I have this:


2022-05-17 20:10:33.330829: [TUN] [LAN-Router] Peer 1 created
2022-05-17 20:10:33.334575: [TUN] [LAN-Router] Monitoring MTU of default v6 routes
2022-05-17 20:10:33.332262: [TUN] [LAN-Router] Sending keepalive packet to peer 1 (172.16.2.53:51820)
2022-05-17 20:10:33.332958: [TUN] [LAN-Router] Sending handshake initiation to peer 1 (172.16.2.53:51820)
2022-05-17 20:10:33.334575: [TUN] [LAN-Router] Interface up
2022-05-17 20:10:33.345348: [TUN] [LAN-Router] Setting device v6 addresses
2022-05-17 20:10:33.350652: [TUN] [LAN-Router] Receiving handshake response from peer 1 (172.16.2.53:51820)
2022-05-17 20:10:33.350652: [TUN] [LAN-Router] Keypair 1 created for peer 1
2022-05-17 20:10:33.361014: [TUN] [LAN-Router] Monitoring MTU of default v4 routes
2022-05-17 20:10:33.361014: [TUN] [LAN-Router] Setting device v4 addresses
2022-05-17 20:10:33.403831: [TUN] [LAN-Router] Startup complete
2022-05-17 20:10:48.459601: [TUN] [LAN-Router] Retrying handshake with peer 1 (172.16.2.53:51820) because we stopped hearing back after 15 seconds
2022-05-17 20:10:48.459601: [TUN] [LAN-Router] Sending handshake initiation to peer 1 (172.16.2.53:51820)
2022-05-17 20:10:50.275215: [TUN] [LAN-Router] Receiving keepalive packet from peer 1 (172.16.2.53:51820)
2022-05-17 20:10:53.585242: [TUN] [LAN-Router] Handshake for peer 1 (172.16.2.53:51820) did not complete after 5 seconds, retrying (try 2)
2022-05-17 20:10:53.585242: [TUN] [LAN-Router] Sending handshake initiation to peer 1 (172.16.2.53:51820)
2022-05-17 20:10:56.294435: [TUN] [LAN-Router] Receiving handshake response from peer 1 (172.16.2.53:51820)
2022-05-17 20:10:56.294435: [TUN] [LAN-Router] Keypair 2 created for peer 1
2022-05-17 20:10:56.294435: [TUN] [LAN-Router] Sending keepalive packet to peer 1 (172.16.2.53:51820)
2022-05-17 20:11:12.348180: [TUN] [LAN-Router] Retrying handshake with peer 1 (172.16.2.53:51820) because we stopped hearing back after 15 seconds
2022-05-17 20:11:12.348180: [TUN] [LAN-Router] Sending handshake initiation to peer 1 (172.16.2.53:51820)
2022-05-17 20:11:13.373244: [TUN] [LAN-Router] Receiving handshake initiation from peer 1 (172.16.2.53:51820)
2022-05-17 20:11:13.373244: [TUN] [LAN-Router] Sending handshake response to peer 1 (172.16.2.53:51820)
2022-05-17 20:11:13.382240: [TUN] [LAN-Router] Keypair 1 destroyed for peer 1
2022-05-17 20:11:13.382240: [TUN] [LAN-Router] Keypair 3 created for peer 1
2022-05-17 20:11:13.384241: [TUN] [LAN-Router] Invalid handshake response from 172.16.2.53:51820
2022-05-17 20:11:17.360089: [TUN] [LAN-Router] Handshake for peer 1 (172.16.2.53:51820) did not complete after 5 seconds, retrying (try 2)
2022-05-17 20:11:18.524497: [TUN] [LAN-Router] Receiving handshake initiation from peer 1 (172.16.2.53:51820)
2022-05-17 20:11:18.524497: [TUN] [LAN-Router] Sending handshake response to peer 1 (172.16.2.53:51820)
2022-05-17 20:11:18.528377: [TUN] [LAN-Router] Keypair 3 destroyed for peer 1
2022-05-17 20:11:18.528377: [TUN] [LAN-Router] Keypair 4 created for peer 1
2022-05-17 20:11:18.530502: [TUN] [LAN-Router] Receiving keepalive packet from peer 1 (172.16.2.53:51820)
2022-05-17 20:11:41.490680: [TUN] [LAN-Router] Retrying handshake with peer 1 (172.16.2.53:51820) because we stopped hearing back after 15 seconds
2022-05-17 20:11:41.491688: [TUN] [LAN-Router] Sending handshake initiation to peer 1 (172.16.2.53:51820)
2022-05-17 20:11:43.383896: [TUN] [LAN-Router] Receiving handshake initiation from peer 1 (172.16.2.53:51820)
2022-05-17 20:11:43.383896: [TUN] [LAN-Router] Sending handshake response to peer 1 (172.16.2.53:51820)
2022-05-17 20:11:43.387327: [TUN] [LAN-Router] Keypair 2 destroyed for peer 1
2022-05-17 20:11:43.387327: [TUN] [LAN-Router] Keypair 5 created for peer 1
2022-05-17 20:11:57.082780: [TUN] [LAN-Router] Shutting down
2022-05-17 20:11:57.097321: [MGR] [LAN-Router] Tunnel service tracker finished

Both sides seem to be talking to each other but are not agree on something or maybe the same kind of packet is getting lost. I turned off the firewall on the ubuntu server router to make sure that wasn't my problem. I've tried googling these irregular lines in the logs but the best solution I find is to retry making keys which I've done several times. What am I doing wrong?

Molotch avatar
us flag
Did you solve this? I have the same problem, wireguard setup works great from my iPhone but the same config doesn't work with windows, fails at handshake. Seems to be an windows issue.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.