• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 新华三人才研学中心
  • 关于我们

08-ACL和QoS配置举例

目录

03-S12500_流量监管典型配置举例

本章节下载 03-S12500_流量监管典型配置举例  (177.61 KB)

docurl=/cn/Service/Document_Software/Document_Center/Switches/Catalog/S12500/S12500/Configure/Typical_Configuration_Example/H3C_S12500-R7129-6W100/08/201309/796622_30005_0.htm

03-S12500_流量监管典型配置举例


1  简介

本文档介绍了流量监管的配置举例。

流量监管就是对流量进行控制,通过监督进入网络的流量速率,对超出部分的流量进行“惩罚”,使进入的流量被限制在一个合理的范围之内,以保护网络资源和运营商的利益。

流量监管分为:聚合CAR和普通CAR。聚合CAR是指能够对多个端口上的业务流使用同一个CAR进行流量监管,即如果多个端口应用同一聚合CAR,则这多个端口的流量之和必须在此聚合CAR设定的流量监管范围之内。普通CAR与聚合CAR不同,在端口上应用的普通CAR无法实现对多个端口的流量之和进行流量监管,不同端口上应用的普通CAR需要单独配置。

2  配置前提

本文档中的配置均是在实验室环境下进行的配置和验证,配置前设备的所有参数均采用出厂时的缺省配置。如果您已经对设备进行了配置,为了保证配置效果,请确认现有配置和以下举例中的配置不冲突。

本文假设您已了解流量监管特性。

3  使用限制

引用聚合CAR的多个端口需在同一个转发模块上,否则每个转发模块上的流量可以单独达到聚合CAR配置的监管带宽。即聚合CAR只对同一个转发模块上的端口有效。另外,同一个转发模块上的聚合CAR,在上行方向和下行方向也都分别可以达到监管带宽。

不同类型的单板上一个转发模块所包含的端口数量及编号不同,具体如下:

·     对于48个端口的GE单板,前24个端口属于一个转发模块,后24个端口属于另一个转发模块;

·     对于10GE单板(除了LST1XP32REB1、LST1XP32REC1、LST2XP32REB1、LST2XP32REC1、LST2XP32REC2、LST1XP16LEB1、LST1XP16LEC1和LST1XP16LEC2单板之外),按照端口顺序,单板上每2个10GE端口属于一个转发模块;

·     对于LST1XP32REB1、LST1XP32REC1、LST2XP32REB1、LST2XP32REC1和LST2XP32REC2单板,单板上编号为1、3、5、7、9、11、13、15的端口属于一个转发模块;编号为17、19、21、23、25、27、29、31的端口属于一个转发模块;编号为2、4、6、8、10、12、14、16的端口属于一个转发模块;编号为18、20、22、24、26、28、30、32的端口属于一个转发模块;

·     对于LST1XP16LEB1、LST1XP16LEC1和LST1XP16LEC2单板,单板每相隔的2个10GE端口属于一个转发模块,如1、3属于一个转发模块,2、4属于另一个转发模块。

4  普通CAR配置举例

4.1  组网需求

图1所示,企业网用户的IP地址为10.0.0.2/24,通过Switch连接Internet。Switch为运营商设备。要求在Switch上配置流量监管来实现对企业网用户1Mbps上行带宽和2Mbps下行带宽的限制。

图1 普通CAR配置组网图

 

4.2  配置思路

流量监管功能通过QoS策略来实现。本举例中,用户使用固定IP地址,因此可以通过匹配用户IP地址的方法匹配用户流量,并对其做流量监管。

4.3  使用版本

本举例是在S12500-CMW710-R7129版本上进行配置和验证的。

4.4  配置步骤

# 配置ACL规则匹配源IP地址为10.0.0.2的流量。

<Switch> system-view

[Switch] acl number 3001

[Switch-acl-adv-3001] rule permit ip source 10.0.0.2 0

[Switch-acl-adv-3001] quit

# 配置ACL规则匹配目的IP地址为10.0.0.2的流量。

[Switch] acl number 3002

[Switch-acl-adv-3002] rule permit ip destination 10.0.0.2 0

[Switch-acl-adv-3002] quit

# 配置流分类,匹配ACL规则3001,即匹配源IP地址为10.0.0.2的流量。

[Switch] traffic classifier source_hostA

[Switch-classifier-source_hostA] if-match acl 3001

[Switch-classifier-source_hostA] quit

# 配置流分类,匹配ACL规则3002,即匹配目的IP地址为10.0.0.2的流量。

[Switch] traffic classifier destination_hostA

[Switch-classifier-destination_hostA] if-match acl 3002

[Switch-classifier-destination_hostA] quit

# 配置流行为,用于对上行流量进行流量监管,速率为1Mbps。

