Comment 4 for bug 1862481

Revision history for this message
Yaobin Wen (yaobinwen) wrote (last edit ): Re: Cannot set accept-ra to 2, it keeps reseting it to 0

I ran into this today and after a lot of head-scratching, it just occurred to me that this is probably the expected behavior. systemd-network(5)'s IPv6AcceptRA section says (https://www.freedesktop.org/software/systemd/man/latest/systemd.network.html):

> Note that kernel's implementation of the IPv6 RA protocol is always disabled, regardless of this setting.

Then I read this comment: https://unix.stackexchange.com/questions/759771/ubuntu-accept-ra-is-not-effective-with-sysctl-and-prevents-dhcp6-when-in-netplan#comment1448644_759791, quoted below:

> It's for the in-kernel RA handler. Traditionally Linux has done IPv6 autoconfig (though not DHCPv6) without any userspace software at all, but its capabilities are limited. (Networkd actually sets it to 0 even if IPv6AcceptRA=true.)

What possibly confused the readers (including me) was, systemd-network(5) does say:

> Also see IP Sysctl in the kernel documentation regarding "accept_ra", but note that systemd's setting of 1 (i.e. true) corresponds to kernel's setting of 2.

At the beginning, this paragraph made me think systemd-networkd sets `accept_ra` to 2 when `IPv6AcceptRA=yes`. But, no. Now I realized systemd-network(5) was merely using the kernel document to explain that `IPv6AcceptRA=yes`'s behavior is the same as `accept_ra=2`'s behavior (i.e, accepting RA messages even if forwarding is enabled), but systemd-networkd always sets `accept_ra=0` duo the the explanation of "Note that kernel's implementation of the IPv6 RA protocol is always disabled".