快捷搜索:  汽车  科技

centos怎么关闭ipv6(Cento7如何关闭IPV6)

centos怎么关闭ipv6(Cento7如何关闭IPV6)TX packets 162486 bytes 10369988 (9.8 MiB) RX errors 0 dropped 0 overruns 0 frame 0 inet6 fe80::21c:42ff:fe54:a3e6 prefixlen 64 scopeid 0x20<link> ether 00:1c:42:54:a3:e6 txqueuelen 1000 (Ethernet) RX packets 324692 bytes 450713310 (429.8 MiB)

rancher root@rancher:~# ifconfig eth0

eth0: flags=4163<UP BROADCAST RUNNING MULTICAST> mtu 1500

inet 10.211.55.4 netmask 255.255.255.0 broadcast 10.211.55.255

inet6 fdb2:2c26:f4e4:0:21c:42ff:fe54:a3e6 prefixlen 64 scopeid 0x0<global>

inet6 fe80::21c:42ff:fe54:a3e6 prefixlen 64 scopeid 0x20<link>

ether 00:1c:42:54:a3:e6 txqueuelen 1000 (Ethernet)

RX packets 324692 bytes 450713310 (429.8 MiB)

RX errors 0 dropped 0 overruns 0 frame 0

TX packets 162486 bytes 10369988 (9.8 MiB)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

centos怎么关闭ipv6(Cento7如何关闭IPV6)(1)

编辑/etc/sysctl.conf配置,增加net.IPv6.conf.all.disable_ipv6=1

echo "net.ipv6.conf.all.disable_ipv6=1" >> /etc/sysctl.conf

执行sysctl -p

编辑/etc/sysconfig/network增加NETWORKING_IPV6=no

echo "NETWORKING_IPV6=no" >> /etc/sysconfig/network

确保/etc/sysconfig/network-scripts/ifcfg-eth0 没有关于IPv6的设置

关闭防火墙的开机自启动

systemctl stop ip6tables.service systemctl disable ip6tables.service systemctl stop firewalld systemctl disable firewalld 重启网络看看:

systemctl restart network

猜您喜欢: