Kernel sysctl parameter overriden

We are using the following configuration:

  boot.kernel.sysctl = {
    "net.ipv6.conf.end0.accept_ra" = 1;
    "net.ipv6.conf.end0.accept_ra_rt_info_max_plen" = 64;
    "net.ipv6.conf.wlan0.accept_ra" = 1;
    "net.ipv6.conf.wlan0.accept_ra_rt_info_max_plen" = 64;
    "net.ipv6.conf.all.disable_ipv6" = 0;
    "net.ipv4.conf.all.forwarding" = 1;
    "net.ipv6.conf.all.forwarding" = 1;
  };

Yet, sysctl yields the following after first boot:

net.ipv6.conf.all.accept_ra = 1
net.ipv6.conf.default.accept_ra = 1
net.ipv6.conf.end0.accept_ra = 0
net.ipv6.conf.end1.accept_ra = 0
net.ipv6.conf.lo.accept_ra = 1
net.ipv6.conf.wpan0.accept_ra = 1
net.ipv6.conf.wwu1u4i4.accept_ra = 1

So, the configuration for end0.accept_ra doesn’t go through for some reason…

It should also be noted that accept_ra_rt_info_max_plen doesn’t seem to exist at all.

Does anyone have an idea as to why accept_ra doesn’t get applied properly?

Running sysctl --system loads the proper values.

journalctl -xe shows

Dez 12 12:56:48 wtc systemd-sysctl[204]: Couldn't write '1' to 'net/ipv6/conf/end0/accept_ra', ignoring: No such file or directory
Dez 12 12:56:48 wtc systemd-sysctl[204]: Couldn't write '64' to 'net/ipv6/conf/end0/accept_ra_rt_info_max_plen', ignoring: No such file or directory
Dez 12 12:56:48 wtc systemd-sysctl[204]: Couldn't write '1' to 'net/ipv6/conf/wlan0/accept_ra', ignoring: No such file or directory
Dez 12 12:56:48 wtc systemd-sysctl[204]: Couldn't write '64' to 'net/ipv6/conf/wlan0/accept_ra_rt_info_max_plen', ignoring: No such file or directory

The file is probably not present since the interface is named eth0 on boot, as shown by the journalctl entry Dez 12 13:13:38 wtc kernel: fec 30be0000.ethernet end0: renamed from eth0 .

Changing the target interface to eth0 in the .conf file doesn’t work either.

What would be the best way to approach this?

I now have this udev rule:

SUBSYSTEM=="net", NAME=="end0", ACTION=="move", RUN+="${pkgs.procps}/bin/sysctl -w net.ipv6.conf.end0.accept_ra=1

I can see the rule running when the end0 interface appears. Yet, after logging in, the accept_ra value is still 0.

Any ideas what I could change here?

systemd-networkd is not running.