Get the App
SLTechnology News&Howtos  ›  Servers  › 

Centos6 disables ipv6

Shulou Source: shulou.com Published: 2022-06-02 06:40:19 10月04日 Update

The first three steps are feasible, and the personal test can be carried out.

centos6.5 Disable IPv6

IPv6 is not yet fully popular, but IPv6 is effective after installing the system, affecting network performance to a certain extent, so it is best to turn off IPv6 when we do not use IPv6 at all. In fact, in the previous article on network settings, we mentioned whether to activate IPv6, but only that point setting still cannot completely turn off IPv6, so this article describes how to turn it off in a complete step.

1. Modify/etc/sysconfig/network and add:

NETWORKING_IPV6=no

2. Modify/etc/hosts and comment out the local hostname resolution for ipv6:

#::1 localhost localhost6 localhost6.localdomain6

3. Let the system not load ipv6 related modules, which requires modifying modprobe related settings files. For management convenience, we create a new settings file/etc/modprobe.d/ipv6off.conf(name random)(after RHEL6.0 there is no/etc/modprobe.conf file), the contents are as follows, three ways, there is always one suitable for you:

alias net-pf-10 off

options ipv6 disable=1 //Protest successful

or

install ipv6 /bin/true

or

install ipv6 /sbin/modprobe -n -i ipv6

Note that if you are using the bond technology and do not want to use ipv6, then you use the first one, otherwise the bonding module may fail to load when the system boots.

4. Restart the system and confirm:

[root@test ~]# lsmod | grep -i ipv6

[root@test ~]# ifconfig | grep -i inet6

If the results of the above two commands are not displayed, then ipv6 has been completely disabled.

Postscript:

In the third step of not loading the ipv6 module method, someone may have a similar setting method:

alias net-pf-10 off

alias ipv6 off

options ipv6 disable=1

Although ipv6 is not loaded after the system restarts, because of the second sentence, in some versions of the system, when we restart the network, the following error will appear:

FATAL: Module off not found.

I guess you don't want to see FATAL error messages during startup, so I'll use the method set in the text.

Tags: System file method module network step error feasible valid success host information content just name postscript command performance situation technology Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Xiaomi NVidia Microsoft Redmi