Sysctl parameter value is not applied after reboot

Hi ,

For IPv6 I need to change net.ipv6.conf.ens192.accept_ra to 1 .

After applying the parameter value in /etc/sysctl.d/98-custom.conf , rebuid initramfs the parameter value is not changed after reboot.

Here is the sequence of the steps

# cat etc/sysctl.d/98-custom.conf
net.ipv6.conf.ens192.accept_ra=1

# sysctl -p /etc/sysctl.d/98-custom.conf
net.ipv6.conf.ens192.accept_ra = 1

# grep . /proc/sys/net/ipv6/conf/*/accept_ra
/proc/sys/net/ipv6/conf/all/accept_ra:1
/proc/sys/net/ipv6/conf/default/accept_ra:1
/proc/sys/net/ipv6/conf/ens192/accept_ra:1
/proc/sys/net/ipv6/conf/lo/accept_ra:1

Rebuilding initramfs

#dracut -f -v

Checking new initramfs

# lsinitrd /boot/initramfs-4.18.0-372.9.1.el8.x86_64.img | grep custom
-rw-r--r--   1 root     root           33 Apr 12  2022 etc/sysctl.d/98-custom.conf

mkdir /tmp/test
cd /tmp/test

gzip -d < /boot/initramfs-4.18.0-372.9.1.el8.x86_64.img | cpio --extract --make-directories

# cat etc/sysctl.d/98-custom.conf
net.ipv6.conf.ens192.accept_ra=1

Reboot the host.

Checking net.ipv6.conf.ens192.accept_ra status

# grep . /proc/sys/net/ipv6/conf/*/accept_ra
/proc/sys/net/ipv6/conf/all/accept_ra:1
/proc/sys/net/ipv6/conf/default/accept_ra:1
/proc/sys/net/ipv6/conf/ens192/accept_ra:0
/proc/sys/net/ipv6/conf/lo/accept_ra:1

# sysctl -a | grep net.ipv6.conf.ens192.accept_ra
net.ipv6.conf.ens192.accept_ra = 0
net.ipv6.conf.ens192.accept_ra_defrtr = 1
net.ipv6.conf.ens192.accept_ra_from_local = 0
net.ipv6.conf.ens192.accept_ra_min_hop_limit = 1
net.ipv6.conf.ens192.accept_ra_mtu = 1
net.ipv6.conf.ens192.accept_ra_pinfo = 1
net.ipv6.conf.ens192.accept_ra_rt_info_max_plen = 0
net.ipv6.conf.ens192.accept_ra_rt_info_min_plen = 0
net.ipv6.conf.ens192.accept_ra_rtr_pref = 1

Thanks.

Hi, I’ve edited your post formatting it correctly so that it makes it easier to read. Please use the formatting tools when posting, thx.

Interesting. I have not set (knowingly) any (but I have also disabled IPv6 on all but lo):

# sysctl -a | grep "net.ipv6.conf.*.accept_ra "
net.ipv6.conf.all.accept_ra = 1
net.ipv6.conf.br0.accept_ra = 0
net.ipv6.conf.br1.accept_ra = 0
net.ipv6.conf.br2.accept_ra = 0
net.ipv6.conf.default.accept_ra = 1
net.ipv6.conf.eno1.accept_ra = 0
net.ipv6.conf.eno1/2.accept_ra = 0
net.ipv6.conf.eno1/5.accept_ra = 0
net.ipv6.conf.eno1/8.accept_ra = 0
net.ipv6.conf.lo.accept_ra = 1
net.ipv6.conf.vlan-8.accept_ra = 0

Summary: “all”, “default”, and “lo” have 1. Named interfaces have 0.


I had not realized that sysctl is in initramfs. With bridges we saw an ordering problem that some sysctl options did appear in kernel before appropriate kernel module was loaded, and system init did call sysctl before module did load. Could this accept_ra issue be similar?

As I did note above, I have entirely disabled IPv6 (mutter … ISP … mutter) on select connections and NetworkManager makes that happen. The man nm-settings does mention “Router Advertisements” in ipv6.method. Perhaps NM could be told to do whatever the “accept_ra=1” should do?

Small comment from my side - the same approach works for RHEL 8.

RHEL 8 and Rocky 8 should behave the same. Otherwise “identical” systems?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.