Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH wireguard] wireguard: device: allow userspace to enable IPv6 link-local addresses
       [not found] <20261022110039.270335-1-roma55592@yandex.ru>
@ 2026-11-10 16:47 ` Jason A. Donenfeld
  2026-11-10 18:19   ` Roman Khromenok
  0 siblings, 1 reply; 2+ messages in thread
From: Jason A. Donenfeld @ 2026-11-10 16:47 UTC (permalink / raw)
  To: Roman Khromenok
  Cc: wireguard, netdev, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Andrew Lunn, Shuah Khan, linux-kselftest

On Thu, Oct 22, 2026 at 01:00:39PM +0200, Roman Khromenok wrote:
> WireGuard interfaces do not get an IPv6 link-local address by default,
> which wg_open() achieves by setting addr_gen_mode to
> IN6_ADDR_GEN_MODE_NONE on every ndo_open. A side effect is that any mode
> chosen by userspace, via sysctl or IFLA_INET6_ADDR_GEN_MODE, is silently
> reset on the next down/up cycle. Users running routing protocols over
> WireGuard, such as Babel or OSPFv3, need fe80::/64 addresses and today
> have to set the mode again after every ifup, which network managers do
> not expect to have to do. For example, systemd-networkd cannot honor
> LinkLocalAddressing=ipv6 on WireGuard interfaces because of this.
> 
> Instead, set the default once, when the inet6_dev is created. That
> happens on NETDEV_REGISTER, both when the device is created and every
> time it is moved to another network namespace, since addrconf tears down
> the inet6_dev on NETDEV_UNREGISTER. So register a netdevice notifier
> with a priority just below addrconf's, so that it runs after the
> inet6_dev exists. The default behavior is unchanged, but userspace can
> now opt in and the setting persists across down/up.
> 
> An alternative approach using IFF_NO_ADDRCONF was proposed in [1], but
> it removes the ability to have link-local addresses altogether, and it
> was reverted because it broke the selftests.
> 
> Add a selftest checking that link-local addresses are off by default,
> that they can be enabled and survive down/up, and that the default is
> restored after moving the device to another namespace.

This is an old decision, but one I think I'm inclined to stick with. You
can't use WireGuard with LL generated addresses, because AllowedIPs
requires explicitly binding to public keys. So you wind up having to do
coordination between the chosen IP address and the distribution of keys.
The solution for Babel and the like is to add explicitly WireGuard
support and use the neat mesh qualities of Babel for key distribution
too. There has been some talk about implementing this for a long time.
That's the direction I'd like this to go in, not breaking the whole
allowedips model, which is what this moves toward. I hope that's
understandable.

Jason

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH wireguard] wireguard: device: allow userspace to enable IPv6 link-local addresses
  2026-11-10 16:47 ` [PATCH wireguard] wireguard: device: allow userspace to enable IPv6 link-local addresses Jason A. Donenfeld
@ 2026-11-10 18:19   ` Roman Khromenok
  0 siblings, 0 replies; 2+ messages in thread
From: Roman Khromenok @ 2026-11-10 18:19 UTC (permalink / raw)
  To: Jason A . Donenfeld
  Cc: wireguard, netdev, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Andrew Lunn, Shuah Khan, linux-kselftest

On Tue, Nov 10, 2026 at 04:47:35PM +0000, Jason A. Donenfeld wrote:
> This is an old decision, but one I think I'm inclined to stick with. You
> can't use WireGuard with LL generated addresses, because AllowedIPs
> requires explicitly binding to public keys. So you wind up having to do
> coordination between the chosen IP address and the distribution of keys.

Thanks for the explanation, understood. Just to note, the use case I had
in mind is one peer per interface with AllowedIPs ::/0, as commonly used
for Babel/BIRD meshes, where no address/key coordination is needed.

> That's the direction I'd like this to go in, not breaking the whole
> allowedips model, which is what this moves toward. I hope that's
> understandable.

It is. I see the direction you prefer, so I'll drop this patch.

Roman

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-10 18:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20261022110039.270335-1-roma55592@yandex.ru>
2026-11-10 16:47 ` [PATCH wireguard] wireguard: device: allow userspace to enable IPv6 link-local addresses Jason A. Donenfeld
2026-11-10 18:19   ` Roman Khromenok

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox