curl 错误

Posted on 2016-02-26 17:03  心在北方  阅读(829)  评论(0编辑  收藏  举报

今天犯了一个很低级的错误。在一台服务器上部署了nginx服务,结果怎么都没法访问。

使用curl  192.168.1.37

提示:curl: (7) Failed connect to 192.168.1.10:80; No route to host

潜意识里认为防火墙是关闭的。

service iptables status

[root@gxcc Desktop]# service iptables status
Redirecting to /bin/systemctl status  iptables.service
● iptables.service - IPv4 firewall with iptables
   Loaded: loaded (/usr/lib/systemd/system/iptables.service; disabled; vendor preset: disabled)
   Active: inactive (dead)

看到dead两个字就认为是关闭了,殊不知,我忘记了我使用的是centos7 防火墙的服务已经换了

systemctl stop firewalld.service 这样才能停掉
要永久禁用  
systemctl disable  firewalld.service

如果要用iptables

设置 iptables service

yum -y install iptables-services

关闭防火请,就正常了

Copyright © 2024 心在北方
Powered by .NET 8.0 on Kubernetes