首页 > 其他 > 详细

RHEL 7 & CentOS 7禁用IPV6(转载)

时间:2018-06-21 16:08:13      阅读:197      评论:0      收藏:0      [点我收藏+]
RHEL 7 & CentOS 7下禁用IPV6的方法和之前的版本不太一样了,本文整理了一下处理方法:

 

首先,我们必须给出最根本的解决方法:修改grub,在引导时就不加载IPV6模块

 

技术分享图片

 

这样修改之后,使用

 

# lsmod | grep ipv6

 

进行验证!

 

下面我们再看一种处理方式,它不如上面提到的方式彻底,但也是有效的!

  • 验证IPV6是否关闭

1. 通过命令:

Check to see if you’re installation is currently set up for IPv6:

# cat /proc/sys/net/ipv6/conf/all/disable_ipv6

 

If the output is 0, IPv6 is enabled.

If the output is 1, IPv6 is already disabled.

 

需要特别说明的是:在这种方法下,使用# lsmod | grep ipv6依然会有一些相关模块列出。


2. 通过ifconfig查看网卡信息,以下打开和关闭ipv6的差别:

技术分享图片

 

  • 禁用IPV6的操作步骤

Step 1: add this rule in /etc/sysctl.conf : net.ipv6.conf.all.disable_ipv6=1

Step 2: add this rule in /etc/sysconfig/network: NETWORKING_IPV6=no

Step 3: add this setting for each nic X (X is the corresponding number for each nic) in /etc/sysconfig/network-scripts/ifcfg-ethX: IPV6INIT=no

Step 4: disable the ip6tables service : chkconfig ip6tables off

Step 5: Reload the sysctl configuration:

# sysctl -p
or
# reboot

 

注意:禁用IPV6后,可能会导致某些服务无法启动,比如VSFTP,对于VSFTP,需要修改/etc/vsftpd/vsftpd.conf文件中的listen和listen_ipv6两个选项:

listen=YES
listen_ipv6=NO

 

本文原文出处: http://blog.csdn.net/bluishglc/article/details/41390785 

RHEL 7 & CentOS 7禁用IPV6(转载)

原文:https://www.cnblogs.com/eos666/p/9209306.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!