和大家分享一下H3C S5120-EI交换机做限速的方法。这款交换机端口限速只支持出方向,入方向上只能基于IP做QoS限速,并且将QoS应用在接口上时也只支持入方向。
1、 出方向限速 <switch>system-view #进入配置模式 [switch]interface GigabitEthernet 1/0/1 [switch]qos lr outbound cir 512 #将端口出方向限制为512K
2、 入方向限速 配置设备Device A: # 配置acl 2002,匹配来源于指定IP的报文流。 <DeviceA> system-view [DeviceA] acl number 2002 [DeviceA-acl-basic-2002] rule permit source 1.1.1.2 0 [DeviceA-acl-basic-2002] quit #创建流分类host,匹配规则为ACL 2002。 [DeviceA] traffic classifier host [DeviceA-classifier-host] if-match acl 2002 [DeviceA-classifier-host] quit # 创建流行为host,动作为流量监管,cir为256kbps,由于默认对红 色报文的处理方式就是丢弃,因此无需配置。 [DeviceA] traffic behavior host [DeviceA-behavior-host] car cir 256 [DeviceA-behavior-host] quit # 创建QoS策略,命名为car;将流分类host和流行为host进行关联。 [DeviceA] qos policy car [DeviceA-qospolicy-car] classifier host behavior host [DeviceA-qospolicy-car] quit # 将QoS策略car应用到端口GigabitEthernet1/0/1的入方向上。 [DeviceA] interface GigabitEthernet 1/0/1 [DeviceA-GigabitEthernet1/0/1] qos apply policy car inbound |
|