网络及服务故障的排查思路

网络及服务故障的排查思路

例:假如https://www.cnblogs.com/ywb123/网址打不开

第一步:查一下看看通不通

#查看 icmp协议是否被禁止
[root@git01 ~]# ping -c3 -i2 -s512 www.cnblogs.com
PING www.cnblogs.com (114.55.205.139) 512(540) bytes of data.
520 bytes from 114.55.205.139 (114.55.205.139): icmp_seq=1 ttl=128 time=85.0 ms
520 bytes from 114.55.205.139 (114.55.205.139): icmp_seq=2 ttl=128 time=117 ms
520 bytes from 114.55.205.139 (114.55.205.139): icmp_seq=3 ttl=128 time=73.5 ms

--- www.cnblogs.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 4035ms
rtt min/avg/max/mdev = 73.554/91.905/117.086/18.417 ms

#备注:
-c:次数
-i:时间间隔
-s:发包大小

第二步:查看各个节点是否畅通

[root@git01 ~]# traceroute www.cnblogs.com
traceroute to www.cnblogs.com (114.55.205.139), 30 hops max, 60 byte packets
 1  gateway (192.168.200.254)  0.111 ms  0.060 ms  0.115 ms
 2  * * *
 3  * * *
 4  * * *
 5  * * *
 6  * * *
 7  * * *
 8  * * *
 9  * * *
10  * * *
11  * * *
12  * * *
13  * * *
14  * * *
15  * * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  * * *
24  * * *
25  * * *
26  * * *
27  * * *
28  * * *
29  * * *
30  * * *

第三步:检查服务器WEB有没有开启,服务开没开,以及防火墙有没有挡住。

[root@git01 ~]# telnet www.cnblogs.com 80
Trying 101.37.115.180...
Connected to www.cnblogs.com.
Escape character is '^]'.

#一直卡在这里就代表通的
[root@git01 ~]# telnet www.cnblogs.com 800
Trying 101.37.115.180...

#一直处在连接中就代表不通

综上:如果不通
1,80服务没开或端口不存在
2,服务被防火墙阻挡了
3,服务监听的端口不在连接的IP上(连接被限定了连接IP)
4,运营商默认不开,申请开端口

原文地址:https://www.cnblogs.com/ywb123/p/14525988.html