進行流量統計,確認報文的收發情況。
步驟如下:
a、先定義acl,匹配ping的源、目的IP地址:
#
acl number 3333
rule 5 permit udp source x.x.x.x 0 destination y.y.y.y 0
rule 10 permit udp source y.y.y.y 0 destination x.x.x.x 0
#
b、再定義流分類、流行為
#
traffic classifier 3333
if-match acl 3333
#
traffic behavior 3333
statistic enable
#
traffic policy 3333
classifier 3333 behavior 3333
#
c、然后在端口上應用流策略,inbound方向和outbound方向,進行統計。
如:
#
interface GigabitEthernet5/0/34
traffic-policy 3333 inbound
traffic-policy 3333 outbound
#
d、進行ping操作,查看流量統計情況。
如:
display traffic policy statistics interface GigabitEthernet 5/0/34 inbound
display traffic policy statistics interface GigabitEthernet 5/0/34 outbound
如果outbound方向沒有統計計數,說明報文沒有發送出去;
如果inbound方向沒有統計計數,說明沒有收到應答報文;
統計計數清除命令參考:
reset traffic policy statistics interface GigabitEthernet 5/0/34 inbound
reset traffic policy statistics interface GigabitEthernet 5/0/34 outbound