Centos7关闭ipv6方法

 时间:2026-04-22 18:18:40

1、使用ifconfig命令查看,如果出现ipv6表明开启了

Centos7关闭ipv6方法

2、cat /etc/sysctl.conf|grep -q "net.ipv6.conf.all.disable_ipv6=1"

if [ "$?" != "0" ]; then

cat >> /etc/sysctl.conf << EOF

net.ipv6.conf.all.disable_ipv6=1

EOF

fi

Centos7关闭ipv6方法

3、使用vim /etc/sysctl.conf进行验证

Centos7关闭ipv6方法

4、cat /etc/sysconfig/network|grep -q "NETWORKING_IPV6=no"

if [ "$?" != "0" ]; then

cat >> /etc/sysconfig/network << EOF

NETWORKING_IPV6=no

EOF

fi

Centos7关闭ipv6方法

5、使用vim /etc/sysconfig/network进行验证

Centos7关闭ipv6方法

6、cat /etc/sysconfig/network-scripts/ifcfg-eth0|grep -q "IPV6INIT=no"

if [ "$?" != "0" ]; then

cat >> /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF

IPV6INIT=no

EOF

fi

Centos7关闭ipv6方法

7、使用vim /etc/sysconfig/network-scripts/ifcfg-eth0进行验证

Centos7关闭ipv6方法

8、关闭ip6tables开机自启动

chkconfig ip6tables off

Centos7关闭ipv6方法

9、sysctl -p

Centos7关闭ipv6方法

10、使用ifconfig再次进行验证

Centos7关闭ipv6方法

  • Cloudreve在虚拟主机下安装伪静态问题解决方法
  • 利用Windows命令行创建ASP.NET Core应用程序
  • Commvault 如何从备份中恢复数据
  • eclipse上的svn如何检出工程
  • Linux系统中查看MAC和编辑网卡信息
  • 热门搜索
    我的团长我的团为什么被禁播 水饺怎么煮 白萝卜做法大全家常 qq怎么删除好友 开除员工怎么赔偿 电脑为什么很卡 澳优能力多奶粉怎么样 贫困申请书怎么写 印度为什么敢打中国 海子为什么自杀