腾讯云服务器ping其他域名ip都失败?什么原因?如何解决? 是服务器,不是vmware虚拟机

young8704
  • 233

公司有一个很老的项目用的是腾讯云服务器,业务可正常运行。

但就是ping其他域名ip都失败?什么原因?如何解决? 是服务器,不是vmware虚拟机。

[root@VM-20-191-centos ~]# ping 163.com
PING 163.com (123.58.180.8) 56(84) bytes of data.
^C
--- 163.com ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 2999ms
[root@VM-20-191-centos ~]# ping baidu.com
PING baidu.com (220.181.38.148) 56(84) bytes of data.
^C
--- baidu.com ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 2999ms

ping本机回环ip也失败

[root@VM-20-191-centos ~]# ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
^C
--- 127.0.0.1 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 3999ms

curl成功

# curl -I www.baidu.com
    HTTP/1.1 200 OK
    Accept-Ranges: bytes
    Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transform
    Connection: keep-alive
    Content-Length: 277
    Content-Type: text/html
    Date: Fri, 16 Jul 2021 01:04:27 GMT
    Etag: "575e1f72-115"
    Last-Modified: Mon, 13 Jun 2016 02:50:26 GMT
    Pragma: no-cache

wget也成功

# wget -S www.baidu.com
    --2021-07-16 09:06:16--  http://www.baidu.com/
    Resolving www.baidu.com (www.baidu.com)... 14.215.177.38, 14.215.177.39
    Connecting to www.baidu.com (www.baidu.com)|14.215.177.38|:80... connected.
    HTTP request sent, awaiting response... 
      HTTP/1.1 200 OK
      Content-Length: 2381
      Content-Type: text/html
      Server: bfe
      Date: Fri, 16 Jul 2021 01:06:16 GMT
    Length: 2381 (2.3K) [text/html]
    Saving to: ‘index.html’

    100%[==========================================================================================================================================>] 2,381       --.-K/s   in 0s      

    2021-07-16 09:06:16 (231 MB/s) - ‘index.html’ saved [2381/2381]
回复
阅读 357
2 个回答

一般这种情况是iptables限制了icmp,你可以用iptables -L命令查看是否有相关规则,然后用iptables -D删除相关规则。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
你知道吗?

宣传栏