Disable IPV6 network in CentOS 6.7
IPV6 is enabled when the system is installed, but IPV6 is not required in actual use, so you need to disable it. The following is my solution.
At the beginning, I also stepped on a lot of pitfalls. I read a lot of sharing methods on the Internet and did not try to verify whether IPV6 is enabled for use:
ifconfig
|
grep
inet6
Or
lsmod|
grep
ipv6
1) Disable ip6tables
#chkconfigip6tablesoff
2) disable the ipv6 network (/etc/sysconfig/network)
#vim/etc/sysconfig/network
NETWORKING_IPV6=no
3) Disable Nic IPV6 settings
#vim/etc/sysconfig/network-scripts/ifcfg-eth0
IPV6INIT=no
IPV6_AUTOCONF=no
4) Modify/etc/hosts, disable ipv6 settings, and comment on ipv6 Resolution:
#vim/etc/hosts
#::1localhostlocalhost.localdomainlocalhost6localhost6.localdomain6
Many of the above four methods have been introduced on the network. After restarting the system, ipv6 still cannot be disabled, and then it is difficult to solve the problem. The following method can be used for verification.
Add the following configuration to the/etc/modprobe/dist. conf file:
#vim/etc/modprobe/dist.conf
alias
net-pf-10off
alias
ipv6off
Then restart the system. However, in some cases, this method does not take effect. You also need to add:
install
ipv6
/bin/true
Then restart the system and check for verification:
ifconfig
|
grep
inet6
Or
lsmod|
grep
ipv6
If no data is returned, it indicates that it is disabled.
In addition, you can also share it online in/boot/grub. in the conf file, the kernel starts with quiet and ends with disable. ipv6 = 1. This method does not have ipv6 when ifconfig | grep inet6 is used for verification, but lsmod | grep ipv6 verification still exists.