【路由器流统】
# 配置ACL规则。
[HUAWEI] acl number 3001
[HUAWEI-acl-adv-3001] rule 5 permit ip source 192.168.1.253 0 destination 10.1.2.252 0
# 配置流分类。
[HUAWEI] traffic classifier test
[HUAWEI-classifier-test] if-match acl 3001
# 配置流行为。
[HUAWEI] traffic behavior test
[HUAWEI-behavior-test] statistic enable
# 配置流策略。
[HUAWEI] traffic policy test
[HUAWEI-trafficpolicy-test] classifier test behavior test
#应用流策略。
[HUAWEI] interface gigabitethernet0/0/6 //数据通过的物理接口
[HUAWEI-GigabitEthernet0/0/6] traffic-policy test inbound
[HUAWEI] interface gigabitethernet0/0/6
[HUAWEI-GigabitEthernet0/0/6] traffic-policy test outbound
配置完成后,ping测试。
查看流量统计信息
display traffic policy statistics interface gigabitethernet 0/0/6 inbound verbose classifier-base class test
display traffic policy statistics interface gigabitethernet 0/0/6 outbound verbose classifier-base class test
如果需要重新进行流量统计,可执行命令清除原有流量统计信息
reset traffic policy statistics interface gigabitethernet 0/0/6 inbound
reset traffic policy statistics interface gigabitethernet 0/0/6 outbound