当前位置:   article > 正文

华为策略流控

华为策略流控

以下脚本仅做参考,具体IP地址和接口请按照现场实际情况写入。

 

[Huawei]acl 3001

[Huawei-acl-adv-3001]rule permit ip source 192.168.1.10 0.0.0.0 destination 192.168.2.10 0.0.0.0 //匹配需要做测试的源和目标地址

[Huawei-acl-adv-3001]rule permit ip source 192.168.2.10 0.0.0.0 destination 192.168.1.10 0.0.0.0 //将源和目的反过来

[Huawei-acl-adv-3001]q

[Huawei]

[Huawei]traffic classifier c2 //创建流分类

[Huawei-classifier-c2]if-match acl 3001 //在流分类中挂入ACL

[Huawei-classifier-c2]q

[Huawei]

[Huawei]traffic behavior b2 //创建流行为

[Huawei-behavior-b2]statistic enable //在流动作中开启流量统计功能

[Huawei-behavior-b2]q

[Huawei]

[Huawei]traffic policy p2 //创建流策略

[Huawei-trafficpolicy-p2]classifier c2 behavior b2 //将之前创建的流分类和流行为进行捆绑

[Huawei-trafficpolicy-p2]q

[Huawei]

[Huawei]interface g 0/0/10 //进流量的接口

[Huawei-GigabitEthernet0/0/10]traffic-policyp2inbound

[Huawei-GigabitEthernet0/0/10]traffic-policyp2 outbound

[Huawei-GigabitEthernet0/0/10]q

[Huawei]

[Huawei]int g 0/0/20 //出流量的接口

[Huawei-GigabitEthernet0/0/20]traffic-policyp2 inbound

[Huawei-GigabitEthernet0/0/20]traffic-policyp2 outbound

[Huawei-GigabitEthernet0/0/20]q

[Huawei]

 

写好以上配置后,先清空一次计数信息,以保证接口流统计数归零。

 

<Huawei>reset traffic policy statistics interface GigabitEthernet 0/0/10 inbound

<Huawei>reset traffic policy statistics interface GigabitEthernet 0/0/10 outbound清空接口计数

<Huawei>reset traffic policy statistics interface GigabitEthernet 0/0/20 inbound

<Huawei>reset traffic policy statistics interface GigabitEthernet 0/0/20 outbound清空接口计数

 

开始ping或者通信,查看测试结果:

display traffic policy statistics interface GigabitEthernet 0/0/10 inbound

display traffic policy statistics interface GigabitEthernet 0/0/10 outbound

display traffic policy statistics interface GigabitEthernet 0/0/20 inbound

display traffic policy statistics interface GigabitEthernet 0/0/20 outbound

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/703645
推荐阅读
相关标签
  

闽ICP备14008679号