runfalk / synology-wireguard

WireGuard support for some Synology NAS drives
MIT License
953 stars 134 forks source link

Dyndns Update #57

Open spcqike opened 4 years ago

spcqike commented 4 years ago

Do you, or does anyone, has a solution to re establish the connection if the IP of an endpoint changes?

Wireguard looks up a DNS endpoint, whenever the wg interfaces goes up. If wg is running and the Remote endpoints IP changes, wg can’t establish a connection anymore.

I know this is how wireguard works on all devices, and there are scripts out there that let you restart the wg interface if a specific peer can’t be reached anymore.... but as another peer still can be connected and can have active traffic to the NAS, a complete restart is a little bit to much.

Does anyone have a smart solution to check the status and reestablish the Connection?

Best regards

Philap95 commented 3 years ago

I use a tunnel between an openwrt router (Avm 1200 Repeater) and a Synology NAS (DS218+). The openwrt router acts as client and if the ip of the Synology Nas changes it checks and auto resolves the ip with this cronjob every 15 minutes: */15 * * * * /usr/bin/wireguard_watchdog

The watchdog has to run on client side, the path may vary and it is included in the wireguard-tools.

ben-ba commented 3 years ago

I use a tunnel between an openwrt router (Avm 1200 Repeater) and a Synology NAS (DS218+). The openwrt router acts as client and if the ip of the Synology Nas changes it checks and auto resolves the ip with this cronjob every 15 minutes: */15 * * * * /usr/bin/wireguard_watchdog

The watchdog has to run on client side, the path may vary and it is included in the wireguard-tools.

wireguard_watchdog is an openwrt script... https://lists.zx2c4.com/pipermail/wireguard/2018-June/003000.html

Philap95 commented 3 years ago

I use a tunnel between an openwrt router (Avm 1200 Repeater) and a Synology NAS (DS218+).

The openwrt router acts as client and if the ip of the Synology Nas changes it checks and auto resolves the ip with this cronjob every 15 minutes:

*/15 * * * * /usr/bin/wireguard_watchdog

The watchdog has to run on client side, the path may vary and it is included in the wireguard-tools.

wireguard_watchdog is an openwrt script...

https://lists.zx2c4.com/pipermail/wireguard/2018-June/003000.html

Oh, the function/script is only included in the Openwrt package? I thought it was a normal part of the Wireguard tools. Sorry for the wrong information.