RHEL 7 CentOS 7禁用IPV6
分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow
也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!
RHEL 7 & CentOS 7下禁用IPV6的方法和之前的版本不太一樣了,本文整理了一下處理方法:本文原文出處: http://blog.csdn.net/bluishglc/article/details/41390785
首先,我們必須給出最根本的解決方法:修改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 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兩個選項: