关闭CentOS的IPv6(咋个办呢 zgbn)

使用ifconfig命令查看网卡信息,如果出现inet6 fe80::20c:29ff:fed0:3514,说明机器开启了ipv6

[root@MiWiFi-R3A-srv ~]# ifconfig
enp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.31.201  netmask 255.255.255.0  broadcast 192.168.31.255
        inet6 fe80::3ef8:d2:8709:a5ce  prefixlen 64  scopeid 0x20<link>
        ether 14:14:4b:e4:88:08  txqueuelen 1000  (Ethernet)
        RX packets 3105  bytes 375203 (366.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1651  bytes 269376 (263.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

编辑/etc/sysconfig/network配置,增加 NETWORKING_IPV6=no,保存并退出

[root@domain]$ vim /etc/sysctl.conf
 
# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
#
 
net.ipv6.conf.all.disable_ipv6=1

编辑/etc/sysconfig/network配置,增加 NETWORKING_IPV6=no,保存并退出

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值