[Switch] traffic behavior uplink

[Switch-behavior-uplink] car cir 1000

[Switch-behavior-uplink] quit

# 配置流行为,用于对下行流量进行流量监管,速率为2Mbps。

[Switch] traffic behavior downlink

[Switch-behavior-downlink] car cir 2000

[Switch-behavior-downlink] quit

# 配置QoS策略,用于端口入方向,即用户的上行方向。

[Switch] qos policy uplink

[Switch-qospolicy-uplink] classifier source_hostA behavior uplink

[Switch-qospolicy-uplink] quit

# 配置QoS策略,用于端口出方向,即用户的下行方向。

[Switch] qos policy downlink

[Switch-qospolicy-downlink] classifier destination_hostA behavior downlink

[Switch-qospolicy-downlink] quit

# 在Switch连接用户侧端口GE3/0/1上应用QoS策略,对出入方向的流量分别进行流量监管。

[Switch] interface GigabitEthernet 3/0/1

[Switch-GigabitEthernet3/0/1] undo shutdown

[Switch-GigabitEthernet3/0/1] qos apply policy uplink inbound

[Switch-GigabitEthernet3/0/1] qos apply policy downlink outbound

4.5  验证配置

# 查看Switch的端口GE3/0/1上QoS策略的配置信息。

[Switch] display qos policy interface GigabitEthernet 3/0/1

 

Interface: GigabitEthernet3/0/1

 

  Direction: Inbound

 

  Policy: uplink

   Classifier: source_hostA

     Operator: AND

     Rule(s) : If-match acl 3001

     Behavior: uplink

      Committed Access Rate:

        CIR 1000 (kbps), CBS 62500 (Bytes), EBS 0 (Bytes)

        Red action: discard

        Green packets: 0 (Bytes)

        Yellow packets: 0 (Bytes)

        Red packets: 0 (Bytes)

 

  Direction: Outbound

 

  Policy: downlink

   Classifier: destination_hostA

     Operator: AND

     Rule(s) : If-match acl 3002

     Behavior: downlink

      Committed Access Rate:

        CIR 2000 (kbps), CBS 125000 (Bytes), EBS 0 (Bytes)

        Red action: discard

        Green packets: 0 (Bytes)

        Yellow packets: 0 (Bytes)

        Red packets: 0 (Bytes)

4.6  配置文件

#

traffic classifier destination_hostA operator and

 if-match acl 3002

#

traffic classifier source_hostA operator and

 if-match acl 3001

#

traffic behavior downlink

 car cir 2000 cbs 125000 ebs 0 red discard

#

traffic behavior uplink

 car cir 1000 cbs 62500 ebs 0 red discard

#

qos policy downlink

 classifier destination_hostA behavior downlink

#

qos policy uplink

 classifier source_hostA behavior uplink

#

interface GigabitEthernet3/0/1

 port link-mode bridge

 qos apply policy uplink inbound

 qos apply policy downlink outbound

#

acl number 3001

 rule 0 permit ip source 10.0.0.2 0

#

acl number 3002

 rule 0 permit ip destination 10.0.0.2 0

#

5  聚合CAR配置举例

5.1  组网需求

图2所示,企业网用户出于可靠性考虑,租用运营商的两条链路连接Internet。但是用户总共只租用了10Mbps的带宽(上下行各10Mbps),且每条链路上转发的流量时刻变化。要求通过配置聚合CAR对总流量进行流量监管。

图2 聚合CAR配置组网图

 

5.2  配置思路

要求两条链路的带宽和为限制值,可以在两条链路与Switch连接的端口GE3/0/1和GE3/0/5的出入方向上分别配置聚合CAR对上下行流量进行监管。

5.3  使用版本

本举例是在S12500-CMW710-R7129版本上进行配置和验证的。

5.4  配置步骤

·     配置上行方向聚合CAR

# 配置ACL规则,匹配上行流量的源IP地址。

<Switch> system-view

[Switch] acl number 3001

[Switch-acl-adv-3001] rule permit ip source 10.0.0.2 0

[Switch-acl-adv-3001] rule permit ip source 20.0.0.2 0

[Switch-acl-adv-3001] quit

# 配置流分类,引用ACL。

[Switch] traffic classifier uplink operator or

[Switch-classifier-uplink] if-match acl 3001

[Switch-classifier-uplink] quit

# 配置聚合CAR,流量带宽为10Mbps。

[Switch] qos car uplink aggregative cir 10000

# 配置流行为,在流行为中引用聚合CAR。

[Switch] traffic behavior uplink

[Switch-behavior-uplink] car name uplink

[Switch-behavior-uplink] quit

# 配置QoS策略。

[Switch] qos policy uplink

[Switch-qospolicy-uplink] classifier uplink behavior uplink

