2

I need to disable the usage/assignemnt of the IPv6, I tried creating the /etc/sysctl.d/40-ipv6.conf file and adding the relative settings, I've also tried editing the GRUB adding the following line:

GRUB_CMDLINE_LINUX="ipv6.disable_ipv6=1"

And after sudo update-grub and rebooting the system, IPv6 still be used by my eth card.

Is there permanent way I can disable IPv6 using the "ip" linux command?

  • 1
    Warning: Disabling IPv6 is not recommended. This will cause some services to fail and you to be unable to communicate with some Internet hosts. – Michael Hampton Apr 3 '18 at 17:06
  • @MichaelHampton Good point.. – Luigi T. Apr 3 '18 at 17:24
2

The following configuration lines belong in the file, /etc/sysctl.d/40-ipv6.conf to disable IPv6 on all interfaces.

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

Which Linux are we talking about? The GRUB configuration method looks something like the following configuration in, perhaps, /etc/default/grub.

GRUB_CMDLINE_LINUX="ipv6.disable=1 rhgb quiet"

After changing the GRUB configuration, one must reinstall GRUB and reboot.

grub2-mkconfig -o /boot/grub2/grub.cfg
shutdown -r now

Later, check to see that the configuration was successful.

ip addr show | grep net6

Or, to simply prevent the IPv6 module from binding to the IPv6 networking stack, add the line below to /etc/modprobe.d/blacklist.conf (or a different file name according to the existing directory/file structure):

options ipv6 disable=1

Then reboot.

This will allow the loading of the IPv6 module in order to satisfy any other modules that depend on it while disabling support for the IPv6 protocol.

In a RedHat-based OS, one could use the following directive in /etc/sysconfig/network.

NETWORKING_IPV6=no

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.