天天看点

centos7 网速很慢解决办法----关闭ipv6

ipv6访问网站 

centos7.1下,默认就启用了ipv6,所以可以通过网卡查看里面的。执行ifconfig命令 

centos7 网速很慢解决办法----关闭ipv6

禁用ipv6 

编辑文件 

vi /etc/default/grub 

修改红色部分

修改后如下 (红色部分)

grub_timeout=5

grub_distributor="$(sed 's, release .*$,,g' /etc/system-release)"

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后

centos7 网速很慢解决办法----关闭ipv6

继续阅读