Site to Site Wireguard Tunnel: Force Restart Link

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
TCB13
DD-WRT User


Joined: 06 Jun 2010
Posts: 260
Location: Portugal

PostPosted: Sun Sep 05, 2021 18:42    Post subject: Site to Site Wireguard Tunnel: Force Restart Link Reply with quote
Hello,

So I've two R7000 routers at different locations and I've setup a Wireguard between them so I can access each other LANs transparently. One routers acts a "server" (endpoint disabled) while the other acts as a "client" (endpoint enabled).

Now it all works fine, but unfortunately the "server" sometimes loses its internet connection and gets a new IP from the ISP and after that the tunnel doesn't work anymore until I restart the "client" router.

On the second router what happens is something like this:

Code:
endpoint: 85.xxx.xxx.xxx:xxxx
latest handshake: 7 hours, 11 minutes, 30 seconds ago
transfer: 72.47 MiB received, 77.93 MiB sent


The "endpoint" IP is still the original IP and since the "server" got a new IP at that point the link wont work anymore.

Rebooting the "client" fixes this (because it will get the new router IP from it's dyndns address), however is there a way I can just restart Wireguard via SSH and/or have it automatically restart if the link isn't working property?

Thank you.

_________________
1x Netgear R7800 (latest); 3x Netgear R7000 (latest); 2x Asus RT-N16 (v3.0-r47656); 2x Fonera 2100 (v3.0-r45454).
Sponsor
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Sun Sep 05, 2021 18:50    Post subject: Reply with quote
Sure there is a watchdog script for wireguard.

Look in the WireGuard documentation, link in my signature at the bottom.

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
TCB13
DD-WRT User


Joined: 06 Jun 2010
Posts: 260
Location: Portugal

PostPosted: Sun Sep 05, 2021 19:34    Post subject: Reply with quote
egc wrote:
Sure there is a watchdog script for wireguard.

Look in the WireGuard documentation, link in my signature at the bottom.


Found it!

Thank you for all the great work.

_________________
1x Netgear R7800 (latest); 3x Netgear R7000 (latest); 2x Asus RT-N16 (v3.0-r47656); 2x Fonera 2100 (v3.0-r45454).
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum