All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vicente Bergas <vicencb@gmail.com>
To: Max Schulze <max.schulze@online.de>
Cc: Roman Mamedov <rm@romanrm.net>, wireguard@lists.zx2c4.com
Subject: Re: lost connection on dynamic IP
Date: Sun, 23 May 2021 13:44:59 +0200	[thread overview]
Message-ID: <CAAMcf8BqQc6C09nzsZQ2smygbpb-=BvWE_7U+gp8vpPK6eYBLA@mail.gmail.com> (raw)
In-Reply-To: <cfef7862-cae8-6d13-269b-d01aa6f0a2b4@online.de>

On Thu, May 20, 2021 at 9:23 PM Max Schulze <max.schulze@online.de> wrote:
> On 20.05.21 18:20, Roman Mamedov wrote:
> > On Thu, 20 May 2021 11:15:30 +0500
> > Roman Mamedov <rm@romanrm.net> wrote:
> >
> >>> So, what do you mean is that wireguard does a single DNS resolution at
> >>> the beginning and further DNS resolutions need to be done elsewere. Is
> >>> that correct?
> >> Yes.
> Just to point out what 'others are doing' - openwrt has a watchdog
> script [1] that might be run with cron every 15 mins
>
> */15 * * * * /usr/bin/wireguard_watchdog
>
> which will update the new endpoint if the last handshake is too old:
>
> wg set ${iface} peer ${public_key} endpoint
> "${endpoint_host}:${endpoint_port}"
>
> It needs PersistenKeepalive also, if i understand correctly.
>
> [1]
> https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=package/network/utils/wireguard-tools/files/wireguard_watchdog;hb=HEAD
>
> --
>
> Max

Hello, i've been running this script on a setup with a wg interface
with a single peer:
while true ; do
  sleep 300
  curr=$(date +%s)
  prev=$(wg show wg0 latest-handshakes | cut -f2)
  elapsed=$(( ${curr} - ${prev} ))
  [ ${elapsed} -ge 300 ] && wg syncconf wg0 /etc/wireguard/wg0.conf
done
on the client side for 3 days and the issue occurred once again.
This time the connection was restablished automatically and no manual
intervention was required.
Thank you Max and Roman.

Regards,
  Vicenç.

      reply	other threads:[~2021-05-23 11:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18 11:22 lost connection on dynamic IP Vicente Bergas
2021-05-19 18:43 ` Roman Mamedov
2021-05-19 22:28   ` Vicente Bergas
2021-05-20  6:15     ` Roman Mamedov
2021-05-20 16:20       ` Roman Mamedov
2021-05-20 19:23         ` Max Schulze
2021-05-23 11:44           ` Vicente Bergas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAMcf8BqQc6C09nzsZQ2smygbpb-=BvWE_7U+gp8vpPK6eYBLA@mail.gmail.com' \
    --to=vicencb@gmail.com \
    --cc=max.schulze@online.de \
    --cc=rm@romanrm.net \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.