[Switch-qospolicy-uplink] quit

# 在端口GE3/0/1和GE3/0/5的入方向上分别应用QoS策略。

[Switch] interface GigabitEthernet 3/0/1

[Switch-GigabitEthernet3/0/1] qos apply policy uplink inbound

[Switch-GigabitEthernet3/0/1] undo shutdown

[Switch-GigabitEthernet3/0/1] quit

[Switch] interface GigabitEthernet 3/0/5

[Switch-GigabitEthernet3/0/5] qos apply policy uplink inbound

[Switch-GigabitEthernet3/0/5] undo shutdown

[Switch-GigabitEthernet3/0/5] quit

·     配置下行方向聚合CAR

# 配置ACL规则,匹配下行流量的目的IP地址。

[Switch] acl number 3002

[Switch-acl-adv-3002] rule permit ip destination 10.0.0.2 0

[Switch-acl-adv-3002] rule permit ip destination 20.0.0.2 0

[Switch-acl-adv-3002] quit

# 配置流分类,引用ACL。

[Switch] traffic classifier downlink operator or

[Switch-classifier-downlink] if-match acl 3002

[Switch-classifier-downlink] quit

# 配置聚合CAR,流量带宽为10Mbps。

[Switch] qos car downlink aggregative cir 10000

# 配置流行为,在流行为中引用聚合CAR。

[Switch] traffic behavior downlink

[Switch-behavior-downlink] car name downlink

[Switch-behavior-downlink] quit

# 配置QoS策略。

[Switch] qos policy downlink

[Switch-qospolicy-downlink] classifier downlink behavior downlink

[Switch-qospolicy-downlink] quit

# 在端口GE3/0/1和GE3/0/5的出方向上分别应用QoS策略。

[Switch] interface GigabitEthernet 3/0/1

[Switch-GigabitEthernet3/0/1] qos apply policy downlink outbound

[Switch-GigabitEthernet3/0/1] quit

[Switch] interface GigabitEthernet 3/0/5

[Switch-GigabitEthernet3/0/5] qos apply policy downlink outbound

[Switch-GigabitEthernet3/0/5] quit

5.5  验证配置

# 查看Switch的端口GE3/0/1上所配置的QoS策略。

[Switch] display qos policy interface GigabitEthernet 3/0/1

 

Interface: GigabitEthernet3/0/1

 

  Direction: Inbound

 

  Policy: uplink

   Classifier: uplink

     Operator: OR

     Rule(s) : If-match acl 3001

     Behavior: uplink

      Committed Access Rate:

        Car name: uplink

 

  Direction: Outbound

 

  Policy: downlink

   Classifier: downlink

     Operator: OR

     Rule(s) : If-match acl 3002

     Behavior: downlink

      Committed Access Rate:

        Car name: downlink

# 查看Switch的端口GE3/0/5上所配置的QoS策略。

[Switch] display qos policy interface GigabitEthernet 3/0/5

 

Interface: GigabitEthernet3/0/5

 

  Direction: Inbound

 

  Policy: uplink

   Classifier: uplink

     Operator: OR

     Rule(s) : If-match acl 3001

     Behavior: uplink

      Committed Access Rate:

        Car name: uplink

 

  Direction: Outbound

 

  Policy: downlink

   Classifier: downlink

     Operator: OR

     Rule(s) : If-match acl 3002

     Behavior: downlink

      Committed Access Rate:

        Car name: downlink

5.6  配置文件

#

 qos car downlink aggregative cir 10000 cbs 625000 ebs 0 red discard

 qos car uplink aggregative cir 10000 cbs 625000 ebs 0 red discard

#

traffic classifier downlink operator or

 if-match acl 3002

#

traffic classifier uplink operator or

 if-match acl 3001

#

traffic behavior downlink

 car name downlink

#

traffic behavior uplink

 car name uplink

#

qos policy downlink

 classifier downlink behavior downlink

#

qos policy uplink

 classifier uplink behavior uplink

#

interface GigabitEthernet3/0/1

 port link-mode bridge

 qos apply policy uplink inbound

 qos apply policy downlink outbound

#

interface GigabitEthernet3/0/5

 port link-mode bridge

 qos apply policy uplink inbound

 qos apply policy downlink outbound

#

acl number 3001

 rule 0 permit ip source 10.0.0.2 0

 rule 5 permit ip source 20.0.0.2 0

#

acl number 3002

 rule 0 permit ip destination 10.0.0.2 0

 rule 5 permit ip destination 20.0.0.2 0

#

6  相关资料

·     《H3C S12500系列路由交换机  ACL和QoS配置指导》中的“QoS”

·     《H3C S12500系列路由交换机  ACL和QoS命令参考》中的“QoS”

 

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们