公司有一个很老的项目用的是腾讯云服务器,业务可正常运行。
但就是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]
一般这种情况是
iptables
限制了icmp
,你可以用iptables -L
命令查看是否有相关规则,然后用iptables -D
删除相关规则。