CentOS 8.x Disabling IPv6

From Notes_Wiki

Home > CentOS > CentOS 8.x > System Administration > Network configuration > CentOS 8.x Disabling IPv6

Disable IPv6 using sysctl

  1. First check whether IPv6 is enabled or not using:
    ip addr | grep inet6
  2. Create /etc/sysctl.d/70-ipv6.conf with following contents:
    net.ipv6.conf.all.disable_ipv6 = 1
    net.ipv6.conf.default.disable_ipv6 = 1
  3. Now to disable IPv6 use:
    sysctl --load /etc/sysctl.d/70-ipv6.conf

Note that due to use of network manager IPv6 might get enabled on reboot. For that we can try to disable IPv6 for interface using nmcli using:

   nmcli connection
   nmcli connection modify <connection> ipv6.method ignore

after replacing <connection> with appropriate connection name

Refer:


Disable IPv6 using kernel boot options

To disable IPv6 using kernel options use:

  1. Edit /etc/default/grub and append option:
    ipv6.disable=1
    in GRUB_CMDLINE_LINUX using:
    GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX ipv6.disable=1"
  2. Create updated grub configuration using:
    grub2-mkconfig -o /boot/grub2/grub.cfg
  3. Reboot system and validate
    shutdown -r now



Home > CentOS > CentOS 8.x > System Administration > Network configuration > CentOS 8.x Disabling IPv6