MQC(Modular QoS Command-Line Interface,模块化QoS命令行)是指通过将具有某类共同特征的数据流划分为一类,并为同一类数据流提供相同的服务,也可以对不同类的数据流提供不同的服务。
MQC三要素
1. 实验目的
2. 实验拓扑
实验拓扑如图所示:
3. 实验步骤
(1) IP地址的配置
AR1的配置
[Huawei]undo info-center enable
[Huawei]sysname AR1
[AR1]int g0/0/0
[AR1-GigabitEthernet0/0/0]ip address 10.0.1.254 24
[AR1-GigabitEthernet0/0/0]quit
[AR1]int g0/0/1
[AR1-GigabitEthernet0/0/1]ip address 10.0.2.254 24
[AR1-GigabitEthernet0/0/1]quit
[AR1]int g0/0/2
[AR1-GigabitEthernet0/0/2]ip address 12.1.1.1 24
[AR1-GigabitEthernet0/0/2]quit
[AR1]int g4/0/0
[AR1-GigabitEthernet4/0/0]ip ad
[AR1-GigabitEthernet4/0/0]ip address 13.1.1.1 24
[AR1-GigabitEthernet4/0/0]quit
AR2的配置
[Huawei]undo info-center enable
[Huawei]sysname AR2
[AR2]int g0/0/0
[AR2-GigabitEthernet0/0/0]ip address 12.1.1.2 24
[AR2-GigabitEthernet0/0/0]quit
[AR2]int g0/0/1
[AR2-GigabitEthernet0/0/1]ip address 24.1.1.2 24
[AR2-GigabitEthernet0/0/1]quit
AR3的配置
[Huawei]undo info-center enable
[Huawei]sysname AR3
[AR3]int g0/0/0
[AR3-GigabitEthernet0/0/0]ip address 13.1.1.3 24
[AR3-GigabitEthernet0/0/0]quit
[AR3]int g0/0/1
[AR3-GigabitEthernet0/0/1]ip address 34.1.1.3 24
[AR3-GigabitEthernet0/0/1]quit
AR4的配置
[Huawei]undo info-center enable
[Huawei]sysname AR4
[AR4]int g0/0/0
[AR4-GigabitEthernet0/0/0]ip address 24.1.1.4 24
[AR4-GigabitEthernet0/0/0]quit
[AR4]int g0/0/1
[AR4-GigabitEthernet0/0/1]ip address 34.1.1.4 24
[AR4-GigabitEthernet0/0/1]quit
[AR4]int g0/0/2
[AR4-GigabitEthernet0/0/2]ip address 10.0.3.254 24
[AR4-GigabitEthernet0/0/2]quit
PC1的配置
PC1的配置如图所示:
PC2的配置
PC2的配置如图所示:
PC3的配置
PC3的配置如图所示:
想要华为数通配套实验拓扑和配置笔记的朋友们点赞+关注,评论区留下邮箱发给你!
(2) 配置OSPF
AR1的配置
[AR1]ospf router-id 1.1.1.1
[AR1-ospf-1]area 0
[AR1-ospf-1-area-0.0.0.0]network 10.0.1.0 0.0.0.255
[AR1-ospf-1-area-0.0.0.0]network 10.0.2.0 0.0.0.255
[AR1-ospf-1-area-0.0.0.0]network 12.1.1.0 0.0.0.255
[AR1-ospf-1-area-0.0.0.0]network 13.1.1.0 0.0.0.255
[AR1-ospf-1-area-0.0.0.0]quit
AR2的配置
[AR2]ospf router-id 2.2.2.2
[AR2-ospf-1]area 0
[AR2-ospf-1-area-0.0.0.0]network 12.1.1.0 0.0.0.255
[AR2-ospf-1-area-0.0.0.0]network 24.1.1.0 0.0.0.255
[AR2-ospf-1-area-0.0.0.0]quit
AR3的配置
[AR3]ospf router-id 3.3.3.3
[AR3-ospf-1]area 0
[AR3-ospf-1-area-0.0.0.0]network 13.1.1.0 0.0.0.255
[AR3-ospf-1-area-0.0.0.0]network 34.1.1.0 0.0.0.255
[AR3-ospf-1-area-0.0.0.0]quit
AR4的配置
[AR4]ospf router-id 4.4.4.4
[AR4-ospf-1]area 0
[AR4-ospf-1-area-0.0.0.0]network 24.1.1.0 0.0.0.255
[AR4-ospf-1-area-0.0.0.0]network 34.1.1.0 0.0.0.255
[AR4-ospf-1-area-0.0.0.0]network 10.0.3.0 0.0.0.255
[AR4-ospf-1-area-0.0.0.0]quit
(3) 查看AR1上的OSPF路由表
[AR1]display ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 3 Routes : 4
OSPF routing table status :
Destinations : 3 Routes : 4
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.3.0/24 OSPF 10 3 D 12.1.1.2 GigabitEthernet0/0/2
OSPF 10 3 D 13.1.1.3 GigabitEthernet4/0/0
24.1.1.0/24 OSPF 10 2 D 12.1.1.2 GigabitEthernet0/0/2
34.1.1.0/24 OSPF 10 2 D 13.1.1.3 GigabitEthernet4/0/0
OSPF routing table status :
Destinations : 0 Routes : 0
以上输出我们可以发现从AR1去往PC3存在等价路由,也就是说PC1去访问PC3的流量路径可能是PC1-AR1-AR2-AR4-PC3,也可能是PC1-AR1-AR3-AR4-PC3
(4) 配置MQC使得PC1访问PC3的流量路径为PC1-AR1-AR2-AR4-PC3,PC2访问PC3的流量路径为PC2-AR1-AR3-AR4-PC3
PC1访问PC3的的配置
[AR1]acl 3000
[AR1-acl-adv-3000]rule 5 permit ip source 10.0.1.1 0 destination 10.0.3.1 0
[AR1-acl-adv-3000]quit
[AR1]traffic classifier pc1-pc3 operator or // 定义流分类
[AR1-classifier-pc1-pc3]if-match acl 3000
[AR1-classifier-pc1-pc3]quit
[AR1]traffic behavior pc1-pc3 //定义流行为
[AR1-behavior-pc1-pc3]redirect ip-nexthop 12.1.1.2
[AR1-behavior-pc1-pc3]quit
[AR1]traffic policy pc1-pc3 //绑定流分类和流行为
[AR1-trafficpolicy-pc1-pc3]classifier pc1-pc3 behavior pc1-pc3
[AR1-trafficpolicy-pc1-pc3]quit
[AR1]interface g0/0/0 //接口调用流策略
[AR1-GigabitEthernet0/0/0]traffic-policy pc1-pc3 inbound
[AR1-GigabitEthernet0/0/0]quit
PC2访问PC3的的配置
[AR1]acl 3001
[AR1-acl-adv-3001]rule 5 permit ip source 10.0.2.1 0 destination 10.0.3.1 0
[AR1-acl-adv-3001]quit
[AR1]traffic classifier pc2-pc3 operator or
[AR1-classifier-pc2-pc3]if-match acl 3000
[AR1-classifier-pc2-pc3]quit
[AR1]traffic behavior pc2-pc3
[AR1-behavior-pc2-pc3]redirect ip-nexthop 13.1.1.3
[AR1-behavior-pc2-pc3]quit
[AR1]traffic policy pc2-pc3
[AR1-trafficpolicy-pc2-pc3]classifier pc2-pc3 behavior pc2-pc3
[AR1-trafficpolicy-pc2-pc3]quit
[AR1]int g0/0/1
[AR1-GigabitEthernet0/0/1]traffic-policy pc2-pc3 inbound
[AR1-GigabitEthernet0/0/1]quit
4. 实验调试
(1)在PC1上tracert 10.0.3.1
PC1的配置如图所示:
通过以上输出可以看到PC1访问PC3的路径为PC1-AR1-AR2-AR4-PC3
(2)在PC2上tracert 10.0.3.1
PC2的配置如图所示:
通过以上输出可以看到PC2访问PC3的路径为PC2-AR1-AR3-AR4-PC3