配置基于类的流量监管示例组网需求S9300通过接口GE2/0/1与路由器互连,企业用户和住宅小区用户可经由S9300和路由器访问网络,如表1所示。企业用户和住宅小区用户的语音业务对应的VLANID分别为120、220,视频业务对应的VLANID分别为110、210,数据业务对应的VLANID分别为100、200。在S9300上需要对不同业务的报文分别进行流量监管,并分别对企业和住宅小区的总流量进行流量监管,以将流量限制在一个合理的范围之内。此外由于来自用户侧的业务报文携带的DSCP优先级并不可靠,在实际应用中,不同业务对于服务质量的需求是不同的,所以在S9300中还需要重标记不同业务报文的DSCP优先级,以利于下游路由器按照报文的不同优先级分别进行处理。具体配置需求如下:表1S9300为上行流量提供的QoS保障用户类型流量类型CIR(Mbit/s)PIR(Mbit/s)DSCP优先级企业用户语音101546视频507530数据406014总流量150-无住宅小区用户语音101546视频406030数据304514总流量120-无图1基于复杂流分类的流量监管配置组网图配置思路采用如下的思路配置基于复杂流分类的流量监管:1.创建VLAN,并配置各接口,使企业用户和住宅用户都能够通过S9300访问网络。2.在S9300上配置基于VLANID进行流分类的匹配规则。3.在S9300上配置QoSCAR,对来自和发往企业的报文进行总流量的监管,对来自和发往住宅小区的报文进行总流量的监管。4.在S9300上配置流行为,对来自用户侧的报文进行流量监管并且重标记报文的DSCP优先级,对发往用户侧的报文进行流量监管。5.在S9300上配置流策略,绑定已经配置好的流行为和流分类,并应用到流经报文的接口上。数据准备为完成此配置例,需准备如下的数据:对不同VLANID的报文进行重标记后的优先级值。对不同VLANID的报文进行流量监管的参数:承诺信息速率、峰值信息速率。需要应用流策略的接口类型、方向和编号。操作步骤1.创建VLAN并配置各接口#在S9300上创建VLAN100、110、120、200、210、220。Quidwaysystem-view[Quidway]sysnameS9300[S9300]vlanbatch100110120200210220#将接口GE1/0/1、GE1/0/2、GE2/0/1的接入类型分别配置为trunk,并分别将接口GE1/0/1加入VLAN100、VLAN110、VLAN120;接口GE1/0/2加入VLAN200、VLAN210、VLAN220;接口GE2/0/1加入VLAN100、VLAN110、VLAN120、VLAN200、VLAN210、VLAN220。[S9300]interfacegigabitethernet1/0/1[S9300-GigabitEthernet1/0/1]portlink-typetrunk[S9300-GigabitEthernet1/0/1]porttrunkallow-passvlan100110120[S9300-GigabitEthernet1/0/1]quit[S9300]interfacegigabitethernet1/0/2[S9300-GigabitEthernet1/0/2]portlink-typetrunk[S9300-GigabitEthernet1/0/2]porttrunkallow-passvlan200210220[S9300-GigabitEthernet1/0/2]quit[S9300]interfacegigabitethernet2/0/1[S9300-GigabitEthernet2/0/1]portlink-typetrunk[S9300-GigabitEthernet2/0/1]porttrunkallow-passvlan100110120200210220[S9300-GigabitEthernet2/0/1]quit2.配置流分类#在S9300上创建流分类c1~c6,对来自和发往用户的报文按照其VLANID进行分类。Quidwaysystem-view[Quidway]sysnameS9300[S9300]trafficclassifierc1operatorand[S9300-classifier-c1]if-matchvlan-id120[S9300-classifier-c1]quit[S9300]trafficclassifierc2operatorand[S9300-classifier-c2]if-matchvlan-id110[S9300-classifier-c2]quit[S9300]trafficclassifierc3operatorand[S9300-classifier-c3]if-matchvlan-id100[S9300-classifier-c3]quit[S9300]trafficclassifierc4operatorand[S9300-classifier-c4]if-matchvlan-id220[S9300-classifier-c4]quit[S9300]trafficclassifierc5operatorand[S9300-classifier-c5]if-matchvlan-id210[S9300-classifier-c5]quit[S9300]trafficclassifierc6operatorand[S9300-classifier-c6]if-matchvlan-id200[S9300-classifier-c6]quit3.配置QoSCAR#在S9300上创建QoSCAR模板qoscar1、qoscar2,对来自和发往企业、住宅用户小区的流量进行监管。[S9300]qoscarqoscar1cir150000[S9300]qoscarqoscar2cir1200004.配置流量监管行为#在S9300上创建流行为b1~b6,对用户报文进行流量监管以及重标记优先级。[S9300]trafficbehaviorb1[S9300-behavior-b1]carcir10000pir15000greenpass[S9300-behavior-b1]remarkdscp46[S9300-behavior-b1]carqoscar1share[S9300-behavior-b1]statisticenable[S9300-behavior-b1]quit[S9300]trafficbehaviorb2[S9300-behavior-b2]carcir50000pir75000greenpass[S9300-behavior-b2]remarkdscp30[S9300-behavior-b2]carqoscar1share[S9300-behavior-b2]statisticenable[S9300-behavior-b2]quit[S9300]trafficbehaviorb3[S9300-behavior-b3]carcir40000pir60000greenpass[S9300-behavior-b3]remarkdscp14[S9300-behavior-b3]carqoscar1share[S9300-behavior-b3]statisticenable[S9300-behavior-b3]quit[S9300]trafficbehaviorb4[S9300-behavior-b4]carcir10000pir15000greenpass[S9300-behavior-b4]remarkdscp46[S9300-behavior-b4]carqoscar2share[S9300-behavior-b4]statisticenable[S9300-behavior-b4]quit[S9300]trafficbehaviorb5[S9300-behavior-b5]carcir40000pir60000greenpass[S9300-behavior-b5]remarkdscp30[S9300-behavior-b5]carqoscar2share[S9300-behavior-b5]statisticenable[S9300-behavior-b5]quit[S9300]trafficbehaviorb6[S9300-behavior-b6]carcir30000pir45000greenpass[S9300-behavior-b6]remarkdscp14[S9300-behavior-b6]carqoscar2share[S9300-behavior-b6]statisticenable[S9300-behavior-b6]quit5.配置流量监管策略并应用到接口上#在S9300上创建流策略p1,将流分类和对应的流行为进行绑定并将流策略应用到接口GE1/0/1和GE1/0/2的入方向上,对来自用户侧的报文进行流量监管和重标记。[S9300]trafficpolicyp1[S9300-trafficpolicy-p1]classifierc1behaviorb1[S9300-trafficpolicy-p1]classifierc2behaviorb2[S9300-trafficpolicy-p1]classifierc3behaviorb3[S9300-trafficpolicy-p1]classifierc4behaviorb4[S9300-trafficpolicy-p1]classifierc5behaviorb5[S9300-trafficpolicy-p1]classifierc6behaviorb6[S9300-trafficpolicy-p1]quit[S9300]interfacegigabitethernet1/0/1[S9300-GigabitEthernet1/0/1]traffic-policyp1inbound[S9300-GigabitEthernet1/0/1]quit[S9300]interfacegigabitethernet1/0/2[S9300-GigabitEthernet1/0/2]traffic-policyp1inbound[S9300-GigabitEthernet1/0/2]quit6.验证配置结果#查看流分类的配置信息。[S9300]displaytrafficclassifieruser-definedUserDefinedClassifierInformation:Classifier:c6Precedence:30Operator:ANDRule(s):if-match5vlan-id200Classifier:c4Precedence:20Operator:ANDRule(s):if-match5vlan-id220Classifier:c2Precedence:10Operator:ANDRule(s):if-match5vlan-id110Classifier:c5Precedence:25Operator:ANDRule(s):if-match5vlan-id210Classifier:c3Precedence:15Operator:ANDRule(s):if-match5vlan-id100Classifier:c1Precedence:5Operator:ANDRule(s):if-match5vlan-id120#查看流策略的配置信息,以流策略p1为例。[S9300]displaytrafficpolicyuser-definedp1UserDefinedTrafficPolicyInformation:Policy:p1Classifier:default-cl