设为首页 收藏本站
查看: 2856|回复: 0

[经验分享] CentOS6下一次网络ping包没回应的故障分析

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2016-10-27 11:08:21 | 显示全部楼层 |阅读模式
1)现象描述
  今天有同事访问,他在用vmware workstation做测试的时候,使用nat模式,在家里能够ping通www.baidu.com,但是在公司怎么ping都不通,但是访问内网和网关都正常。并且测试机的selinux和iptables都是已经关闭。

2)处理过程
a、测试到内网其它主机
1
2
3
4
5
6
7
8
9
10
11
[iyunv@mysql-master ~]# ping -c 5 10.10.10.1
PING 10.10.10.1 (10.10.10.1) 56(84) bytes of data.
64 bytes from 10.10.10.1: icmp_seq=1 ttl=64 time=0.440 ms
64 bytes from 10.10.10.1: icmp_seq=2 ttl=64 time=0.968 ms
64 bytes from 10.10.10.1: icmp_seq=3 ttl=64 time=3.39 ms
64 bytes from 10.10.10.1: icmp_seq=4 ttl=64 time=4.77 ms
64 bytes from 10.10.10.1: icmp_seq=5 ttl=64 time=1.55 ms
--- 10.10.10.1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 0.440/2.226/4.777/1.618 ms
说明:到内网其它主机,正常



b、测试到网关

1
2
3
4
5
6
7
8
[iyunv@mysql-master ~]# ping -c 5 10.10.10.2
PING 10.10.10.2 (10.10.10.2) 56(84) bytes of data.
64 bytes from 10.10.10.2: icmp_seq=1 ttl=128 time=1.15 ms
64 bytes from 10.10.10.2: icmp_seq=2 ttl=128 time=2.21 ms
64 bytes from 10.10.10.2: icmp_seq=3 ttl=128 time=0.252 ms
64 bytes from 10.10.10.2: icmp_seq=4 ttl=128 time=0.209 ms
64 bytes from 10.10.10.2: icmp_seq=5 ttl=12
说明:到网关正常



c、测试到baidu.com的连通性
1
2
3
4
5
[iyunv@mysql-master ~]# ping -c 5 www.baidu.com
PING www.a.shifen.com (61.135.169.121) 56(84) bytes of data.
--- www.a.shifen.com ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 13999ms
说明:发现包完全丢失,但是dns能够解析到ip地址,对网络是不是有限制产生了怀疑?



d、检测dns的解析

1
2
3
4
5
6
7
8
9
10
[iyunv@mysql-master ~]# nslookup www.baidu.com
Server:10.10.10.2
Address:10.10.10.2#53
Non-authoritative answer:
www.baidu.comcanonical name = www.a.shifen.com.
Name:www.a.shifen.com
Address: 61.135.169.125
Name:www.a.shifen.com
Address: 61.135.169.121
说明:DNS解析正常



