IPv6 endpoint AND IPv4 fallback endpoint in roadwarrior scenario?

Kalin KOZHUHAROV me.kalin at gmail.com
Mon Sep 30 10:44:47 CEST 2019


On Mon, Sep 30, 2019 at 9:53 AM Nico Schottelius
<nico.schottelius at 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.


More information about the WireGuard mailing list