如图所示:centos7 No route to host 报错,解决方法如下:

使用 ping 192.168.1.113 结果是正常的,其实出现上面的这种原因是防火墙没有关闭。


centos7 和centos6防火墙是不一样的:


centos7是 firewall


centos6是 iptables

firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)

启动一个服务:systemctl start firewalld.service


关闭一个服务:systemctl stop firewalld.service

在开机时启用一个服务:systemctl enable firewalld.service

在开机时禁用一个服务:systemctl disable firewalld.service

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