Network

How to disable IPv6 on CentOS

Ipv6There are several ways to disable IPv6. The recommended method is to edit /etc/sysctl.conf rather than disable the IPv6 module, which causes problems with SELinux and other components. Disabling IPv6 Edit /etc/sysctl.conf and add the parameters below:

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

Then save the file. Disabling IPv6 on a running system There are two ways:

  1. Write the settings to files under /proc.

    # echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6
    # echo 1 > /proc/sys/net/ipv6/conf/default/disable_ipv6
  2. Use sysctl.

    # sysctl -w net.ipv6.conf.all.disable_ipv6=1
    # sysctl -w net.ipv6.conf.default.disable_ipv6=1
EOF.← Back to articles