centos7-关闭ipv6

1.在/etc/sysctl.conf中添加此规则:
net.ipv6.conf.all.disable_ipv6 = 1

2.在/etc/sysconfig/network中添加此规则:
NETWORKING_IPV6 = no

3.在/etc/sysconfig/network-scripts/ifcfg-ethX中添加此规则:
IPV6INIT = no

4.关闭防火墙的开机自启动服务:
systemctl disable ip6tables.service

5.重新加载sysctl配置或者重启网络
#sysctl -p
or
#systemctl restart network


本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!