分类 排错案例 下的文章

华为交换机 丢包统计方法

丢包拓扑.png

在连接pc两端的交换机上配置。

定义ACL
acl number 3000
rule 5 permit icmp source 192.168.2.7 0 destination 192.168.1.254 0
acl number 3001
rule 5 permit icmp source 192.168.1.254 0 destination 192.168.2.7 0
匹配ACL
traffic classifier 1 operator and
if-match acl 3000
traffic classifier 2 operator and
if-match acl 3001
统计流
traffic behavior 1
statistic enable
traffic behavior 2
statistic enable

traffic policy 100
classifier 1 behavior 1
traffic policy 200
classifier 2 behavior 2

应用到接口
interface GigabitEthernet0/0/5
traffic-policy 100 inbound
traffic-policy 200 outbound

interface GigabitEthernet0/0/23
traffic-policy 200 inbound
traffic-policy 100 outbound

ping 192.168.1.254
C:UsersAdministrator>ping 192.168.1.254

正在 Ping 192.168.1.254 具有 32 字节的数据:
来自 192.168.1.254 的回复: 字节=32 时间=1ms TTL=128
来自 192.168.1.254 的回复: 字节=32 时间=1ms TTL=128
来自 192.168.1.254 的回复: 字节=32 时间=1ms TTL=128
来自 192.168.1.254 的回复: 字节=32 时间=1ms TTL=128

查看转发的数据包
dis traffic policy statistics interface g0/0/5 inbound
5in.png
dis traffic policy statistics interface g0/0/5 outbound
5out.png
dis traffic policy statistics interface g0/0/23 inbound
23in.png
dis traffic policy statistics interface g0/0/23 outbound
23out.png

分别在多台设备上查看流量来计算丢包在那里,丢包率多少。(reset没有找到清空的选项,比较简单的清空统计方法就是接口下undo掉 traffic-policy然后再应用下。