e、测试网络是否真的连通(wget以及nmap)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
[iyunv@mysql-master ~]# mkdir -p /packet
[iyunv@mysql-master ~]# cd /packet/
[iyunv@mysql-master packet]# wget www.baidu.com
--2016-10-19 06:01:48--  http://www.baidu.com/
正在解析主机 www.baidu.com... 61.135.169.125, 61.135.169.121
正在连接 www.baidu.com|61.135.169.125|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:2381 (2.3K) [text/html]
正在保存至: “index.html”
100%[==================================================================================>] 2,381       --.-K/s   in 0s      
2016-10-19 06:01:48 (128 MB/s) - 已保存 “index.html” [2381/2381])
[iyunv@mysql-master packet]# echo $?
0
测试表明wget是正常的,能够正常下载
[iyunv@mysql-master packet]# nmap www.baidu.com
Starting Nmap 5.51 ( http://nmap.org ) at 2016-10-19 06:02 CST
Nmap scan report for www.baidu.com (61.135.169.125)
Host is up (0.036s latency).
Other addresses for www.baidu.com (not scanned): 61.135.169.121
Not shown: 998 filtered ports
PORT    STATE SERVICE
80/tcp  open  http
443/tcp open  https
Nmap done: 1 IP address (1 host up) scanned in 56.33 seconds
说明:能够使用nmap检测到端口开放的情况



f、利用tcpdump进行抓包分析

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
[iyunv@mysql-master ~]# ping -c 5 10.10.10.2
PING 10.10.10.2 (10.10.10.2) 56(84) bytes of data.
64 bytes from 10.10.10.2: icmp_seq=1 ttl=128 time=0.287 ms
64 bytes from 10.10.10.2: icmp_seq=2 ttl=128 time=0.626 ms
64 bytes from 10.10.10.2: icmp_seq=3 ttl=128 time=0.370 ms
64 bytes from 10.10.10.2: icmp_seq=4 ttl=128 time=0.412 ms
64 bytes from 10.10.10.2: icmp_seq=5 ttl=128 time=0.248 ms
--- 10.10.10.2 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4003ms
rtt min/avg/max/mdev = 0.248/0.388/0.626/0.133 ms
[iyunv@mysql-master ~]# tcpdump -i eth0 icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
05:48:57.350869 IP mysql-master > localhost: ICMP echo request, id 10786, seq 1, length 64
05:48:57.351123 IP localhost > mysql-master: ICMP echo reply, id 10786, seq 1, length 64
05:48:58.352296 IP mysql-master > localhost: ICMP echo request, id 10786, seq 2, length 64
05:48:58.352889 IP localhost > mysql-master: ICMP echo reply, id 10786, seq 2, length 64
05:48:59.352281 IP mysql-master > localhost: ICMP echo request, id 10786, seq 3, length 64
05:48:59.352590 IP localhost > mysql-master: ICMP echo reply, id 10786, seq 3, length 64
05:49:00.353060 IP mysql-master > localhost: ICMP echo request, id 10786, seq 4, length 64
05:49:00.353433 IP localhost > mysql-master: ICMP echo reply, id 10786, seq 4, length 64
05:49:01.353288 IP mysql-master > localhost: ICMP echo request, id 10786, seq 5, length 64
05:49:01.353503 IP localhost > mysql-master: ICMP echo reply, id 10786, seq 5, length 64



说明:有正常的request包和reply,说明本机到10.10.10.2正常(request包),并且10.10.10.2到本机有回应(reply包)
1
2
3
4
5
6
7
8
9
10
11
12
13
[iyunv@mysql-master ~]# ping -c 5 www.baidu.com
PING www.a.shifen.com (61.135.169.125) 56(84) bytes of data.
--- www.a.shifen.com ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 14003ms
[iyunv@mysql-master ~]# tcpdump -i eth0 icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
05:53:27.820920 IP mysql-master > 61.135.169.125: ICMP echo request, id 14370, seq 1, length 64
05:53:28.822483 IP mysql-master > 61.135.169.125: ICMP echo request, id 14370, seq 2, length 64
05:53:29.823843 IP mysql-master > 61.135.169.125: ICMP echo request, id 14370, seq 3, length 64
05:53:30.823290 IP mysql-master > 61.135.169.125: ICMP echo request, id 14370, seq 4, length 64
05:53:31.823680 IP mysql-master > 61.135.169.125: ICMP echo request, id 14370, seq 5, length 64
说明:发现有request包,表明本机到baidu的包,baidu是接收到的,可能是百度没响应(可能性不大)或者被公司防火墙阻断了



使用手机热点,共享给测试机使用

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
[iyunv@mysql-master ~]# ping -c 5 www.baidu.com
PING www.a.shifen.com (183.232.231.173) 56(84) bytes of data.
64 bytes from 183.232.231.173: icmp_seq=1 ttl=128 time=74.4 ms
64 bytes from 183.232.231.173: icmp_seq=2 ttl=128 time=74.7 ms
64 bytes from 183.232.231.173: icmp_seq=3 ttl=128 time=64.4 ms
64 bytes from 183.232.231.173: icmp_seq=4 ttl=128 time=57.0 ms
64 bytes from 183.232.231.173: icmp_seq=5 ttl=128 time=60.5 ms
--- www.a.shifen.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4065ms
rtt min/avg/max/mdev = 57.081/66.263/74.772/7.216 ms
[iyunv@mysql-master ~]# tcpdump -i eth0 icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
05:58:31.031646 IP mysql-master > 183.232.231.173: ICMP echo request, id 40226, seq 1, length 64
05:58:31.106104 IP 183.232.231.173 > mysql-master: ICMP echo reply, id 40226, seq 1, length 64
05:58:32.032448 IP mysql-master > 183.232.231.173: ICMP echo request, id 40226, seq 2, length 64
05:58:32.107194 IP 183.232.231.173 > mysql-master: ICMP echo reply, id 40226, seq 2, length 64
05:58:33.034464 IP mysql-master > 183.232.231.173: ICMP echo request, id 40226, seq 3, length 64
05:58:33.098846 IP 183.232.231.173 > mysql-master: ICMP echo reply, id 40226, seq 3, length 64
05:58:34.035272 IP mysql-master > 183.232.231.173: ICMP echo request, id 40226, seq 4, length 64
05:58:34.092322 IP 183.232.231.173 > mysql-master: ICMP echo reply, id 40226, seq 4, length 64
05:58:35.036289 IP mysql-master > 183.232.231.173: ICMP echo request, id 40226, seq 5, length 64
05:58:35.096837 IP 183.232.231.173 > mysql-master: ICMP echo reply, id 40226, seq 5, length 64
说明:到baidu是有request和reply包,进出的包都是正常的



综合分析:应该是公司内部网络时对回来的网络包做了些限制,随后与网络工程师核对了下,的确在防火墙上做了些限制。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-292006-1-1.html 上篇帖子: how-to create a high-availability mysql setup with corosync pacemaker and dr... 下篇帖子: Linux命令:磁盘及文件系统管理 网络
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表