zaneschepke / wgtunnel

An alternative Android client app for WireGuard VPN
https://zaneschepke.com/wgtunnel-docs
MIT License
731 stars 41 forks source link

[BUG] - No reconncetion in case of DDNS IP address change #267

Open dreasb opened 1 month ago

dreasb commented 1 month ago

Constellation I have a permanent VPN wireguard connection from my google pixel 6 (android 14) smartphone to my fritzbox router. The fritzbox is connected to an internet provider, which enforces randomly a re-connection of the internet connection. In that case the IP addresses (ipv4 + ipv6) of the fritzbox will be changed. I use a dynamic DNS provider. The fritzbox updates the IP address to my DDNS provider immediately after the re-connection. The DDNS name is part of the Wireguard configuration (Endpoint).

Defect The wireguard app didn't recognize the IP-Address change and my vpn connection is still running, but no longer working. After a disable / enable click everything works well.

The app is hanging up in and endless loop with the following log messages every 5 seconds.

Log-message D WireGuard/GoBackend/wg_config: peer(R274…Z2To) - Handshake did not complete after 5 seconds, retrying (try 2) D WireGuard/GoBackend/wg_config: peer(R274…Z2To) - Sending handshake initiation

Expected behavior The exception should be catched and a reconnection should be enforced / retried after a few seconds.

Reproducable

  1. Setup a Wireguard connection to an router, use a DDNS Endpoint instead of a static ip
  2. Use the mobile phone, connect the wireguard connection via mobile network (positive)
  3. Reconnect the router to a new IP address
  4. Check the log files, no internet connection via DDNS possible anymore
bobdig commented 1 month ago

Support for changing D(yn)DNS-addresses would be my reason for using wgtunnel.

ElbPirat commented 1 month ago

Do you have "Restart on Ping Error (Beta)" in the auto tunneling settings enabled? I think this helped me in a similar case. But haven't checked since a few weeks/month, as I am not connected to VPN if at home.

dreasb commented 1 month ago

The Option Restart on Ping Error (Beta) is enabled.