Project

General

Profile

Actions

Bug #12399

closed

WireGuard v0.1.5 - Tunnel Will Never Handshake Again After WAN Reset

Added by Ryan Roosa about 3 years ago. Updated over 1 year ago.

Status:
Resolved
Priority:
High
Category:
WireGuard
Target version:
Start date:
09/23/2021
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
22.01
Affected Version:
Affected Plus Version:
Affected Architecture:
All

Description

Hi Christian,
Really appreciate your work on the Wireguard package for pfSense :)

Sadly, there seems to be a show-stopping bug for me in the package. If my WAN connection drops due to an intentional modem reboot or other ISP issue, and is subsequently restored, my configured WireGuard tunnel in pfSense ceases to handshake after the WAN comes back even if I restart WireGuard services and/or restart pfSense completely. The only way I can get it to handshake again is by removing the configured Peer, completely removing the assigned interface from the Tunnel, deleting the tunnel, then recreating everything and re-associating all my firewall rules with the newly re-created interface. As you an can imagine this a quite a painful process.

I have tried simply disabling/re-enabling the assigned tunnel interface with an without the WireGuard services running but that does not make any different; the tunnel has to be completely removed and re-created for handshaking to occur. This issue is easily reproduceable by restarting my ISP modem. Below are the pfSense system logs during the modem reboot (WAN drop and re-establishment) along with the ifconfig output of my tun_wg0 interface, not sure if they are helpful:

Sep 23 09:24:58 rc.gateway_alarm 29027 >>> Gateway alarm: WANGW (Addr:192.168.7.1 Alarm:0 RTT:.476ms RTTsd:.426ms Loss:5%)
Sep 23 09:24:58 check_reload_status 375 updating dyndns WANGW
Sep 23 09:24:58 check_reload_status 375 Restarting ipsec tunnels
Sep 23 09:24:58 check_reload_status 375 Restarting OpenVPN tunnels/interfaces
Sep 23 09:24:58 check_reload_status 375 Reloading filter
Sep 23 09:25:00 xinetd 37636 Starting reconfiguration
Sep 23 09:25:00 xinetd 37636 Swapping defaults
Sep 23 09:25:00 xinetd 37636 readjusting service 6969-udp
Sep 23 09:25:00 xinetd 37636 Reconfigured: new=0 old=1 dropped=0 (services)

tun_wg0: flags=80c1<UP,RUNNING,NOARP,MULTICAST> metric 0 mtu 1420
description: WireGuardVPN
options=80000<LINKSTATE>
inet 10.7.0.2 netmask 0xffffffff
groups: wg WireGuard
nd6 options=101<PERFORMNUD,NO_DAD>

I do not have any other WireGuard or OpenVPN tunnels besides the one and am not using any sort of gateway groups for failover; just a very simple configuration. The 'server' peer I am connecting to from my local pfSense install is a VPS running WireGuard v1.0.20200513 and I am using a Pre-Shared key for 'client' peers including pfSense. I am using a keep-alive value of 30 seconds for the pfSense peer. Please let me know if I can supply any additional information to assist in troubleshooting. Screenshots attached showing the WireGuard in the state of disconnect after a WAN reset.


Files

2021-09-23_10h16_55.png (52.9 KB) 2021-09-23_10h16_55.png Failed handshake status Ryan Roosa, 09/23/2021 09:22 AM
2021-09-23_10h18_03.png (69.2 KB) 2021-09-23_10h18_03.png Tunnel config Ryan Roosa, 09/23/2021 09:22 AM
2021-09-23_10h20_37.png (78.1 KB) 2021-09-23_10h20_37.png Assigned Interface config Ryan Roosa, 09/23/2021 09:23 AM
2021-09-23_10h21_32.png (63.5 KB) 2021-09-23_10h21_32.png Assigned interface gateway config Ryan Roosa, 09/23/2021 09:24 AM
2021-09-23_10h19_09.png (88.2 KB) 2021-09-23_10h19_09.png Peer config Ryan Roosa, 09/23/2021 09:25 AM
Actions

Also available in: Atom PDF