Wireguard VPN connection breaks after power outages - requires full reconfiguration

Yeah... the clock is wrong, as I predicted.

  • Before unplugging: November 11, 2024 14:21:55 UTC
  • After unplugging: November 11, 2024 13:47:43 UTC

As you can see, the clock in this case shows about 34 minutes behind the previous time, and when you account for the 7 minutes that it was unplugged, it's probably about 41 minutes behind the correct time.

So... like I said, it's a time issue. Basically, the tunnel starts on the local side before NTP sync occurs. But the tunnel cannot be fully established because the time is wrong (all modern VPNs use time as part of the cryptographic process to prevent 'replay attacks'). This means that there is no internet access available because the tunnel isn't actually up, but the local OpenWrt routes are trying to push all traffic through the tunnel.

The system cannot get an NTP sync because the there is no internet access. There is no internet access because the traffic is being sent through a tunnel that hasn't been completed. The tunnel isn't actually up because the time is wrong. Now, you can see the chicken-or-egg situation.

This thread (and several like it) describe some modifications that can be made to the startup process to ensure NTP sync occurs before the WG tunnel attempts to start, and then starts it after the clock has been correctly set.


Also, moving forward... please do not post screenshots.

Please use the "Preformatted text </>" button for logs, scripts, configs and general console output.
grafik
Please edit your post accordingly. Thank you! :slight_smile:

1 Like