39-通过QoS本地标识符实现分层QoS典型配置举例
本章节下载: 39-通过QoS本地标识符实现分层QoS典型配置举例 (131.51 KB)
重标记qos-local-id功能主要用于将匹配多种分类条件的报文进行重分类,再为这个重分类配置流行为的情况。本章为您介绍使用重标记QoS本地标识符功能实现分层QoS的配置举例
表1 配置适用的产品与软硬件版本关系
产品 |
软件版本 |
S5830V2&S5820V2系列以太网交换机 |
Release 2208P01,Release 2210 |
某公司内网的结构如图1所示,现要求使用流量监管和重标记QoS本地标识符功能,对各部门访问外网的流量进行限速。其中对管理部和研发部分别限速1024Kbps,市场部(包含两个子部门)的总流量限速为2048Kbps。
图1 通过QoS本地标识符实现分层QoS组网示意图
流分类和流行为的配对的生效顺序与配置顺序保持一致,因此在配置QoS策略时,需要首先配置重标记QoS本地标识符的配对,然后再配置对该QoS本地标识符的流量进行其他动作的配对。
# 创建基本IPv4 ACL 2001,匹配管理部发送的流量。
<SwitchA> system-view
[SwitchA] acl number 2001
[SwitchA-acl-basic-2001] rule permit source 192.168.1.0 0.0.0.255
[SwitchA-acl-basic-2001] quit
# 创建基本IPv4 ACL 2002,匹配研发部发送的流量。
[SwitchA] acl number 2002
[SwitchA-acl-basic-2002] rule permit source 192.168.2.0 0.0.0.255
[SwitchA-acl-basic-2002] quit
# 创建流分类admin,匹配管理部发送的流量(即匹配ACL 2001)。
[SwitchA] traffic classifier admin
[SwitchA-classifier-admin] if-match acl 2001
[SwitchA-classifier-admin] quit
# 创建流分类rd,匹配研发部发送的流量(即匹配ACL 2002)。
[SwitchA] traffic classifier rd
[SwitchA-classifier-rd] if-match acl 2002
[SwitchA-classifier-rd] quit
# 创建流行为car_admin_rd,动作为流量监管,限速值为1024Kbps。
[SwitchA] traffic behavior car_admin_rd
[SwitchA-behavior-car_admin_rd] car cir 1024
[SwitchA-behavior-car_admin_rd] quit
# 创建QoS策略car,将流分类admin和rd分别与流行为car_admin_rd进行配对。
[SwitchA] qos policy car
[SwitchA-qospolicy-car] classifier admin behavior car_admin_rd
[SwitchA-qospolicy-car] classifier rd behavior car_admin_rd
[SwitchA-qospolicy-car] quit
# 创建基本IPv4 ACL 2003,匹配市场一部发送的流量。
[SwitchA] acl number 2003
[SwitchA-acl-basic-2003] rule permit source 192.168.3.0 0.0.0.255
[SwitchA-acl-basic-2003] quit
# 创建基本IPv4 ACL 2004,匹配市场二部发送的流量。
[SwitchA] acl number 2004
[SwitchA-acl-basic-2004] rule permit source 192.168.4.0 0.0.0.255
[SwitchA-acl-basic-2004] quit
# 创建流分类marketing,匹配条件为市场一部或市场二部的流量。
[SwitchA] traffic classifier marketing operator or
[SwitchA-classifier-marketing] if-match acl 2003
[SwitchA-classifier-marketing] if-match acl 2004
[SwitchA-classifier-marketing] quit
# 创建流行为remark_local_id,动作为重标记QoS本地标识符为100。
[SwitchA] traffic behavior remark_local_id
[SwitchA-behavior-remark_local_id] remark qos-local-id 100
[SwitchA-behavior-remark_local_id] quit
# 创建流分类marketing_car,匹配条件为市场一部或市场二部的流量。
[SwitchA] traffic classifier marketing_car
[SwitchA-classifier-marketing_car] if-match qos-local-id 100
[SwitchA-classifier-marketing_car] quit
# 创建流行为marketing_car,动作为流量监管,限速值为2048Kbps。
[SwitchA] traffic behavior marketing_car
[SwitchA-behavior-marketing_car] car cir 2048
[SwitchA-behavior-marketing_car] quit
# 在QoS策略car中,将流分类marketing和流行为remark_local_id进行配对,即使用QoS本地标识符100来标记市场部的流量。
[SwitchA] qos policy car
[SwitchA-qospolicy-car] classifier marketing behavior remark_local_id
# 然后将流分类marketing_car和流行为marketing_car进行配对,即对QoS本地标识符为100的流量进行限速。
[SwitchA-qospolicy-car] classifier marketing_car behavior marketing_car
[SwitchA-qospolicy-car] quit
# 将QoS策略car应用在端口Ten-GigabitEthernet1/0/1的入方向上,完成流量监管配置。
[SwitchA] interface Ten-GigabitEthernet 1/0/1
[SwitchA-Ten-GigabitEthernet1/0/1] qos apply policy car inbound
# 查看端口Ten-GigabitEthernet1/0/1上应用的QoS策略。
[SwitchA] display qos policy interface Ten-GigabitEthernet 1/0/1
Interface: Ten-GigabitEthernet1/0/1
Direction: Inbound
Policy: car
Classifier: admin
Operator: AND
Rule(s) : If-match acl 2001
Behavior: car_admin_rd
Committed Access Rate:
CIR 1024 (kbps), CBS 64000 (Bytes), EBS 512 (Bytes)
Green action: pass
Yellow action: pass
Red action: discard
Green packets: 0 (Packets)
Red packets: 0 (Packets)
Classifier: rd
Operator: AND
Rule(s) : If-match acl 2002
Behavior: car_admin_rd
Committed Access Rate:
CIR 1024 (kbps), CBS 64000 (Bytes), EBS 512 (Bytes)
Green action: pass
Yellow action: pass
Red action: discard
Green packets: 0 (Packets)
Red packets: 0 (Packets)
Classifier: marketing
Operator: OR
Rule(s) : If-match acl 2003
If-match acl 2004
Behavior: remark_local_id
Marking:
Remark qos local ID 100
Classifier: marketing_car
Operator: AND
Rule(s) : If-match qos-local-id 100
Behavior: marketing_car
Committed Access Rate:
CIR 2048 (kbps), CBS 128000 (Bytes), EBS 512 (Bytes)
Green action: pass
Yellow action: pass
Red action: discard
Green packets: 0 (Packets)
Red packets: 0 (Packets)
#
acl number 2001
rule 0 permit source 192.168.1.0 0.0.0.255
acl number 2002
rule 0 permit source 192.168.2.0 0.0.0.255
acl number 2003
rule 0 permit source 192.168.3.0 0.0.0.255
acl number 2004
rule 0 permit source 192.168.4.0 0.0.0.255
#
traffic classifier marketing operator or
if-match acl 2003
if-match acl 2004
traffic classifier marketing_car operator and
if-match qos-local-id 100
traffic classifier rd operator and
if-match acl 2002
traffic classifier admin operator and
if-match acl 2001
#
traffic behavior car_admin_rd
car cir 1024 cbs 64000 ebs 512 green pass red discard yellow pass
traffic behavior marketing_car
car cir 2048 cbs 128000 ebs 512 green pass red discard yellow pass
traffic behavior remark_local_id
remark qos-local-id 100
#
qos policy car
classifier admin behavior car_admin_rd
classifier rd behavior car_admin_rd
classifier marketing behavior remark_local_id
classifier marketing_car behavior marketing_car
#
interface Ten-GigabitEthernet1/0/1
qos apply policy car inbound
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!