on it road .com

方法 2:使用 /etc/sysctl.conf

  1. 将以下行添加到文件 /etc/sysctl.conf 。
# IPv6 support in the kernel, set to 0 by default
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
  1. 要使设置生效,请执行:
# sysctl -p

方法一:使用/etc/modprobe.d/ipv6.conf

  1. 检查是否启用了 IPV6:
# ifconfig |grep inet6
  inet6 addr: fe80::d6be:d9ff:fe99:5a77/64 Scope:Link
  inet6 addr: fe80::d6be:d9ff:fe99:5a77/64 Scope:Link
  1. 创建 /etc/modprobe.d/ipv6.conf 如果还没有以下参数:
options ipv6 disable=1
  1. 禁用ipt6tables服务
# chkconfig ip6tables off
  1. 重启服务器
# shutdown -r now
  1. 确认是否禁用了 IPV6:
# ifconfig |grep inet6
#
CentOS/RHEL 6:如何禁用 IPv6

本文介绍了在 CentOS/RHEL 6 上禁用 IPv6 的过程。
有两种方法可以做到这一点:

  1. 在内核模块中禁用IPv6(需要重启)
  2. 使用 sysctl 设置禁用 IPv6(无需重启)
日期:2020-09-17 00:11:56 来源:oir作者:oir