服务器不能ping,但它只能curl有限的网站

我有一个服务器,有一些networking问题。 服务器位于可以通过VPN访问的局域网中。 服务器可以ping通局域网内的任何其他机器,但不能在其外部。

ping google.com PING google.com (216.58.217.14) 56(84) bytes of data. ^C --- google.com ping statistics --- 74 packets transmitted, 0 received, 100% packet loss, time 73001ms 

但它可以curl到相同的地址:

 curl google.com <HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8"> <TITLE>301 Moved</TITLE></HEAD><BODY> <H1>301 Moved</H1> The document has moved <A HREF="http://www.google.com/">here</A>. </BODY></HTML> 

另外,如果我想从互联网上获取wget rpm软件包,并将其下载到服务器进行安装,则需要永久使用。

  curl -O ftp://195.220.108.108/linux/centos/7.3.1611/os/x86_64/Packages/wget-1.14-13.el7.x86_64.rpm % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- 0:01:25 --:--:-- 

但是我可以用curl来获取网站内容:

 curl http://www.rpmfind.net/linux/RPM/centos/7.3.1611/x86_64/Packages/wget-1.14-13.el7.x86_64.html <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL /linux/RPM/centos/7.3.1611/x86_64/Packages/wget-1.14-13.el7.x86_64.html was not found on this server.</p> </body></html> 

如果你想知道我的iptablesconfiguration,我已经刷新它。

 sudo iptables -F 

我也让selinux是宽容的:

 sudo setenforce 0 

但没有任何东西让我的服务器达到networking外的任 任何帮助将不胜感激。

你很清楚在路由器/防火墙之后,不允许从该服务器ping到外面。 原因:你可以连接到外部的DNS服务(你解决了谷歌的IP),你可以清楚地连接上的http端口以及这两个事实相结合certificate你的连接工作正常。