sysctl.conf vars net.ipv6.conf.{default,all}.disable_ipv6 are being overwritten on reboot

Issues related to configuring your network
Post Reply
stale
Posts: 1
Joined: 2013/01/30 15:30:57

sysctl.conf vars net.ipv6.conf.{default,all}.disable_ipv6 ar

Post by stale » 2013/01/30 16:05:34

I'm trying to disable IPv6 with settting this two conf variables in "/etc/sysctl.conf":

[code]
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.disable.disable_ipv6=1
[/code]

After each reboot this values will get reset to 0.

In "/etc/sysconfig/network" IPv6 is disabled with:

[code]
NETWORKING_IPV6=no
[/code]

I don't enable IPv6 options on any interface confs in "/etc/sysconfig/network-scripts/".

I'm doing this aproach instead of disable-ing IPv6 module because of
recommendation in https://bugzilla.redhat.com/show_bug.cgi?id=641836#c17.

I know that I can just call sysctl in /etc/rc.local and that will work. But
that seams like hackish sollution. Is there a reason why "/etc/sysctl.conf"
setting don't work on reboot?

User avatar
AlainTH
Posts: 14
Joined: 2011/07/11 16:06:11
Location: France

Re: sysctl.conf vars net.ipv6.conf.{default,all}.disable_ipv

Post by AlainTH » 2014/05/14 09:48:27

Hello there,
Sorry to dig out such an old thread, but I'm in the same boat right now (for some reason this box has to stay on CentOS 5.5 in the near future).
As far as I can tell NETWORKING_IPV6=no and the entries in sysctl.conf are taken into account by the network startup scripts.
Adding some tracing to the startup scripts has shown to me that IPV6 was still disabled (no kernel module loaded) until much later in the /etc/rc3.d scripts.
However, several service startup scripts coming later in the rc3.d sequence e.g. sshd seem to trigger loading of the ipv6 module and all sysctl parameters are set to their defaults at this point. Therefore whatever is set in sysctl.conf and applied by /etc/init.d/network is overwritten.
The same goes for other services such as ntpd and more unexpectedly avahi-daemon.

At this point I don't see how to work around this besides setting

Code: Select all

alias ipv6 off
in /etc/modprobe.conf which I know is not the recommended solution.

Post Reply