有人在300ping以上的内网ping延迟高踢过比赛吗

Ping和Tracert
&Ping和Tracert
&400热线TOP问题及问题解决方案
问题解决方案
&什么是Ping
Ping简介Ping是排除设备访问故障的常见方法。它使用Internet控制消息协议ICMP(Internet
Control Message Protocol)确定以下内容:
远程设备是否处于可访问状态。
访问远程设备时是否丢失报文。
本端与远程设备之间通信的往返延迟。
Ping的实现过程图21-1 &Ping的流程
Ping的实现过程如所示。SwitchA发送一个Echo Request报文,SwitchB接收到Echo Request报文后,应答一个Echo
Reply报文,SwitchA接收到Echo Reply报文,整个Ping过程就完成了。
Ping成功有以下两个要求:
源端发送的Echo Request报文能够到达目标。
目标应答的Echo Reply报文能够在预先确定的超时时间内到达源端。在交换机上,超时时间的默认值为2000毫秒。
Ping命令格式设备支持的Ping命令 说明: 《S
系列交换机
命令参考》提供了详细的命令参数解释和使用方法。这里只列举了常用的参数,并对参数进行解释说明。
ping [ -a source-ip-address | -i interface-type interface-number |
-m time | -c count | -f | -h ttl-value | { -s packetsize | -range [ min min-size | max max-size | step step-size ] * } | -t timeout ] * host
-a:设置发送Echo Request报文的源IP地址。如果不指定源IP地址,将采用出接口的IP地址作为Echo Request报文发送的源地址。
-i:设置发送Echo Request报文的接口。如果不指定接口,将采用默认的路由出接口。
-m:设置发送下一个Echo Request报文的等待时间。缺省值是500毫秒。
-c:设置发送Echo Request报文的次数,缺省值为5。当网络质量不高时,可以增加发送报文数目,通过丢包率来检测网络质量。
-f:设置发送的报文不分片。使用-f参数后,ICMP报文将不会被分片,如果ICMP报文的大小超过链路的MTU值,ICMP报文将会被丢弃。可以通过不使用-f参数或者增大链路MTU值的方式使ICMP报文不被丢弃。
-h:设置TTL的值,缺省值为255。报文在转发过程中,如果TTL字段的值减为0,设备就会向源端发送ICMP超时报文,表明目的不可达。
-s:设置发送Echo Request报文大小(不含IP和ICMP头),缺省报文长度是56字节。
-range:设置Echo Request报文大小(不含IP和ICMP头)及变化步长。如果指定-range,发送的第一个报文的长度是min,后续报文长度按照步长step递增,直到报文长度达到最大值max。缺省情况下,min为56字节,max为9600字节,步长是1字节。
min:设置Echo Request报文净荷长度的最小值。缺省值是56字节。
max:设置Echo Request报文净荷长度的最大值。缺省值是9600字节。
step:设置报文长度变化的步长。缺省值是1字节。
-t:设置发送完Echo Request后,等待Echo Reply的超时时间。在网络状况不好的情况下,可以适当改大该参数。缺省值为2000毫秒,即2000毫秒内没有收到回复报文即认为目的不可达。
host:目的主机的域名或IP地址。
Ping命令的参数非常的丰富,用户可以依据检测目的、网络类型、当前网络状况等因素选择不同的参数。
电脑支持的Ping命令电脑上的Ping功能与操作系统相关,以下用Windows操作系统为例,列举常用的参数,并对参数进行解释说明。
ping [ -a | -n number | -l number | -t | -f ] * ip-address
-a:将地址解析为主机名。
-n:要发送的回显请求数。
-l:发送缓冲区大小。
-t:持续地Ping直到人为中断,Ctrl+Break暂时中止Ping命令并查看当前的统计结果,而Ctrl+C则中断命令的执行。
-f:发送的报文不分片。
ip-address:指定目的IP地址。
Ping示例以下命令是在交换机上执行。
Ping不通示例。
&SwitchA& ping 192.168.2.25
PING 192.168.2.25: 56
data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
--- 192.168.2.25 ping statistics ---
5 packet(s) transmitted
0 packet(s) received
100.00% packet loss
Ping通示例。
&SwitchA& ping -a 192.168.2.20 -c 7 -s .2.21
PING 192.168.2.21: 2048
data bytes, press CTRL_C to break
Reply from 192.168.2.21: bytes=2048 Sequence=1 ttl=255 time=24 ms
Reply from 192.168.2.21: bytes=2048 Sequence=2 ttl=255 time=6 ms
Reply from 192.168.2.21: bytes=2048 Sequence=3 ttl=255 time=13 ms
Reply from 192.168.2.21: bytes=2048 Sequence=4 ttl=255 time=6 ms
Reply from 192.168.2.21: bytes=2048 Sequence=5 ttl=255 time=12 ms
Reply from 192.168.2.21: bytes=2048 Sequence=6 ttl=255 time=6 ms
Reply from 192.168.2.21: bytes=2048 Sequence=7 ttl=255 time=13 ms
--- 192.168.2.21 ping statistics ---
7 packet(s) transmitted
7 packet(s) received
0.00% packet loss
round-trip min/avg/max = 6/11/24 ms
表21-1 &Ping命令输出信息描述
&为什么Ping不通
说明: 本文档中Ping不通问题定位方法基于特定实验室环境中的设备写作的,通过组网图搭建环境模拟设备故障,并进行解决。设备上的配置前期已做规划,如果您使用的是真实网络,请确保您已经了解所有配置的潜在影响。
本文档中所有的抓包都是针对Ping报文,不涉及到采集或存储个人用户某些通信内容。您在实际组网中抓包,如果涉及到用户某些通信内容,在采集、存储用户通信内容的过程中,您应采取足够的措施以确保用户的通信内容受到严格保护。
&Ping不通故障定位思路
故障分析Ping不通是指Ping报文在网络中传输,由于各种原因(如线路断连、ARP学习失败)而接收不到所有Ping应答报文的现象。
当使用Ping命令,出现Ping不通现象时,第一步需要确定Ping不通的网络位置,其次是确定Ping不通的故障原因,最后针对故障原因进行解决。
确定Ping不通的网络位置一般采用逐段Ping的方法,即依据网段的划分逐个网段进行Ping操作,可以将Ping不通故障最终定位到局部网络之间。
确定Ping不通的故障原因一般采用流量统计或者抓包的方法,通过对统计信息或者获取的报文进行分析,可以预判故障原因,针对故障原因进行排查,从而解决故障。
导致Ping不通的原因非常多,也非常复杂,实际故障定位中需要综合考虑各种原因。经过对常见Ping不通故障的分析,总结出以下几种常见故障:
电脑配置故障
物理线路故障
说明: Ping不通是Ping丢包的极端现象,所以当丢包严重时表现为Ping不通。对于因Ping丢包而引起的Ping不通故障定位及处理方法,请参见。
故障定位如所示,以一个Ping不通的尝试示例,介绍Ping不通故障定位方法。
图21-2 &Ping测试组网图
C:\Users& ping 192.168.4.41
正在 Ping 192.168.4.41 具有 32 字节的数据:
请求超时。
请求超时。
192.168.4.41 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 0,丢失 = 4 (100% 丢失),
依据故障发生的可能原因进行故障定位,故障定位方法如下:
检查Ping操作。
在使用Ping命令时,首先需要检查是否正确的使用Ping命令,例如当Ping报文过大时,报文的出接口MTU值较小,但是又设置了不可分片的功能就会导致Ping不通;其次需要确认Ping的目标地址是否合理,是否正确,错误的目的地址会导致Ping不通。关于Ping命令的使用请见。
缩小故障范围。
当在PC上直接Ping IP地址192.168.4.41不通时,直接判定故障出现的原因非常的困难。此时可以缩小故障范围,在PC上分别Ping
SwitchA、SwitchB、SwitchC和SwitchD,然后在SwitchA上分别Ping SwitchB、SwitchC和SwitchD,依此类推最后可以判断出哪一段网络出现故障。
检查链路和配置。
确定出故障位置后,首先需要对物理环境进行检查,检查内容有:设备接口是否损坏、物理连线是否完好、连接接口是否符合组网规划、光模块是否正确使用;其次需要对常见配置进行检查,检查内容有:端口配置情况、VLAN配置情况、IP地址配置是否正确。
发现异常后需要及时处理,并再次进行测试,如果故障仍未解决,则需要做进一步的故障定位。
故障定位。
# 假设PC上Ping SwitchA的IP地址192.168.1.10不通(其他直连网段Ping不通的故障处理方法类似)。
在PC上进行抓包,在SwitchA上进行抓包或做流量统计。然后分别在PC和SwitchA上执行Ping操作,查看抓包或流量统计结果。
说明: 关于如何配置流量统计和抓包,请见。
设备不自带抓包功能,请从第三方获取抓包软件并进行安装,具体的使用方法请参见相关软件的使用说明。
如果PC上没获取到任何报文信息,SwitchA上可以获取到报文信息,则可以判断为电脑配置故障。故障处理方法请参见。
如果PC和SwitchA上都没获取到任何报文信息,则可以判断为物理线路故障。故障处理方法请参见。
如果PC和SwitchA上都只获取到ARP请求报文,则可以判断为ARP问题、VLAN问题或访问控制问题。故障处理方法请参见、和。
如果PC和SwitchA上获取到正确的ARP报文,但是ICMP报文不正常,则可以判断为访问控制问题。故障处理方法请参见。
说明: 以上是常见的判断方法,在实际网络中需要综合查看、、、和,逐一进行排查。
假设PC上Ping SwitchA的IP地址192.168.1.10能通,PC上Ping SwitchB的IP地址192.168.2.21不通,但是SwitchA上Ping
SwitchB的IP地址192.168.2.21能通。
通过现象可以判断是由于路由问题导致的Ping不通,故障处理方法请参见。
如果需要在设备上做流量统计,请参考如下配置。
ICMP报文的流量统计(以SwitchA为例)。
# 配置进入SwitchA报文的流量统计。
配置ACL规则。
&SwitchA& system-view
[SwitchA] acl number 3000
[SwitchA-acl-adv-3000] rule permit icmp source 192.168.2.21 0 destination 192.168.2.20 0
[SwitchA-acl-adv-3000] quit
配置流分类。
[SwitchA] traffic classifier 3000
[SwitchA-classifier-3000] if-match acl 3000
[SwitchA-classifier-3000] quit
配置流行为。
[SwitchA] traffic behavior 3000
[SwitchA-behavior-3000] statistic enable
[SwitchA-behavior-3000] quit
配置流策略。
[SwitchA] traffic policy 3000
[SwitchA-trafficpolicy-3000] classifier 3000 behavior 3000
[SwitchA-trafficpolicy-3000] quit
在接口上应用流策略
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] traffic-policy 3000 inbound
[SwitchA-GigabitEthernet0/0/2] return
# 配置离开SwitchA报文的流量统计。
配置ACL规则。
&SwitchA& system-view
[SwitchA] acl number 3001
[SwitchA-acl-adv-3001] rule permit icmp source 192.168.2.20 0 destination 192.168.2.21 0
[SwitchA-acl-adv-3001] quit
配置流分类。
[SwitchA] traffic classifier 3001
[SwitchA-classifier-3001] if-match acl 3001
[SwitchA-classifier-3001] quit
配置流行为。
[SwitchA] traffic behavior 3001
[SwitchA-behavior-3001] statistic enable
[SwitchA-behavior-3001] quit
配置流策略。
[SwitchA] traffic policy 3001
[SwitchA-trafficpolicy-3001] classifier 3001 behavior 3001
[SwitchA-trafficpolicy-3001] quit
在接口上应用流策略
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] traffic-policy 3001 outbound
[SwitchA-GigabitEthernet0/0/2] return
通过display traffic policy statistics interface gigabitethernet
0/0/2 inbound verbose rule-base和display traffic policy statistics
interface gigabitethernet 0/0/2 outbound verbose rule-base命令查看接口流量统计信息。
在用户视图下,通过reset traffic policy statistics interface gigabitethernet
0/0/2 inbound和reset traffic policy statistics interface gigabitethernet
0/0/2 outbound命令清除接口的统计信息。
ARP报文的流量统计(以SwitchA为例)。
# 配置进入SwitchA报文的流量统计。
配置流分类。
&SwitchA& system-view
[SwitchA] traffic classifier statarp01
[SwitchA-classifier-statarp01] if-match l2-protocol arp
[SwitchA-classifier-statarp01] if-match destination-mac 4c1f-cc0e-672a
[SwitchA-classifier-statarp01] if-match source-mac 4c1f-cc03-1529
[SwitchA-classifier-statarp01] quit
配置流行为。
[SwitchA] traffic behavior statarp01
[SwitchA-behavior-statarp01] statistic enable
[SwitchA-behavior-statarp01] quit
配置流策略。
[SwitchA] traffic policy statarp01
[SwitchA-trafficpolicy-statarp01] classifier statarp01 behavior statarp01
[SwitchA-trafficpolicy-statarp01] quit
在接口上应用流策略
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] traffic-policy statarp01 inbound
[SwitchA-GigabitEthernet0/0/2] return
# 配置离开SwitchA报文的流量统计。
配置流分类。
&SwitchA& system-view
[SwitchA] traffic classifier statarp02
[SwitchA-classifier-statarp02] if-match l2-protocol arp
[SwitchA-classifier-statarp02] if-match destination-mac 4c1f-cc03-1529
[SwitchA-classifier-statarp02] if-match source-mac 4c1f-cc0e-672a
[SwitchA-classifier-statarp02] quit
配置流行为。
[SwitchA] traffic behavior statarp02
[SwitchA-behavior-statarp02] statistic enable
[SwitchA-behavior-statarp02] quit
配置流策略。
[SwitchA] traffic policy statarp02
[SwitchA-trafficpolicy-statarp02] classifier statarp02 behavior statarp02
[SwitchA-trafficpolicy-statarp02] quit
在接口上应用流策略
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] traffic-policy statarp02 outbound
[SwitchA-GigabitEthernet0/0/2] return
通过display traffic policy statistics interface gigabitethernet
0/0/2 inbound verbose rule-base和display traffic policy statistics
interface gigabitethernet 0/0/2 outbound verbose rule-base命令查看接口流量统计信息。
在用户视图下,通过reset traffic policy statistics interface gigabitethernet
0/0/2 inbound和reset traffic policy statistics interface gigabitethernet
0/0/2 outbound命令清除接口的统计信息。
如果需要通过镜像来进行抓包,请参考以下配置。
如果端口上流量不大,可以配置端口镜像,确认报文的收发情况(以SwitchA为例)。
配置观察口。
&SwitchA& system-view
[SwitchA] observe-port 1 interface gigabitethernet 0/0/5
配置镜像口,获取双向报文。
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] port-mirroring to observe-port 1 both
[SwitchA-GigabitEthernet0/0/2] return
如果端口上流量比较大,可以配置流镜像(以SwitchA为例)。
配置观察口。
&SwitchA& system-view
[SwitchA] observe-port 1 interface gigabitethernet 0/0/5
配置ACL规则。
[SwitchA] acl number 3033
[SwitchA-acl-adv-3033] rule permit icmp source 192.168.2.21 0 destination 192.168.2.20 0
[SwitchA-acl-adv-3033] rule permit icmp source 192.168.2.20 0 destination 192.168.2.21 0
[SwitchA-acl-adv-3033] quit
配置流分类。
[SwitchA] traffic classifier 3033
[SwitchA-classifier-3033] if-match acl 3033
[SwitchA-classifier-3033] quit
配置流行为。
[SwitchA] traffic behavior 3033
[SwitchA-behavior-3033] mirroring to observe-port 1
[SwitchA-behavior-3033] quit
配置流策略。
[SwitchA] traffic policy 3033
[SwitchA-trafficpolicy-3033] classifier 3033 behavior 3033
[SwitchA-trafficpolicy-3033] quit
在接口上应用流策略。
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] traffic-policy 3033 inbound
[SwitchA-GigabitEthernet0/0/2] traffic-policy 3033 outbound
[SwitchA-GigabitEthernet0/0/2] return
&电脑设置故障
故障分析通过可以判断出是否是由于电脑设置故障引起Ping不通。
常见电脑设置故障有以下四种:
电脑的网卡损坏。
电脑的IP地址或者网关设置不正确。
电脑受到病毒攻击。
电脑安装了防火墙限制报文传输。
常见电脑设置故障判断方法如下:
使用ipconfig /all观察本地网络设置是否正确。
C:\Users& ipconfig /all
Windows IP 配置
以太网适配器 本地连接:
连接特定的 DNS 后缀 . . . . . . . :
描述. . . . . . . . . . . . . . . : Xen Net Device Driver
物理地址. . . . . . . . . . . . . : 28-6E-D4-88-B7-19
DHCP 已启用 . . . . . . . . . . . : 是
自动配置已启用. . . . . . . . . . : 是
本地链接 IPv6 地址. . . . . . . . : fe80::dd9a:f549:2b85:b027%13(首选)
IPv4 地址 . . . . . . . . . . . . : 192.168.1.5(首选)
. . . . . . . . . . . . : 255.255.255.0
默认网关. . . . . . . . . . . . . : 192.168.1.1
Ping 127.0.0.1地址检查本地的TCP/IP协议有没有设置好。
C:\Users& ping 127.0.0.1
正在 Ping 127.0.0.1 具有 32 字节的数据:
来自 127.0.0.1 的回复: 字节=32 时间&1ms TTL=128
来自 127.0.0.1 的回复: 字节=32 时间&1ms TTL=128
127.0.0.1 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 0ms,最长 = 0ms,平均 = 0ms
Ping本机IP地址,这样是为了检查本机的IP地址设置和网卡安装配置是否有误。
C:\Users& ping 192.168.1.5
正在 Ping 192.168.1.5 具有 32 字节的数据:
来自 192.168.1.5 的回复: 字节=32 时间&1ms TTL=128
来自 192.168.1.5 的回复: 字节=32 时间&1ms TTL=128
192.168.1.5 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 0ms,最长 = 0ms,平均 = 0ms
如果在MS-DOS方式下执行此命令显示内容为:请求超时,则表明网卡安装或配置有故障。将网线断开再次执行此命令,如果显示正常,则说明本机使用的IP地址可能与另一台正在使用的机器IP地址重复了。如果仍然不正常,则表明本机网卡安装或配置有故障,需继续检查相关网络配置。
Ping本网网关或本网IP地址,这样是为了检查硬件设备是否有故障,也可以检查本机与本地网络连接是否正常。
C:\Users& ping 192.168.1.11
正在 Ping 192.168.1.11 具有 32 字节的数据:
来自 192.168.1.11 的回复: 字节=32 时间&1ms TTL=128
来自 192.168.1.11 的回复: 字节=32 时间&1ms TTL=128
192.168.1.11 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 0ms,最长 = 0ms,平均 = 0ms
如果上述步骤依然不能解决故障,可以更改防火墙的设置,或者更换一台电脑进行测试。
电脑设置故障处理示例以下是用一个Ping不通的尝试示例,说明如何定位电脑设置故障以及解决故障。如所示,PC和设备之间直连。
图21-3 &Ping测试组网
在PC上Ping SwitchA的地址192.168.1.10不通。
C:\Users& ping 192.168.1.10
正在 Ping 192.168.1.10 具有 32 字节的数据:
请求超时。
请求超时。
请求超时。
请求超时。
192.168.1.10 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 0,丢失 = 4 (100% 丢失),
故障定位及处理
抓包分析故障。
为了进一步定位故障原因,先要获取接口报文收发情况,通过分析接口收发报文能够判断故障原因。如何配置抓取接口报文,请参见。
在PC上执行Ping 192.168.1.10命令。
C:\Users& ping 192.168.1.10
正在 Ping 192.168.1.10 具有 32 字节的数据:
请求超时。
请求超时。
请求超时。
请求超时。
192.168.1.10 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 0,丢失 = 4 (100% 丢失),
在PC网卡和SwitchA接口GE0/0/1上进行抓包,均未接收到报文信息。
在SwitchA上执行Ping 192.168.1.5命令。
&SwitchA& ping 192.168.1.5
PING 192.168.1.5: 56
data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
--- 192.168.1.5 ping statistics ---
5 packet(s) transmitted
0 packet(s) received
100.00% packet loss
在PC网卡和SwitchA接口GE0/0/1上进行抓包。获取报文信息如下。
图21-4 &PC网卡报文信息
图21-5 &SwitchA接口GE0/0/1报文信息
通过对比抓包结果可以发现,SwitchA能够正确的发送ICMP报文,PC网卡可以接收对应ICMP报文,但是不能发送ICMP报文,从而判断出是PC端故障。
故障处理。
依据抓包结果可以判断PC不能正常发送ICMP报文,此时可以先排查一下是否是PC的防火墙设置导致的Ping报文被丢弃。尝试关闭PC上的防火墙功能。以Windows 7为例操作过程如下:
“控制面板
& 系统和安全 & Windows 防火墙& 打开或关闭Windows防火墙& 自定义设置”,选中“关闭Windows防火墙(不推荐)”,点击“确定”。
在PC再次Ping SwitchA。如下所示,能够Ping通,故障解决。C:\Users& ping 192.168.1.10
来自 192.168.1.10 的回复: 字节=32 时间&1ms TTL=128
来自 192.168.1.10 的回复: 字节=32 时间&1ms TTL=128
192.168.1.10 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 0ms,最长 = 0ms,平均 = 0ms
&物理链路故障
故障分析通过可以判断出是否是由于物理链路故障引起Ping不通。
常见物理链路故障有以下五种:
光纤或网线连接的端口和网络链路部署要求不一致。
光模块波长参数与实际需求不一致。
设备的通信接口损坏。
物理连接线老化、破损。
接口被阻塞。
常见物理链路故障判断方法如下:
查看设备端口指示灯状态,如果是常灰,说明无连接。此时需要更换接口或者网线再进行尝试。
通过display interface interface-type interface-number命令检查接口的状态,依据端口状态判断故障原因,从而进行解决。
通过display stp brief、display rrpp verbose和display
smart-link group all命令,检查设备上是否运行了STP、RRPP或SMART LINK等二层协议,确认Ping业务经过的物理接口是否被阻塞。如果端口被阻塞,需要修改相关的配置。
物理链路故障处理示例以下是用一个Ping不通的尝试示例,说明如何定位和解决物理链路故障。如所示,设备之间直连。
图21-6 &Ping测试组网
在SwitchA上Ping SwitchB的地址192.168.2.21不通。
&SwitchA& ping 192.168.2.21
PING 192.168.2.21: 56
data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
--- 192.168.2.21 ping statistics ---
5 packet(s) transmitted
0 packet(s) received
100.00% packet loss
故障定位及处理
定位故障原因。
# 查看SwitchA接口状态。
&SwitchA& display interface gigabitethernet 0/0/2
GigabitEthernet0/0/2 current state : DOWN
Line protocol current state : DOWN
Description:
# 查看SwitchB接口状态。
&SwitchB& display interface gigabitethernet 0/0/1
GigabitEthernet0/0/1 current state : DOWN
Line protocol current state : DOWN
Description:
通过查看SwitchA和SwitchB的接口信息,可以发现两台设备的接口都属于DOWN状态,此时可能是物理链路连接中断导致。
处理故障。
# 更换线缆继续测试,确认是不是物理链路故障。
&SwitchA& ping 192.168.2.21
PING 192.168.2.21: 56
data bytes, press CTRL_C to break
Reply from 192.168.2.21: bytes=56 Sequence=1 ttl=255 time=2 ms
Reply from 192.168.2.21: bytes=56 Sequence=2 ttl=255 time=1 ms
Reply from 192.168.2.21: bytes=56 Sequence=3 ttl=255 time=1 ms
Reply from 192.168.2.21: bytes=56 Sequence=4 ttl=255 time=1 ms
Reply from 192.168.2.21: bytes=56 Sequence=5 ttl=255 time=1 ms
--- 192.168.2.21 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/1/2 ms
故障分析通过可以判断出是否是由于ARP问题引起Ping不通。
设备在封装ICMP报文时需要MAC地址,如果对应的MAC地址不存在,则需要进行ARP学习,ARP学习失败会导致Ping报文被丢弃,从而Ping不通。常见ARP问题导致Ping不通,都是因为设备未正确进行ARP学习。
常见ARP问题判断方法如下:
通过display arp interface interface-type interface-number命令,检查直连地址的ARP是否学习正常。
通过display mac-address interface-type interface-number命令查看MAC表项,确认MAC地址的出端口和ARP的物理出端口是否一致。
如果ARP未正常的学习,首先检查接口配置、VLAN配置、VLANIF接口配置、IP地址配置等是否正确,其次检查ARP和ARP安全的配置是否限制了ARP的学习。
ARP问题处理示例以下是用一个Ping不通的尝试示例,说明了如何定位ARP问题以及解决问题。如所示,设备之间直连。
图21-7 &Ping测试组网
在SwitchA上Ping SwitchB的地址192.168.2.21不通。
&SwitchA& ping 192.168.2.21
PING 192.168.2.21: 56
data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
--- 192.168.2.21 ping statistics ---
5 packet(s) transmitted
0 packet(s) received
100.00% packet loss
故障定位及处理
抓包分析故障。
为了进一步定位故障原因,先要获取接口报文收发情况,通过分析接口收发报文能够判断故障原因。如何配置抓取接口报文,请参见。
在SwitchA上执行Ping 192.168.2.21命令,并在SwitchA接口GE0/0/2和SwitchB接口GE0/0/1上进行抓包。获取报文信息如下。
图21-8 &SwitchA接口GE0/0/2报文信息
图21-9 &SwitchB接口GE0/0/1报文信息
在SwitchB上执行Ping 192.168.2.20命令,并在SwitchA接口GE0/0/2和SwitchB接口GE0/0/1上进行抓包。获取报文信息如下。
图21-10 &SwitchB接口GE0/0/1报文信息
图21-11 &SwitchA接口GE0/0/2报文信息
为了进一步确认故障原因,分别查看SwitchA接口GE0/0/2和SwitchB接口GE0/0/1的ARP表项。
查看SwitchA的ARP表项。
&SwitchA& display arp interface gigabitethernet 0/0/2
IP ADDRESS
MAC ADDRESS
EXPIRE(M) TYPE
VPN-INSTANCE
VLAN/CEVLAN
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Interface:0
查看SwitchB的ARP表项。
&SwitchB& display arp interface gigabitethernet 0/0/1
IP ADDRESS
MAC ADDRESS
EXPIRE(M) TYPE
VPN-INSTANCE
VLAN/CEVLAN
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Interface:0
通过查看SwitchA和SwitchB ARP表项可以发现,均未学习到ARP信息。对比SwitchA接口GE0/0/2和SwitchB接口GE0/0/1上的报文信息,可以发现两端发出的报文VLAN
ID不一致。GE0/0/2接口允许通过的VLAN为20,GE0/0/1接口允许通过的VLAN为25。从而可以判断由于接口加入VLAN不一致导致未学习到ARP信息。
检查配置。
# 查看SwitchA的接口配置。
&SwitchA& system-view
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] display this
port link-type trunk
port trunk allow-pass vlan 20
[SwitchA-GigabitEthernet0/0/2] quit
# 查看SwitchB的接口配置。
&SwitchB& system-view
[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] display this
port link-type trunk
port trunk allow-pass vlan 25
[SwitchB-GigabitEthernet0/0/1] quit
通过查看接口配置可以看到,SwitchB的配置不正确,需要修改。
修改配置。
[SwitchB] undo interface vlanif 25
[SwitchB] vlan batch 20
[SwitchB] interface vlanif 20
[SwitchB-Vlanif20] ip address 192.168.2.21 24
[SwitchB-Vlanif20] quit
[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] port trunk allow-pass vlan 20
[SwitchB-GigabitEthernet0/0/1] quit
检查故障是否恢复。
[SwitchA] ping 192.168.2.21
PING 192.168.2.21: 56
data bytes, press CTRL_C to break
Reply from 192.168.2.21: bytes=56 Sequence=1 ttl=255 time=50 ms
Reply from 192.168.2.21: bytes=56 Sequence=2 ttl=255 time=1 ms
Reply from 192.168.2.21: bytes=56 Sequence=3 ttl=255 time=1 ms
Reply from 192.168.2.21: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 192.168.2.21: bytes=56 Sequence=5 ttl=255 time=1 ms
--- 192.168.2.21 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/16/50 ms
故障分析通过可以判断出是否是由于VLAN问题引起Ping不通。
常见VLAN问题有以下三种:
接口未加入已经规划好的VLAN。
接口的链路类型配置不正确。
VLANIF接口的状态不为UP,或配置的IP地址不正确。
常见VLAN问题判断方法如下:
通过display port vlan interface-type interface-number命令,查看接口加入的VLAN。
接口所属的VLAN一般在网络规划的时候已经完成,如果配置错误,需要重新配置。
通过display port vlan interface-type interface-number命令,查看接口的链路类型。
不同的链路类型对通过的报文处理方式不同,配置的时候需要关注,如果配置错误,需要重新配置。
通过display interface brief和display ip interface brief interface-type interface-number命令,查看接口状态和接口与IP的对应关系。
配置VLANIF接口,并将实际物理口加入指定VLAN后,需要保证VLANIF接口状态为UP,才能进行通信。如果配置错误,需要重新配置。
VLAN问题处理示例以下是用一个Ping不通的尝试示例,说明如何定位VLAN问题以及解决问题。如所示,设备之间直连。
图21-12 &Ping测试组网
在SwitchA上Ping SwitchB的地址192.168.2.21不通。
&SwitchA& ping 192.168.2.21
PING 192.168.2.21: 56
data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
--- 192.168.2.21 ping statistics ---
5 packet(s) transmitted
0 packet(s) received
100.00% packet loss
故障定位及处理
查看VLAN相关的配置信息。
# 查看接口加入的VLAN和链路类型。
查看SwitchA接口GE0/0/2信息。
&SwitchA& display port vlan gigabitethernet 0/0/2
Trunk VLAN List
-------------------------------------------------------------------------------
GigabitEthernet0/0/2
查看SwitchB接口GE0/0/1信息。
&SwitchB& display port vlan gigabitethernet 0/0/1
Trunk VLAN List
-------------------------------------------------------------------------------
GigabitEthernet0/0/1
# 查看VLANIF接口状态和接口与IP的对应关系。
查看SwitchA信息。
&SwitchA& display ip interface brief vlanif 20
IP Address/Mask
192.168.2.20/24
查看SwitchB信息。
&SwitchB& display ip interface brief vlanif 20
IP Address/Mask
192.168.2.21/24
通过查看VLAN的相关信息,可以判断是由于接口加入的链路类型不一致导致Ping不通。
检查配置。
# 查看SwitchA的接口配置。
&SwitchA& system-view
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] display this
port link-type trunk
port trunk allow-pass vlan 20
[SwitchA-GigabitEthernet0/0/2] quit
# 查看SwitchB的接口配置。
&SwitchB& system-view
[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] display this
port link-type access
port default vlan 20
通过查看接口配置可以看到,SwitchB的配置不正确,需要修改。
修改配置。
[SwitchB-GigabitEthernet0/0/1] undo port default vlan
[SwitchB-GigabitEthernet0/0/1] port link-type trunk
[SwitchB-GigabitEthernet0/0/1] port trunk allow-pass vlan 20
[SwitchB-GigabitEthernet0/0/1] quit
检查故障是否恢复。
[SwitchA] ping 192.168.2.21
PING 192.168.2.21: 56
data bytes, press CTRL_C to break
Reply from 192.168.2.21: bytes=56 Sequence=1 ttl=255 time=50 ms
Reply from 192.168.2.21: bytes=56 Sequence=2 ttl=255 time=1 ms
Reply from 192.168.2.21: bytes=56 Sequence=3 ttl=255 time=1 ms
Reply from 192.168.2.21: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 192.168.2.21: bytes=56 Sequence=5 ttl=255 time=1 ms
--- 192.168.2.21 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/16/50 ms
故障分析通过可以判断出是否是由于路由问题引起Ping不通。
常见路由问题有以下三种:
没有去目的网段的路由。
目的设备没有回程路由。
设备的路由表已经超规格。
路由配置错误。
常见路由问题判断方法是通过display ip routing-table命令查看路由表信息,看其中是否存在到目的网段的路由,如果没有路由需要重新配置路由。
配置路由时不仅需要关注本端去对端的路由,还需要注意对端的回程路由。设备支持配置多种路由协议,可以依据实际情况进行选择。
路由问题处理示例以下是用一个Ping不通的尝试示例,说明如何定位路由问题以及解决问题。如所示,三台设备组成网络。
图21-13 &Ping测试组网
在SwitchA上Ping SwitchC的地址192.168.3.31不通。
&SwitchA& ping 192.168.3.31
PING 192.168.3.31: 56
data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
--- 192.168.3.31 ping statistics ---
5 packet(s) transmitted
0 packet(s) received
100.00% packet loss
故障定位及处理
定位故障原因。
# 在SwitchA上尝试Ping目的地址192.168.2.21。
&SwitchA& ping 192.168.2.21
PING 192.168.2.21: 56
data bytes, press CTRL_C to break
Reply from 192.168.2.21: bytes=56 Sequence=1 ttl=255 time=50 ms
Reply from 192.168.2.21: bytes=56 Sequence=2 ttl=255 time=50 ms
Reply from 192.168.2.21: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 192.168.2.21: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 192.168.2.21: bytes=56 Sequence=5 ttl=255 time=50 ms
--- 192.168.2.21 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/42/50 ms
# 在SwitchA上尝试Ping目的地址192.168.3.30。
&SwitchA& ping 192.168.3.30
PING 192.168.3.30: 56
data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
--- 192.168.3.30 ping statistics ---
5 packet(s) transmitted
0 packet(s) received
100.00% packet loss
通过上述操作,我们可以判断出SwitchA上没有到192.168.3.0网段的路由。
在SwitchA增加路由。
# 在SwitchA增加到192.168.3.0网段的路由。
&SwitchA& system-view
[SwitchA] ip route-static 192.168.3.0 24 192.168.2.21
[SwitchA] quit
# 再次在SwitchA上尝试Ping目的地址192.168.3.30。
&SwitchA& ping 192.168.3.30
PING 192.168.3.30: 56
data bytes, press CTRL_C to break
Reply from 192.168.3.30: bytes=56 Sequence=1 ttl=255 time=50 ms
Reply from 192.168.3.30: bytes=56 Sequence=2 ttl=255 time=50 ms
Reply from 192.168.3.30: bytes=56 Sequence=3 ttl=255 time=40 ms
Reply from 192.168.3.30: bytes=56 Sequence=4 ttl=255 time=50 ms
Reply from 192.168.3.30: bytes=56 Sequence=5 ttl=255 time=40 ms
--- 192.168.3.30 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 40/46/50 ms
# 在SwitchA上尝试Ping目的地址192.168.3.31。
&SwitchA& ping 192.168.3.31
PING 192.168.3.31: 56
data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
--- 192.168.3.31 ping statistics ---
5 packet(s) transmitted
0 packet(s) received
100.00% packet loss
通过以上操作可以分析出来,SwitchA能够将报文发到192.168.3.0网段上。由于SwitchA和SwitchB直连,SwitchB有到192.168.2.0网段的路由,所以SwitchA能够收到SwitchB的回应报文。
但是,SwitchA接收不到SwitchC回应报文,这说明SwitchC上没有到达192.168.2.0网段的路由。
在SwitchC增加路由。
# 在SwitchC增加到192.168.2.0网段的路由。
&SwitchC& system-view
[SwitchC] ip route-static 192.168.2.0 24 192.168.3.30
[SwitchC] quit
检查故障是否恢复。
# 在SwitchA上尝试Ping目的地址192.168.3.31。
&SwitchA& ping 192.168.3.31
PING 192.168.3.31: 56
data bytes, press CTRL_C to break
Reply from 192.168.3.31: bytes=56 Sequence=1 ttl=254 time=90 ms
Reply from 192.168.3.31: bytes=56 Sequence=2 ttl=254 time=40 ms
Reply from 192.168.3.31: bytes=56 Sequence=3 ttl=254 time=40 ms
Reply from 192.168.3.31: bytes=56 Sequence=4 ttl=254 time=60 ms
Reply from 192.168.3.31: bytes=56 Sequence=5 ttl=254 time=80 ms
--- 192.168.3.31 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 40/62/90 ms
故障分析通过可以判断出是否是由于访问控制引起Ping不通。
为了保护设备安全或业务需要,会经常在设备上配置访问控制,如果Ping报文正好处于访问控制之列,则可能会导致Ping不通。常见访问控制有限制报文类型、过滤源地址或目的地址等。
常见访问控制判断方法如下:
在接口下进行抓包,分析获取报文的信息,然后查看相应的配置。
通过display current-configuration interface interface-type interface-number命令,检查接口上是否存在访问控制的相关配置。
说明: 由于访问控制一般都是依据设备安全或业务需要而配置的,虽然Ping不通但是不影响业务的运行。修改此类问题需要慎重,以免影响设备的正常使用。
访问控制处理示例以下是用一个Ping不通的尝试示例,说明如何定位访问控制问题以及解决问题。如所示,设备之间直连。
图21-14 &Ping测试组网
在SwitchA上Ping SwitchB的地址192.168.2.21不通。
&SwitchA& ping 192.168.2.21
PING 192.168.2.21: 56
data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
--- 192.168.2.21 ping statistics ---
5 packet(s) transmitted
0 packet(s) received
100.00% packet loss
故障定位及处理
抓包分析故障。
为了进一步定位故障原因,先要获取接口报文收发情况,通过分析接口收发报文能够判断故障原因。如何配置抓取接口报文,请参见。
在SwitchA上执行Ping 192.168.2.21命令,并在SwitchA接口GE0/0/2和SwitchB接口GE0/0/1上进行抓包。获取报文信息如下。
图21-15 &SwitchA接口GE0/0/2报文信息
图21-16 &SwitchB接口GE0/0/1报文信息
在SwitchB上执行Ping 192.168.2.20命令,并在SwitchA接口GE0/0/2和SwitchB接口GE0/0/1上进行抓包。获取报文信息如下。
图21-17 &SwitchA接口GE0/0/2报文信息
图21-18 &SwitchB接口GE0/0/1报文信息
通过对比SwitchA接口GE0/0/2和SwitchB接口GE0/0/1的报文,可以发现SwitchA发送Ping请求报文成功,但是SwitchB未作应答;SwitchB发送Ping请求报文成功,且接收到SwitchA的应答报文,但是设备没有做处理。
此时可以判断问题出现在SwitchB上,SwitchB不处理接收到的ICMP报文,无论该报文是请求还是应答报文。此现象一般为设备做了访问控制功能,SwitchB丢弃入方向的ICMP报文。
查看设备配置。
为了进一步定位故障原因,需要查看设备上相关配置信息。
# 检查接口配置。
&SwitchB& display current-configuration interface gigabitethernet 0/0/1
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 20
traffic-policy tp1 inbound
通过查看接口的配置可以发现,接口配置了流量策略功能。
# 然后继续查看配置。
&SwitchB& display traffic policy user-defined
User Defined Traffic Policy Information:
Policy: tp1
Classifier: tc1
Operator: AND
Behavior: tb1
Total policy number is 1
&SwitchB& display traffic classifier user-defined
User Defined Classifier Information:
Classifier: tc1
Operator: AND
Rule(s) : if-match acl 3000
Total classifier number is 1
&SwitchB& display acl 3000
Advanced ACL 3000, 1 rule
Acl's step is 5
rule 5 deny icmp (match-counter 0)
最终可以发现,SwitchB配置了ACL规则,对接收到ICMP报文进行丢弃。
解决故障。
# 删除接口的流量策略功能。
&SwitchB& system-view
[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] undo traffic-policy tp1 inbound
[SwitchB-GigabitEthernet0/0/1] quit
检查故障是否恢复。
&SwitchA& ping 192.168.2.21
PING 192.168.2.21: 56
data bytes, press CTRL_C to break
Reply from 192.168.2.21: bytes=56 Sequence=1 ttl=255 time=30 ms
Reply from 192.168.2.21: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 192.168.2.21: bytes=56 Sequence=3 ttl=255 time=50 ms
Reply from 192.168.2.21: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 192.168.2.21: bytes=56 Sequence=5 ttl=255 time=50 ms
--- 192.168.2.21 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/36/50 ms
&为什么Ping丢包
说明: 本文档中Ping丢包问题定位方法是基于特定实验室环境中的设备写作的,通过组网图搭建环境模拟设备故障,并进行解决。设备上的配置前期已做规划,如果您使用的是真实网络,请确保您已经了解所有配置的潜在影响。
&Ping丢包故障定位思路
故障分析Ping丢包是指Ping报文在网络中传输,由于各种原因(如线路过长、网络拥塞等)而产生部分Ping报文丢弃的现象。
在使用Ping命令,出现Ping丢包的现象时,第一步需要确定Ping丢包的网络位置,其次是确定Ping丢包的故障原因,然后依据定位的故障原因再进行解决。
确认Ping丢包的网络位置时一般采用逐段Ping的方法,可以将Ping丢包故障最终确定在直连网段之间。
确认Ping丢包的故障原因一般采用流量统计的方法,通过流量统计可以知道丢弃报文的具体位置、判断故障原因。
导致Ping丢包的原因非常多,也非常复杂,实际故障定位中需要综合考虑各种因素。本文档针对常见Ping丢包故障分析,总结出以下几种常见故障:
物理环境故障
说明: 需要注意并不是Ping丢包就一定表示网络质量差,某些情况下虽然Ping丢包,但是业务是正常的。分析Ping丢包时注意以下两点:
当设备对报文进行硬件转发,速度非常快,就不会丢包。例如,Ping设备端口下挂的电脑。当报文需要CPU进行处理时,CPU繁忙就会丢包。例如:Ping设备上的IP地址。
为了防止网络攻击对设备造成影响,设备具有CPU保护功能,对于超过CPCAR(Control Plane Committed
Access Rate)值的ARP、ICMP等报文进行丢弃,造成Ping丢包现象。此种现象不影响业务的正常运行。
故障定位如所示,以一个Ping丢包实例,介绍Ping丢包故障定位。
图21-19 &Ping测试组网图
故障现象C:\Users& ping -n 100 192.168.4.41
正在 Ping 192.168.4.41 具有 32 字节的数据:
请求超时。
请求超时。
来自 192.168.4.41 的回复: 字节=32 时间&1ms TTL=128
来自 192.168.4.41 的回复: 字节=32 时间&1ms TTL=128
192.168.4.41 的 Ping 统计信息:
数据包: 已发送 = 100,已接收 = 80,丢失 = 20 (20% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 0ms,最长 = 0ms,平均 = 0ms
依据故障发生的可能原因进行故障定位,故障定位方法如下:
配置Ping多包。
为了持续复现丢包现象,以便于故障处理,需要持续发送Ping报文。可以配置Ping的-c count参数,发送多个Ping报文。关于Ping命令的使用请见。
缩小故障范围。
当在PC上直接Ping IP地址192.168.4.41丢包时,直接判定故障出现的原因将非常的困难。此时可以先缩小故障范围,在PC上分别Ping
SwitchA、SwitchB、SwitchC和SwitchD,通过Ping结果可以判断出哪一段网络出现故障。本例假设PC上Ping
SwitchB时也出现丢包,则可以初步判断丢包发生在SwitchA和SwitchB直连网段之间。
配置流量统计。
通过缩小故障范围最终将故障定位在SwitchA和SwitchB之间,为了进一步确认故障点,需要在SwitchA和SwitchB上配置流量统计功能,观察丢包情况。
在SwitchA上做流量统计
# 配置进入SwitchA报文的流量统计。
配置ACL规则。
&SwitchA& system-view
[SwitchA] acl number 3000
[SwitchA-acl-adv-3000] rule permit icmp source 192.168.2.21 0 destination 192.168.2.20 0
[SwitchA-acl-adv-3000] quit
配置流分类。
[SwitchA] traffic classifier 3000
[SwitchA-classifier-3000] if-match acl 3000
[SwitchA-classifier-3000] quit
配置流行为。
[SwitchA] traffic behavior 3000
[SwitchA-behavior-3000] statistic enable
[SwitchA-behavior-3000] quit
配置流策略。
[SwitchA] traffic policy 3000
[SwitchA-trafficpolicy-3000] classifier 3000 behavior 3000
[SwitchA-trafficpolicy-3000] quit
在接口上应用流策略。
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] traffic-policy 3000 inbound
[SwitchA-GigabitEthernet0/0/2] quit
# 配置离开SwitchA报文的流量统计。
配置ACL规则。
[SwitchA] acl number 3001
[SwitchA-acl-adv-3001] rule permit icmp source 192.168.2.20 0 destination 192.168.2.21 0
[SwitchA-acl-adv-3001] quit
配置流分类。
[SwitchA] traffic classifier 3001
[SwitchA-classifier-3001] if-match acl 3001
[SwitchA-classifier-3001] quit
配置流行为。
[SwitchA] traffic behavior 3001
[SwitchA-behavior-3001] statistic enable
[SwitchA-behavior-3001] quit
配置流策略。
[SwitchA] traffic policy 3001
[SwitchA-trafficpolicy-3001] classifier 3001 behavior 3001
[SwitchA-trafficpolicy-3001] quit
在接口上应用流策略。
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] traffic-policy 3001 outbound
[SwitchA-GigabitEthernet0/0/2] quit
在SwitchB上做流量统计
# 配置进入SwitchB报文的流量统计。
配置ACL规则。
&SwitchB& system-view
[SwitchB] acl number 3000
[SwitchB-acl-adv-3000] rule permit icmp source 192.168.2.20 0 destination 192.168.2.21 0
[SwitchB-acl-adv-3000] quit
配置流分类。
[SwitchB] traffic classifier 3000
[SwitchB-classifier-3000] if-match acl 3000
[SwitchB-classifier-3000] quit
配置流行为。
[SwitchB] traffic behavior 3000
[SwitchB-behavior-3000] statistic enable
[SwitchB-behavior-3000] quit
配置流策略。
[SwitchB] traffic policy 3000
[SwitchB-trafficpolicy-3000] classifier 3000 behavior 3000
[SwitchB-trafficpolicy-3000] quit
在接口上应用流策略。
[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] traffic-policy 3000 inbound
[SwitchB-GigabitEthernet0/0/1] quit
# 配置离开SwitchB报文的流量统计。
配置ACL规则。
[SwitchB] acl number 3001
[SwitchB-acl-adv-3001] rule permit icmp source 192.168.2.21 0 destination 192.168.2.20 0
[SwitchB-acl-adv-3001] quit
配置流分类。
[SwitchB] traffic classifier 3001
[SwitchB-classifier-3001] if-match acl 3001
[SwitchB-classifier-3001] quit
配置流行为。
[SwitchB] traffic behavior 3001
[SwitchB-behavior-3001] statistic enable
[SwitchB-behavior-3001] quit
配置流策略。
[SwitchB] traffic policy 3001
[SwitchB-trafficpolicy-3001] classifier 3001 behavior 3001
[SwitchB-trafficpolicy-3001] quit
在接口上应用流策略。
[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] traffic-policy 3001 outbound
[SwitchB-GigabitEthernet0/0/1] quit
分析统计结果。
在SwitchA上持续Ping SwitchB。
在SwitchA通过display
traffic policy statistics interface gigabitethernet 0/0/2 inbound
rule-base和display traffic policy statistics interface
gigabitethernet 0/0/2 outbound verbose
rule-base命令查看接口流量统计信息。
在SwitchB通过display traffic policy statistics interface gigabitethernet
0/0/1 inbound verbose
rule-base和display traffic policy statistics
interface gigabitethernet 0/0/1 outbound verbose
rule-base命令查看接口流量统计信息。
如果离开SwitchA的报文数目多余进入SwitchB的报文数目,说明传输链路上存在丢包,请依照进行处理。
如果离开SwitchA的报文数目等于进入SwitchB的报文数目,但是离开SwitchB的报文数目少于进入SwitchB报文数目,说明SwitchB上存在丢包。引起SwitchB设备丢包可能原因分为网络环路和ICMP问题。
登录设备,执行命令display cpu-usage和display interface brief持续查看CPU和接口利用率是否很高,执行display mac-address flapping record命令或执行display trapbuffer命令查看是否出现MAC地址漂移。如果出现利用率高或MAC地址漂移现象,请依照进行处理。
登录设备,执行命令display cpu-defend statistics packet-type icmp all查看是否有ICMP报文被丢弃,执行命令display anti-attack statistics icmp-flood查看是否有ICMP报文被丢弃,执行命令display current-configuration | include icmp
rate-limit查看ICMP报文限速的配置是否过小。如果出现报文被丢弃或ICMP报文限速配置得很小,请依照进行处理。
如果离开SwitchA的报文数目少于Ping发送的报文数目,说明SwitchA上丢包。引起SwitchA丢包可能原因分为网络环路和ARP问题。
登录设备,执行命令display cpu-usage和display interface brief持续查看CPU和接口利用率的情况,执行display mac-address flapping record命令或执行display trapbuffer命令查看是否出现MAC地址漂移,如果出现利用率高或MAC地址漂移现象,请依照进行处理。
登录设备,执行命令display arp packet statistics和display cpu-defend
statistics查看是否有ARP报文被丢弃。如果出现报文被丢弃现象,请依照进行处理。
说明: 为了进一步定位故障,也可以在在SwitchB上持续Ping SwitchA,然后分析统计结果。如果需要清除接口的统计信息时,请执行reset traffic policy statistics interface interface-type interface-number { inbound | outbound }命令。
&物理链路故障
故障分析通过可以判断出是否由于物理链路故障引起的丢包。
物理链路故障常见以下原因:
计算机网卡有问题。
设备接口不正常。
线缆接头接触不良或松脱。
网线过长或出现破损。
光纤弯曲度过大。
光模块收发的光功率过低。
电口协商不一致,如一端自协商一端非自协商。
说明: 在实际环境中设备未接地导致静电不能释放、风扇损坏导致设备过热等物理环境问题也会引起Ping丢包。
物理链路故障可以通过观察发现,如光纤弯曲度过大、物理连接线过长、设备或者电脑网卡指示灯显示不正常等。针对物理链路故障,故障的解决的办法一般是更换物理器件,器件更换后故障即可恢复。
物理链路故障处理示例以下是Ping丢包的示例,说明如何定位和解决物理链路故障。如所示,设备之间直连。
图21-20 &Ping测试组网
在SwitchA上Ping SwitchB的地址192.168.2.21丢包。
&SwitchA& ping -c 100 192.168.2.21
PING 192.168.2.21: 56
data bytes, press CTRL_C to break
Reply from 192.168.2.21: bytes=56 Sequence=1 ttl=255 time=1 ms
Request time out
Reply from 192.168.2.21: bytes=56 Sequence=3 ttl=255 time=7 ms
Request time out
Reply from 192.168.2.21: bytes=56 Sequence=100 ttl=255 time=2 ms
--- 192.168.2.21 ping statistics ---
100 packet(s) transmitted
91 packet(s) received
9.00% packet loss
round-trip min/avg/max = 1/1/19 ms
故障定位及处理
定位故障。
分别在SwitchA和SwitchB上做流量统计,关于流量统计的配置方式请参见。
在SwitchA执行ping -c 100 192.168.2.21命令。
查看SwitchA流量统计结果。
# 查看离开SwitchA的流量统计。
&SwitchA& display traffic policy statistics interface gigabitethernet 0/0/2 outbound verbose rule-base
Interface: GigabitEthernet0/0/2
Traffic policy outbound: 3001
Rule number: 1
Current status: OK!
Statistics interval: 300
---------------------------------------------------------------------
Classifier: 3001 operator and
Behavior: 3001
rule 5 permit icmp source 192.168.2.20 0 destination 192.168.2.21 0 (match-counter 0)
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
# 查看进入SwitchA的流量统计。
&SwitchA& display traffic policy statistics interface gigabitethernet 0/0/2 inbound verbose rule-base
Interface: GigabitEthernet0/0/2
Traffic policy inbound: 3000
Rule number: 1
Current status: OK!
Statistics interval: 300
---------------------------------------------------------------------
Classifier: 3000 operator and
Behavior: 3000
rule 5 permit icmp source 192.168.2.21 0 destination 192.168.2.20 0 (match-counter 0)
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
查看SwitchB流量统计结果。
# 查看进入SwitchB的流量统计。
&SwitchB& display traffic policy statistics interface gigabitethernet 0/0/1 inbound verbose rule-base
Interface: GigabitEthernet0/0/1
Traffic policy inbound: 3000
Rule number: 1
Current status: OK!
Statistics interval: 300
---------------------------------------------------------------------
Classifier: 3000 operator and
Behavior: 3000
rule 5 permit icmp source 192.168.2.20 0 destination 192.168.2.21 0 (match-counter 0)
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
# 查看离开SwitchB的流量统计。
&SwitchB& display traffic policy statistics interface gigabitethernet 0/0/1 outbound verbose rule-base
Interface: GigabitEthernet0/0/1
Traffic policy outbound: 3001
Rule number: 1
Current status: OK!
Statistics interval: 300
---------------------------------------------------------------------
Classifier: 3001 operator and
Behavior: 3001
rule 5 permit icmp source 192.168.2.21 0 destination 192.168.2.20 0 (match-counter 0)
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
通过查看SwitchA和SwitchB上的流量统计信息,可以发现进入SwitchB的报文数目少于离开SwitchA的报文数目,进入SwitchA的报文数目少于离开SwitchB的报文数目,因此可以判断是物理链路上发生丢包。
处理故障。
确认是物理链路问题导致丢包后,需要更换连接线缆继续进行测试。
&SwitchA& ping -c 100 192.168.2.21
PING 192.168.2.21: 56
data bytes, press CTRL_C to break
Reply from 192.168.2.21: bytes=56 Sequence=1 ttl=255 time=2 ms
Reply from 192.168.2.21: bytes=56 Sequence=100 ttl=255 time=1 ms
--- 192.168.2.21 ping statistics ---
100 packet(s) transmitted
100 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/2/11 ms
通过测试,未出现丢包现象。
故障分析通过可以判断出是否是由于网络环路导致丢包。
以太网交换网络中为了进行链路备份,提高网络可靠性,通常会使用冗余链路。但是使用冗余链路会在交换网络上产生环路,引发广播风暴以及MAC地址表不稳定等故障现象,从而导致用户通信质量较差,甚至通信中断。网络环路会导致设备CPU和端口利用率高,Ping报文被丢弃。
当设备处于存在环路的网络中,设备的反应速度比较缓慢。环路问题判断方法如下:
通过display interface brief | include up命令,查看所有UP接口下的流量,存在环路的接口上InUti和OutUti两个计数会逐步增加,甚至到接近100%,远远超过业务流量。
第一次查询:
&SwitchA& display interface brief | include up
InUti OutUti
GigabitEthernet0/0/2
第二次查询:&SwitchA& display interface brief | include up
InUti OutUti
GigabitEthernet0/0/2
判断交换机是否存在MAC地址漂移。
可以执行display trapbuffer命令,查看MAC地址漂移的日志来判断。
可以执行mac-address flapping detection命令配置MAC地址漂移检测功能,然后通过display mac-address flapping record命令来判断是否出现MAC地址漂移。
可以多次执行display mac-address来观察,若MAC地址在交换机不同的接口学习到,则存在mac地址漂移。
检查CPU的利用率。
通过命令display cpu-usage查看CPU的利用率。网络环路会导致CPU利用率一直很高,Ping报文未来得及处理就被丢弃。
解决此种Ping丢包问题的方法是破除网络环路,可以在设备上部署RRPP、SEP、Smart Link、STP/RSTP/MSTP等协议,对环路进行处理。
网络环路处理示例以下是Ping丢包的示例,说明如何定位网络环路故障以及解决故障。如所示,设备之间直连。
图21-21 &Ping测试组网
在SwitchA上Ping SwitchB的地址192.168.2.21丢包。
&SwitchA& ping -c 100 -m 5 192.168.2.21
PING 192.168.2.21: 56
data bytes, press CTRL_C to break
Reply from 192.168.2.21: bytes=56 Sequence=1 ttl=255 time=1 ms
Request time out
Reply from 192.168.2.21: bytes=56 Sequence=3 ttl=255 time=7 ms
Request time out
Reply from 192.168.2.21: bytes=56 Sequence=100 ttl=255 time=2 ms
--- 192.168.2.21 ping statistics ---
100 packet(s) transmitted
92 packet(s) received
8.00% packet loss
round-trip min/avg/max = 1/1/17 ms
故障定位及处理
定位故障。
分别在SwitchA和SwitchB上做流量统计,关于流量统计的配置方式请参见。
在SwitchA执行ping -c 100 192.168.2.21命令。
查看SwitchA流量统计结果。
# 查看离开SwitchA的流量统计。
&SwitchA& display traffic policy statistics interface gigabitethernet 0/0/2 outbound verbose rule-base
Interface: GigabitEthernet0/0/2
Traffic policy outbound: 3001
Rule number: 1
Current status: OK!
Statistics interval: 300
---------------------------------------------------------------------
Classifier: 3001 operator and
Behavior: 3001
rule 5 permit icmp source 192.168.2.20 0 destination 192.168.2.21 0 (match-counter 0)
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
# 查看进入SwitchA的流量统计。
&SwitchA& display traffic policy statistics interface gigabitethernet 0/0/2 inbound verbose rule-base
Interface: GigabitEthernet0/0/2
Traffic policy inbound: 3000
Rule number: 1
Current status: OK!
Statistics interval: 300
---------------------------------------------------------------------
Classifier: 3000 operator and
Behavior: 3000
rule 5 permit icmp source 192.168.2.21 0 destination 192.168.2.20 0 (match-counter 0)
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
查看SwitchB流量统计结果。
# 查看进入SwitchB的流量统计。
&SwitchB& display traffic policy statistics interface gigabitethernet 0/0/1 inbound verbose rule-base
Interface: GigabitEthernet0/0/1
Traffic policy inbound: 3000
Rule number: 1
Current status: OK!
Statistics interval: 300
---------------------------------------------------------------------
Classifier: 3000 operator and
Behavior: 3000
rule 5 permit icmp source 192.168.2.20 0 destination 192.168.2.21 0 (match-counter 0)
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
# 查看离开SwitchB的流量统计。
&SwitchB& display traffic policy statistics interface gigabitethernet 0/0/1 outbound verbose rule-base
Interface: GigabitEthernet0/0/1
Traffic policy outbound: 3001
Rule number: 1
Current status: OK!
Statistics interval: 300
---------------------------------------------------------------------
Classifier: 3001 operator and
Behavior: 3001
rule 5 permit icmp source 192.168.2.21 0 destination 192.168.2.20 0 (match-counter 0)
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
通过查看SwitchA和SwitchB上的流量统计信息,可以发现进入SwitchB的报文数目等于离开SwitchA的报文数目,离开SwitchB的报文数目少于进入SwitchB的报文数目,因此可以判断是SwitchB上发生了丢包。需要进一步确认丢包原因。
检查故障原因。
当设备处在存在环路的网络中,设备的反应速度比较缓慢。此时需要查看设备的CPU和接口报文的收发情况,确认是不是环路引起。
# 查看CPU的使用率。
&SwitchB& display cpu-usage
CPU Usage Stat. Cycle: 60 (Second)
: 95% Max: 97%
CPU Usage Stat. Time :
CPU utilization for five seconds: 95%: one minute: 95%: five minutes: 95%
Max CPU Usage Stat. Time :
# 查看接口报文的收发速率。
&SwitchB& display interface brief
InUti OutUti
GigabitEthernet0/0/1
GigabitEthernet0/0/2
GigabitEthernet0/0/3
98.00% 98.00%
GigabitEthernet0/0/4
通过查看SwitchB的CPU利用率和接口的带宽利用率,可以发现SwitchB下挂的网络中可能存在环路,从而导致SwitchB处理Ping报文的时候丢包。为了进一步确认是不是环路问题导致SwitchB上丢包,此时可以关闭SwitchB的GE0/0/3的接口,然后执行Ping操作进行测试。
# 关闭SwitchB的GE0/0/3的接口。
&SwitchB& system-view
[SwitchB] interface gigabitethernet 0/0/3
[SwitchB-GigabitEthernet0/0/3] shutdown
[SwitchB] quit
# 执行Ping操作。
&SwitchA& ping -c 100 192.168.2.21
PING 192.168.2.21: 56
data bytes, press CTRL_C to break
Reply from 192.168.2.21: bytes=56 Sequence=1 ttl=255 time=1 ms
Reply from 192.168.2.21: bytes=56 Sequence=100 ttl=255 time=2 ms
--- 192.168.2.21 ping statistics ---
100 packet(s) transmitted
100 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/1/19 ms
# 验证完成后恢复接口状态。
[SwitchB] interface gigabitethernet 0/0/3
[SwitchB-GigabitEthernet0/0/3] undo shutdown
解决故障。
确认是SwitchB下挂网络环路引起Ping丢包问题后,关闭端口不能从根本上解决问题,此时需要去解决下挂网络的环路问题。通常我们可以在下挂网络中配置MSTP协议进行破环。
问题总结设备的环路有以下几种:
在网络部署的过程中,经常出现接口Tx-Rx(Tx表示光纤发送端,Rx表示光纤接收端)自环的问题,比如光纤插错、本接口被高压击坏等情况都可能导致接口Tx-Rx自环。如所示,Switch的接口发生自环,从而导致从接口发出的报文又环回到本接口,导致流量异常、MAC地址漂移等问题。
图21-22 &接口自环
设备下挂环路
如所示,Switch下挂的网络或设备发生环路,从接口Interface1发出的报文经过Switch下挂网络或设备后被环回至本接口。
图21-23 &设备下挂环路
设备双接口环路
如所示,Switch所在的网络或Switch不同接口之间形成了环路,从Interface1发出的报文被环回至Interface2。
图21-24 &检测设备双接口环路示意图
故障分析通过可以判断是否由于ARP问题导致Ping丢包。
ARP问题常见故障现象:开始(由于ARP学习失败)出现Ping丢包,然后(学习到ARP)在一段时间内(ARP表项老化时间)无丢包现象,后续(再出现ARP学习失败)会继续出现丢包。
常见ARP问题有以下两种:
设备配置了ARP安全功能,如ARP Miss的源抑制、ARP速率抑制等,会导致ARP学习很慢,Ping丢包。
设备受到ARP报文攻击,上送CPU的ARP报文数超过CPCAR值,导致部分ARP报文被丢弃,Ping丢包。
常见问题判断及解决方法如下:
通过display arp packet statistics命令,查看是否有ARP报文被丢弃,分析设备上ARP安全的配置情况,从而判断问题的原因。
对于该问题需要重新配置ARP安全,使设备能够正常的处理ARP报文。
通过display cpu-defend statistics命令,查看CPU对于ARP报文处理情况,是否存在报文丢弃。
对于该问题需要检查设备是否受到ARP攻击,正确配置ARP安全来防范攻击,同时增加ARP报文的CPCAR值。配置样例如下:
&SwitchA& system-view
[SwitchA] cpu-defend policy arp
[SwitchA-cpu-defend-policy-arp] car packet-type arp-reply cir 32
Warning: Improper parameter settings may affect stable operating of the system. Use this command under assistance of Huawei engineers. Continue? [Y/N]:y
[SwitchA-cpu-defend-policy-arp] car packet-type arp-request cir 32
Warning: Improper parameter settings may affect stable operating of the system. Use this command under assistance of Huawei engineers. Continue? [Y/N]:y
[SwitchA-cpu-defend-policy-arp] quit
[SwitchA] cpu-defend-policy arp global
ARP问题处理示例以下是Ping丢包的示例,说明如何定位ARP问题以及解决问题。如所示,设备之间直连。
图21-25 &Ping测试组网
在SwitchA上Ping SwitchB的地址192.168.2.21丢包。
&SwitchA& ping -c 8.2.21
PING 192.168.2.21: 56
data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Reply from 192.168.2.21: bytes=56 Sequence=100 ttl=255 time=1 ms
Reply from 192.168.2.21: bytes=56 Sequence=10000 ttl=255 time=2 ms
--- 192.168.2.21 ping statistics ---
10000 packet(s) transmitted
9000 packet(s) received
10.00% packet loss
round-trip min/avg/max = 1/1/19 ms
故障定位及处理
定位故障。
分别在SwitchA和SwitchB上做流量统计,关于流量统计的配置方式请参见。
在SwitchA执行ping -c 8.2.21命令。
查看SwitchA流量统计结果。
# 查看离开SwitchA的流量统计。
&SwitchA& display traffic policy statistics interface gigabitethernet 0/0/2 outbound verbose rule-base
Interface: GigabitEthernet0/0/2
Traffic policy outbound: 3001
Rule number: 1
Current status: OK!
Statistics interval: 300
---------------------------------------------------------------------
Classifier: 3001 operator and
Behavior: 3001
rule 5 permit icmp source 192.168.2.20 0 destination 192.168.2.21 0 (match-counter 0)
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
# 查看进入SwitchA的流量统计。
&SwitchA& display traffic policy statistics interface gigabitethernet 0/0/2 inbound verbose rule-base
Interface: GigabitEthernet0/0/2
Traffic policy inbound: 3000
Rule number: 1
Current status: OK!
Statistics interval: 300
---------------------------------------------------------------------
Classifier: 3000 operator and
Behavior: 3000
rule 5 permit icmp source 192.168.2.21 0 destination 192.168.2.20 0 (match-counter 0)
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
查看SwitchB流量统计结果。
# 查看进入SwitchB的流量统计。
&SwitchB& display traffic policy statistics interface gigabitethernet 0/0/1 inbound verbose rule-base
Interface: GigabitEthernet0/0/1
Traffic policy inbound: 3000
Rule number: 1
Current status: OK!
Statistics interval: 300
---------------------------------------------------------------------
Classifier: 3000 operator and
Behavior: 3000
rule 5 permit icmp source 192.168.2.20 0 destination 192.168.2.21 0 (match-counter 0)
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
# 查看离开SwitchB的流量统计。
&SwitchB& display traffic policy statistics interface gigabitethernet 0/0/1 outbound verbose rule-base
Interface: GigabitEthernet0/0/1
Traffic policy outbound: 3001
Rule number: 1
Current status: OK!
Statistics interval: 300
---------------------------------------------------------------------
Classifier: 3001 operator and
Behavior: 3001
rule 5 permit icmp source 192.168.2.21 0 destination 192.168.2.20 0 (match-counter 0)
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
通过查看SwitchA和SwitchB上的流量统计信息,可以发现离开SwitchA的报文数目少于Ping发送的报文数目,其他过程未出现丢包,对于这种丢包现象可能就是因为SwitchA进行ARP学习失败导致的,SwitchA进行ARP学习失败一般情况是SwitchB未正确回应ARP报文,所以需要在SwitchB做进一步的排查。
检查故障原因。
# 查看SwitchB上的CPU丢包信息。
&SwitchB& display cpu-defend statistics all
Statistics on slot 0:
--------------------------------------------------------------------------------
Packet Type
Pass(Packet/Byte)
Drop(Packet/Byte)
Last-dropping-time
--------------------------------------------------------------------------------
arp-request
# 查看SwitchB上的ARP报文的CPCAR值。
&SwitchB& display cpu-defend configuration all
Car configurations on slot 0.
----------------------------------------------------------------------
Packet Name
----------------------------------------------------------------------
arp-request
通过以上信息可以看出SwitchB上有部分ARP报文由于超过CPCAR值被丢弃了,SwitchB上ARP报文被丢弃则会导致SwitchA
ARP学习失败,从而引起Ping丢包。
解决故障。
# 通过增加CPCAR值来解决故障。
&SwitchB& system-view
[SwitchB] cpu-defend policy arp
[SwitchB-cpu-defend-policy-arp] car packet-type arp-reply cir 32
Warning: Improper parameter settings may affect stable operating of the system. Use this command under assistance of Huawei engineers. Continue? [Y/N]:y
[SwitchB-cpu-defend-policy-arp] car packet-type arp-request cir 32
Warning: Improper parameter settings may affect stable operating of the system. Use this command under assistance of Huawei engineers. Continue? [Y/N]:y
[SwitchB-cpu-defend-policy-arp] quit
[SwitchB] cpu-defend-policy arp global
检查故障恢复。
&SwitchA& ping -c 8.2.21
PING 192.168.2.21: 56
data bytes, press CTRL_C to break
Reply from 192.168.2.21: bytes=56 Sequence=1 ttl=255 time=1 ms
Reply from 192.168.2.21: bytes=56 Sequence=10000 ttl=255 time=2 ms
--- 192.168.2.21 ping statistics ---
10000 packet(s) transmitted
10000 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/1/19 ms
故障分析通过可以判断是否由于ICMP问题导致Ping丢包。
ICMP问题常见故障现象:
Ping设备时,一旦Ping速度比较快就会丢包,速度慢下来就不会丢包。
Ping大包时出现规律性丢包。
Ping设备时,会出现Ping通几个报文后Ping不通,大约两分钟左右又可以Ping通,Ping通几个报文后又Ping不通。
常见ICMP问题有以下三种:
设备受到ICMP报文攻击,上送CPU的ICMP报文数超过CPCAR值,导致部分ICMP报文被丢弃,Ping丢包。
设备配置ICMP攻击防范,超过速度限制的ICMP报文被丢弃,Ping丢包。
设备配置ICMP限速功能,超过速度限制的ICMP报文被丢弃,Ping丢包。
常见问题判断及解决方法如下:
通过display icmp statistics和display anti-attack statistics
icmp-flood命令查看是否有ICMP报文被丢弃。
对于该问题需要重新配置ICMP安全,使设备能够正常的处理ICMP报文。
检查icmp rate-limit total threshold threshold-value命令的配置情况,了解ICMP流量限速的阈值。
如果阈值过小,则可通过icmp rate-limit total threshold threshold-value命令进行修改,使其允许更多的ICMP报文通过。配置样例如下:
&SwitchA& system-view
[SwitchA] icmp rate-limit enable
[SwitchA] icmp rate-limit total threshold 500
通过display cpu-defend statistics packet-type icmp all命令,查看CPU对于ICMP报文处理情况,是否存在报文丢弃。
对于该问题需要检查设备是否受到ICMP攻击,正确配置ICMP安全来防范攻击,同时增加ICMP报文的CPCAR值。ICMP报文的CPCAR值配置样例如下:
&SwitchA& system-view
[SwitchA] cpu-defend policy icmp
[SwitchA-cpu-defend-policy-icmp] car packet-type icmp cir 256
Warning: Improper parameter settings may affect stable operating of the system. Use this command under assistance of Huawei engineers. Continue? [Y/N]:y
[SwitchA-cpu-defend-policy-icmp] quit
[SwitchA] cpu-defend-policy icmp global
还可以通过icmp-reply fast命令使能Ping快回功能来解决CPU丢弃ICMP报文故障。
ICMP问题处理示例以下是Ping丢包的示例,说明如何定位ICMP问题以及解决问题。如所示,设备之间直连。
图21-26 &Ping测试组网
在SwitchA上Ping SwitchB的地址192.168.2.21丢包。
&SwitchA& ping -c 100 -m 5 192.168.2.21
PING 192.168.2.21: 56
data bytes, press CTRL_C to break
Reply from 192.168.2.21: bytes=56 Sequence=1 ttl=255 time=1 ms
Request time out
Reply from 192.168.2.21: bytes=56 Sequence=100 ttl=255 time=2 ms
--- 192.168.2.21 ping statistics ---
100 packet(s) transmitted
92 packet(s) received
8.00% packet loss
round-trip min/avg/max = 1/1/17 ms
故障定位及处理
定位故障。
分别在SwitchA和SwitchB上做流量统计,关于流量统计的配置方式请参见。
在SwitchA执行ping -c 100 -m 5 192.168.2.21命令。
查看SwitchA流量统计结果。
# 查看离开SwitchA的流量统计。
&SwitchA& display traffic policy statistics interface gigabitethernet 0/0/2 outbound verbose rule-base
Interface: GigabitEthernet0/0/2
Traffic policy outbound: 3001
Rule number: 1
Current status: OK!
Statistics interval: 300
---------------------------------------------------------------------
Classifier: 3001 operator and
Behavior: 3001
rule 5 permit icmp source 192.168.2.20 0 destination 192.168.2.21 0 (match-counter 0)
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
# 查看进入SwitchA的流量统计。
&SwitchA& display traffic policy statistics interface gigabitethernet 0/0/2 inbound verbose rule-base
Interface: GigabitEthernet0/0/2
Traffic policy inbound: 3000
Rule number: 1
Current status: OK!
Statistics interval: 300
---------------------------------------------------------------------
Classifier: 3000 operator and
Behavior: 3000
rule 5 permit icmp source 192.168.2.21 0 destination 192.168.2.20 0 (match-counter 0)
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
查看SwitchB流量统计结果。
# 查看进入SwitchB的流量统计。
&SwitchB& display traffic policy statistics interface gigabitethernet 0/0/1 inbound verbose rule-base
Interface: GigabitEthernet0/0/1
Traffic policy inbound: 3000
Rule number: 1
Current status: OK!
Statistics interval: 300
---------------------------------------------------------------------
Classifier: 3000 operator and
Behavior: 3000
rule 5 permit icmp source 192.168.2.20 0 destination 192.168.2.21 0 (match-counter 0)
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
# 查看离开SwitchB的流量统计。
&SwitchB& display traffic policy statistics interface gigabitethernet 0/0/1 outbound verbose rule-base
Interface: GigabitEthernet0/0/1
Traffic policy outbound: 3001
Rule number: 1
Current status: OK!
Statistics interval: 300
---------------------------------------------------------------------
Classifier: 3001 operator and
Behavior: 3001
rule 5 permit icmp source 192.168.2.21 0 destination 192.168.2.20 0 (match-counter 0)
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
---------------------------------------------------------------------
Rate(pps):
Rate(bps):
----------------------------------------}

我要回帖

更多关于 ping延迟 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信