wireguard.lists.zx2c4.com archive mirror
 help / color / mirror / Atom feed
From: Kalin KOZHUHAROV <me.kalin@gmail.com>
To: Nico Schottelius <nico.schottelius@ungleich.ch>
Cc: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: IPv6 endpoint AND IPv4 fallback endpoint in roadwarrior scenario?
Date: Mon, 30 Sep 2019 10:44:47 +0200	[thread overview]
Message-ID: <CAKXLc7dYaAMxhnWnTMkbW4bGo=HOOhwxeCBcdP6y3D_+d5Uffg@mail.gmail.com> (raw)
In-Reply-To: <87eezyp6f1.fsf@line.ungleich.ch>

On Mon, Sep 30, 2019 at 9:53 AM Nico Schottelius
<nico.schottelius@ungleich.ch> wrote:
> At lookup time this works already.
>
yup!

> The problem is, if the underlying network topology changes and you need to reconnect via IPv4,
> when you had IPv6 underlying before.
>
Well, "if the underlying network topology changes" it is better to
detect and update things from OS level.
A restart of the wg interface (and using A/AAAA DNS records) works, so
it just needs to be initiated from whoever is taking care of the OS
network reconfiguration.

I would say that is "outside" feature, shouldn't be implemented at wg level.

Or ... actually, if there are other use cases, a more generic
"self-restart-timer" might be helpful. Something along the lines of
persistent-keepalive, but the reverse.
Persistent-keepalive is a packet send to the remote endpoint as a
one-way throw-and-forget packet, there are many valid configurations
that use it only on one of the ways (e.g. A --> B).
Currently, keepalive packets are discarded on the receive end after
updating the stats (e.g.
https://github.com/WireGuard/WireGuard/blob/0d9758d1afe5f812d5ccfcbb4b7c74f42f50318b/src/receive.c#L362
)

/* A packet with length 0 is a keepalive packet */
if (unlikely(!skb->len)) {
  update_rx_stats(peer, message_data_len(0));
  net_dbg_ratelimited("%s: Receiving keepalive packet from peer %llu
(%pISpfsc)\n",
    dev->name, peer->internal_id,
    &peer->endpoint.addr);
  goto packet_processed;
}

I would say a reverse-keepalive (not the best wording) is to try to
reconnect to the peer if it was off-line (no data or KA-packets) for
some predefined time. This can be measured in number of seconds since
last packet received (KA or data). If such a condition is met,
resetting the interface (and thus redoing DNS lookup) may result in
fixing the link disruption caused by topology change.

Again, this may be better implemented outside wireguard since the
timeout is available e.g. via `wg show <INTERFACE> latest-handshakes`
command.

Cheers,
Kalin.
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

  reply	other threads:[~2019-09-30  8:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-27 18:10 IPv6 endpoint AND IPv4 fallback endpoint in roadwarrior scenario? Rene 'Renne' Bartsch, B.Sc. Informatics
2019-09-29 14:27 ` Ulrich Kalloch
2019-09-29 19:31   ` Henning Reich
2019-09-29 20:46     ` Rene 'Renne' Bartsch, B.Sc. Informatics
2019-09-30  7:52     ` Nico Schottelius
2019-09-30  8:44       ` Kalin KOZHUHAROV [this message]
2019-09-30 11:16       ` mikma.wg

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='CAKXLc7dYaAMxhnWnTMkbW4bGo=HOOhwxeCBcdP6y3D_+d5Uffg@mail.gmail.com' \
    --to=me.kalin@gmail.com \
    --cc=nico.schottelius@ungleich.ch \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).