天天看點

小巧的丢包方法

在連接配接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

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

檢視轉發的資料包

dis traffic policy statistics interface g0/0/5 inbound

dis traffic policy statistics interface g0/0/5 outbound

dis traffic policy statistics interface g0/0/23 inbound

dis traffic policy statistics interface g0/0/23 outbound

分别在多台裝置上檢視流量來計算丢包在那裡,丢包率多少。(reset沒有找到清空的選項,比較簡單的清空統計方法就是接口下undo掉 traffic-policy然後再應用下。

繼續閱讀