评分并提供意见反馈 :
华为采用机器翻译与人工审校相结合的方式将此文档翻译成不同语言,希望能帮助您更容易理解此文档的内容。 请注意:即使是最好的机器翻译,其准确度也不及专业翻译人员的水平。 华为对于翻译的准确性不承担任何责任,并建议您参考英文文档(已提供链接)。
配置VLAN报文复杂流分类的流量策略示例
以特性的VLAN QoS场景为例,介绍优先级规则配置及其应用。
组网需求
如图5-6所示,DeviceA和DeviceB通过VLAN网络互联,当有IP数据流从DeviceA进入VLAN网络时,默认将IP报文中的优先级拷贝到VLAN帧的优先级,当从VLAN网络进入到DeviceB时,通过在DeviceB上配置按照VLAN帧优先级进行匹配的规则,实现设置从DeviceB转发出去的IP数据包的IP优先级。
本例中interface1,interface2,interface3分别代表GE0/1/0,GE0/2/0,GE0/3/0。
操作步骤
- 定义一个类,匹配VLAN帧的8021P域为2的数据包。
<HUAWEI> system-view
[~HUAWEI] sysname DeviceB
[*HUAWEI] commit
[~DeviceB] traffic classifier test
[*DeviceB-classifier-test] if-match 8021p 2
[*DeviceB-classifier-test] commit
[~DeviceB-classifier-test] quit
- 定义流行为,设置IP的优先级为4。
[~DeviceB] traffic behavior test
[*DeviceB-behavior-test] remark ip-precedence 4
[*DeviceB-behavior-test] commit
[~DeviceB-behavior-test] quit
- 定义QoS策略,将已配置的流行为指定给已经定义的类。
[~DeviceB] traffic policy test
[*DeviceB-trafficpolicy-test] classifier test behavior test
[*DeviceB-trafficpolicy-test] commit
[~DeviceB-trafficpolicy-test] quit
- 将已定义的QoS策略应用在路由器DeviceB的GE0/2/0.1入方向。
[~DeviceB] interface Gigabitethernet 0/2/0.1
[~DeviceB-Gigabitethernet0/2/0.1] traffic-policy test inbound link-layer
[*DeviceB-Gigabitethernet0/2/0.1] commit
[~DeviceB-Gigabitethernet0/2/0.1] quit
- 检查配置结果
配置完成后,DeviceA上通过GE0/1/0.1转发IP优先级为2的数据包时,可以观察到进入到VLAN网络的VLAN帧的优先级为2,当该VLAN帧到达DeviceB,并转发至10.1.2.0/24网段时,可以观察到此时IP数据包的IP优先级为4。
配置文件
路由器DeviceB的配置文件
#
sysname DeviceB
#
traffic classifier test operator or
if-match 8021p 2
#
traffic behavior test
remark ip-precedence 4
#
traffic policy test
classifier test behavior test precedence 5
#
interface GigabitEthernet0/2/0.1
undo shutdown
vlan-type dot1q 10
traffic-policy test inbound link-layer