RHEL 7 & CentOS 7禁用IPV6

禁用IPv6 
编辑文件 
vi /etc/default/grub 
在第5行加入:ipv6.disable=1 
修改后如下 

GRUB_TIMEOUT=5 
GRUB_DEFAULT=saved 
GRUB_DISABLE_SUBMENU=true 
GRUB_TERMINAL_OUTPUT="console" 
GRUB_CMDLINE_LINUX="ipv6.disable=1 rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet" 
GRUB_DISABLE_RECOVERY="true" 

执行命令 
grub2-mkconfig -o /boot/grub2/grub.cfg 

重起系统,验证 
可以再次运行ifconfig 

或者 
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. 
或者是文件不存在,则表示IPv6禁用。 

参考文章 
浏览器中如何访问 IPV6 地址的网页? 
http://www.zhihu.com/question/19760989 
RHEL 7 & CentOS 7禁用IPV6 
http://blog.csdn.net/bluishglc/article/details/41390785
https://linuxhint.com/disable_ipv6_centos7/

你可能感兴趣的:(RHEL 7 & CentOS 7禁用IPV6)