文章目录
第一:配置流统
#确认需要执行流统的接口,与两端的ip
#撰写acl匹配(需要统计的流量,源做目的,目的做源.需要正反写两条rule条目)
acl number 3000
rule 0 permit ip source 192.168.1.2 0 destination 192.168.1.3 0
rule 1 permit ip source 192.168.1.3 0 destination 192.168.1.2 0
#
traffic classifier 3000 operator and
if-match acl 3000
#
traffic behavior 3000
permit
statistic enable
#在流行为中 开启流量统计功能 statistic enable
#
traffic policy 3000
classifier 3000 behavior 3000
#
#在流量的进入交换机的接口和出交换机的接口上都要双方向调用流策略
interface GigabitEthernet0/0/1
traffic-policy 3000 inbound
traffic-policy 3000 outbound
#
#在流量的进入交换机的接口和出交换机的接口上都要双方向调用流策略
interface GigabitEthernet0/0/2
traffic-policy 3000 inbound
traffic-policy 3000 outbound
#先清除统计计数
reset traffic policy statistics interface GigabitEthernet 0/0/1 inbound
reset traffic policy statistics interface GigabitEthernet 0/0/1 outbound
reset counters interface gigabitethernet 0/0/3 #清除普通接口的流量统计
第二步:ping测试
第三步:查看统计
#入接口GigabitEthernet 0/0/1 inbound 方向通过的数据包个数 等于出接口GigabitEthernet 0/0/2 outbound方向通过的数据包个数,表明ping的请求包交换机没有丢包
#入接口GigabitEthernet 0/0/1 outbound 方向通过的数据包个数 等于出接口GigabitEthernet 0/0/2 inbound方向通过的数据包个数,表明ping的回包交换机没有丢包
display traffic policy statistics interface GigabitEthernet 0/0/1 inbound
display traffic policy statistics interface GigabitEthernet 0/0/2 outbound
如果文章对你有帮助,欢迎点击上方按钮打赏作者
暂无评论