1、定义要抓取的内容
acl 2000
rule permit source 36.111.130.192 0.0.0.31
可按实际数据包流向增加acl rule
2、定义类
traffic classifier test
if-match acl 2000
3、定义行为
traffic behavior test
permit
statistic enable
4、定义策略
traffic policy test
classifier test behavior test
5、接口下应用
interface XGigabitEthernet4/0/11
traffic-policy test inbound
可应用在in out两个方向,看实际需求
查看是否有数据包通过
display traffic policy statistics interface xg 4/0/11 inbound
Interface: XGigabitEthernet4/0/11
Traffic policy inbound: test
Rule number: 5
Current status: success
Statistics interval: 300
---------------------------------------------------------------------
Board : 4
---------------------------------------------------------------------
Matched | Packets: 13,132,826
| Bytes: 3,235,909,048
| Rate(pps): 0
| Rate(bps): 0
---------------------------------------------------------------------
Passed | Packets: 13,132,826
| Bytes: 3,235,909,048
| Rate(pps): 0
| Rate(bps): 0
---------------------------------------------------------------------
Dropped | Packets: 0
| Bytes: 0
| Rate(pps): 0
| Rate(bps): 0
---------------------------------------------------------------------
Filter | Packets: 0
| Bytes: 0
---------------------------------------------------------------------
Car | Packets: 0
| Bytes: 0
---------------------------------------------------------------------
通过以上五步即可完成在接口也对acl中指定的数据报文进行统计,
清空计数器
reset traffic policy statistics interfac xg 4/0/11 inbound
转载于:https://blog.51cto.com/lihongweibj/1921247