玩转华为ENSP模拟器系列 | 配置OSPF ABR路由聚合示例
Posted COCOgsta
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了玩转华为ENSP模拟器系列 | 配置OSPF ABR路由聚合示例相关的知识,希望对你有一定的参考价值。
素材来源:华为路由器配置指南
一边学习一边整理试验笔记,并与大家分享,侵权即删,谢谢支持!
附上汇总贴:玩转华为ENSP模拟器系列 | 合集_COCOgsta的博客-CSDN博客_ensp实验大全
目标
举例说明通过OSPF ABR实现路由聚合的配置方法。
组网需求
路由聚合是指将多条具有相同IPv4前缀的路由聚合成一条路由。当大规模部署OSPF网络时,可能会出现由于OSPF路由表规模过大而降低路由查找速度的现象,为了解决这个问题,可以配置路由聚合,减小路由表的规模,降低管理的复杂度。此外,如果被聚合的IPv4地址范围内的某条链路频繁Up和Down,该变化并不会通告到被聚合的IPv4地址范围外的设备。因此,路由聚合还可以避免网络中的路由振荡,在一定程度上提高了网络的稳定性。
如图1所示,所有设备上都运行OSPF。在ABR上对Area 1内的具有相同前缀(10.0.X.X)的路由聚合为一条路由10.0.0.0/16之后,ABR将只发布这一条路由到Area 0区域中,从而减小路由表的规模,降低管理的复杂度,并提高了网络的稳定性。
配置思路
- 配置各接口的IP地址,使网络互通。
- 在所有设备上使能OSPF的基本功能。
- 在ABR上配置OSPF ABR路由聚合。
操作步骤
- 配置各接口的IP地址(略)
- 配置OSPF基本功能
配置Device A。
DeviceA:
router id 3.3.3.3
ospf 1
area 0.0.0.1
network 10.0.12.0 0.0.0.255
配置Device B。
DeviceB:
router id 1.1.1.1
ospf 1
area 0.0.0.0
network 10.1.24.0 0.0.0.255
配置Device C。
DeviceC:
router id 4.4.4.4
ospf 1
area 0.0.0.1
network 10.0.34.0 0.0.0.255
配置ABR。
ABR:
router id 2.2.2.2
ospf 1
area 0.0.0.0
network 10.1.24.0 0.0.0.255
area 0.0.0.1
network 10.0.12.0 0.0.0.255
network 10.0.34.0 0.0.0.255
配置完成后,执行display ospf peer命令,可以看到Device A、Device B和Device C与ABR之间建立了邻居关系。以ABR的显示结果为例:
[~ABR]dis ospf peer
(M) Indicates MADJ neighbor
OSPF Process 1 with Router ID 2.2.2.2
Neighbors
Area 0.0.0.0 interface 10.1.24.2 (Eth1/0/2)'s neighbors
Router ID: 1.1.1.1 Address: 10.1.24.1
State: Full Mode:Nbr is Slave Priority: 1
DR: 10.1.24.2 BDR: 10.1.24.1 MTU: 0
Dead timer due in 31 sec
Retrans timer interval: 5
Neighbor is up for 00h00m26s
Neighbor Up Time : 2019-12-28 09:46:36
Authentication Sequence: [ 0 ]
Area 0.0.0.1 interface 10.0.34.2 (Eth1/0/0)'s neighbors
Router ID: 4.4.4.4 Address: 10.0.34.1
State: Full Mode:Nbr is Master Priority: 1
DR: 10.0.34.1 BDR: 10.0.34.2 MTU: 0
Dead timer due in 34 sec
Retrans timer interval: 5
Neighbor is up for 00h02m55s
Neighbor Up Time : 2019-12-28 09:44:06
Authentication Sequence: [ 0 ]
Area 0.0.0.1 interface 10.0.12.2 (Eth1/0/1)'s neighbors
Router ID: 3.3.3.3 Address: 10.0.12.1
State: Full Mode:Nbr is Master Priority: 1
DR: 10.0.12.1 BDR: 10.0.12.2 MTU: 0
Dead timer due in 40 sec
Retrans timer interval: 5
Neighbor is up for 00h02m49s
Neighbor Up Time : 2019-12-28 09:44:12
Authentication Sequence: [ 0 ]
OSPF Process 65534 with Router ID 128.1.138.138
Neighbors
Area 0.0.0.0 interface 128.1.138.138 (Eth1/0/0.4094)'s neighbors
Router ID: 128.1.138.137 Address: 128.1.138.137
State: Full Mode:Nbr is Slave Priority: 1
DR: None BDR: None MTU: 0
Dead timer due in 38 sec
Retrans timer interval: 5
Neighbor is up for 00h53m31s
Neighbor Up Time : 2019-12-28 08:53:31
Authentication Sequence: [ 0 ]
Area 0.0.0.0 interface 128.1.138.138 (Eth1/0/1.4094)'s neighbors
Router ID: 128.1.138.139 Address: 128.1.138.139
State: Full Mode:Nbr is Master Priority: 1
DR: None BDR: None MTU: 0
Dead timer due in 39 sec
Retrans timer interval: 5
Neighbor is up for 00h53m33s
Neighbor Up Time : 2019-12-28 08:53:29
Authentication Sequence: [ 0 ]
Area 0.0.0.0 interface 128.1.138.138 (Eth1/0/2.4094)'s neighbors
Router ID: 128.1.138.140 Address: 128.1.138.140
State: Full Mode:Nbr is Master Priority: 1
DR: None BDR: None MTU: 0
Dead timer due in 38 sec
Retrans timer interval: 5
Neighbor is up for 00h00m24s
Neighbor Up Time : 2019-12-28 09:46:39
Authentication Sequence: [ 0 ]
Area 0.0.0.0 interface 128.1.138.138 (DCN-Serial1/0/0:0)'s neighbors
Router ID: 128.1.138.137 Address: 128.1.138.137
State: Full Mode:Nbr is Slave Priority: 1
DR: None BDR: None MTU: 0
Dead timer due in 36 sec
Retrans timer interval: 5
Neighbor is up for 00h53m22s
Neighbor Up Time : 2019-12-28 08:53:41
Authentication Sequence: [ 0 ]
Area 0.0.0.0 interface 128.1.138.138 (DCN-Serial1/0/1:0)'s neighbors
Router ID: 128.1.138.139 Address: 128.1.138.139
State: Full Mode:Nbr is Master Priority: 1
DR: None BDR: None MTU: 0
Dead timer due in 30 sec
Retrans timer interval: 5
Neighbor is up for 00h53m22s
Neighbor Up Time : 2019-12-28 08:53:42
Authentication Sequence: [ 0 ]
[~ABR]
在ABR上执行display ospf lsdb命令查看OSPF的链路状态数据库信息。Area 1的数据库中Sum-Net LSA的信息没有进行聚合。因此发布到Area 0的路由没有经过聚合。
[~ABR]dis ospf lsdb
OSPF Process 1 with Router ID 2.2.2.2
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 1.1.1.1 1.1.1.1 78 36 80000002 1
Router 2.2.2.2 2.2.2.2 77 36 80000004 1
Router 10.2.2.2 10.2.2.2 228 36 80000007 1
Network 10.1.24.2 2.2.2.2 77 32 80000001 0
Sum-Net 10.0.12.0 2.2.2.2 82 28 80000002 1
Sum-Net 10.0.34.0 2.2.2.2 82 28 80000002 1
Area: 0.0.0.1
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 2.2.2.2 2.2.2.2 221 48 80000003 1
Router 3.3.3.3 3.3.3.3 222 36 80000002 1
Router 4.4.4.4 4.4.4.4 228 36 80000002 1
Network 10.0.12.1 3.3.3.3 222 32 80000001 0
Network 10.0.34.1 4.4.4.4 228 32 80000001 0
Sum-Net 10.1.24.0 2.2.2.2 224 28 80000001 1
OSPF Process 65534 with Router ID 128.1.138.138
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 128.1.138.137 128.1.138.137 1453 60 80000004 100
Router 128.1.138.138 128.1.138.138 74 96 80000009 100
Router 128.1.138.139 128.1.138.139 1452 60 80000004 100
Router 128.1.138.140 128.1.138.140 75 48 80000005 100
Type 10 Opaque (Area-Local Scope) Database
Type LinkState ID AdvRouter Age Len Sequence Area
Opq-Area 4.0.0.0 128.1.138.137 975 32 80000003 0.0.0.0
Opq-Area 4.0.0.0 128.1.138.138 931 28 80000003 0.0.0.0
Opq-Area 4.0.0.0 128.1.138.139 994 32 80000003 0.0.0.0
Opq-Area 4.0.0.0 128.1.138.140 75 32 80000004 0.0.0.0
Opq-Area 200.1.204.0 128.1.138.137 1512 84 80000002 0.0.0.0
Opq-Area 200.1.204.0 128.1.138.138 1513 84 80000002 0.0.0.0
Opq-Area 200.1.204.0 128.1.138.139 1510 84 80000002 0.0.0.0
Opq-Area 200.1.204.0 128.1.138.140 75 84 80000003 0.0.0.0
Opq-Area 200.255.204.0 128.1.138.137 1453 36 80000003 0.0.0.0
Opq-Area 200.255.204.0 128.1.138.138 1456 36 80000005 0.0.0.0
Opq-Area 200.255.204.0 128.1.138.139 1457 36 80000004 0.0.0.0
Opq-Area 200.255.204.0 128.1.138.140 70 36 80000006 0.0.0.0
Opq-Area 202.255.238.0 128.1.138.137 1512 68 80000002 0.0.0.0
Opq-Area 202.255.238.0 128.1.138.138 1513 68 80000002 0.0.0.0
Opq-Area 202.255.238.0 128.1.138.139 1510 68 80000002 0.0.0.0
Opq-Area 202.255.238.0 128.1.138.140 75 68 80000003 0.0.0.0
[~ABR]
[~ABR]dis ospf lsdb summary
OSPF Process 1 with Router ID 2.2.2.2
Area: 0.0.0.0
Link State Database
Type : Sum-Net
Ls id : 10.0.12.0
Adv rtr : 2.2.2.2
Ls age : 195
Len : 28
Options : E
seq# : 80000002
chksum : 0x300d
Net mask : 255.255.255.0
Tos 0 metric: 1
Type : Sum-Net
Ls id : 10.0.34.0
Adv rtr : 2.2.2.2
Ls age : 195
Len : 28
Options : E
seq# : 80000002
chksum : 0x3de9
Net mask : 255.255.255.0
Tos 0 metric: 1
Area: 0.0.0.1
Link State Database
Type : Sum-Net
Ls id : 10.1.24.0
Adv rtr : 2.2.2.2
Ls age : 337
Len : 28
Options : E
seq# : 80000001
chksum : 0xa18f
Net mask : 255.255.255.0
Tos 0 metric: 1
[~ABR]
- 在ABR上配置路由聚合,将Area 1区域内具有相同前缀的路由聚合为一条路由10.0.0.0/16
ABR:
ospf 1
area 0.0.0.1
abr-summary 10.0.0.0 255.255.0.0
- 验证配置结果
配置完路由聚合后,在ABR上执行display ospf lsdb命令,可以看到Area 1区域内具有相同前缀的路由聚合成了一条路由10.0.0.0/16,这条路由发布到了Area 0区域中。
[~ABR-ospf-1]dis ospf lsdb
OSPF Process 1 with Router ID 2.2.2.2
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 1.1.1.1 1.1.1.1 364 36 80000002 1
Router 2.2.2.2 2.2.2.2 363 36 80000004 1
Router 10.2.2.2 10.2.2.2 514 36 80000007 1
Network 10.1.24.2 2.2.2.2 363 32 80000001 0
Sum-Net 10.0.0.0 2.2.2.2 86 28 80000001 1
Area: 0.0.0.1
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 2.2.2.2 2.2.2.2 507 48 80000003 1
Router 3.3.3.3 3.3.3.3 508 36 80000002 1
Router 4.4.4.4 4.4.4.4 514 36 80000002 1
Network 10.0.12.1 3.3.3.3 508 32 80000001 0
Network 10.0.34.1 4.4.4.4 514 32 80000001 0
Sum-Net 10.1.24.0 2.2.2.2 510 28 80000001 1
OSPF Process 65534 with Router ID 128.1.138.138
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 128.1.138.137 128.1.138.137 1739 60 80000004 100
Router 128.1.138.138 128.1.138.138 360 96 80000009 100
Router 128.1.138.139 128.1.138.139 1738 60 80000004 100
Router 128.1.138.140 128.1.138.140 361 48 80000005 100
Type 10 Opaque (Area-Local Scope) Database
Type LinkState ID AdvRouter Age Len Sequence Area
Opq-Area 4.0.0.0 128.1.138.137 1261 32 80000003 0.0.0.0
Opq-Area 4.0.0.0 128.1.138.138 1217 28 80000003 0.0.0.0
Opq-Area 4.0.0.0 128.1.138.139 1280 32 80000003 0.0.0.0
Opq-Area 4.0.0.0 128.1.138.140 361 32 80000004 0.0.0.0
Opq-Area 200.1.204.0 128.1.138.137 1798 84 80000002 0.0.0.0
Opq-Area 200.1.204.0 128.1.138.138 1799 84 80000002 0.0.0.0
Opq-Area 200.1.204.0 128.1.138.139 1796 84 80000002 0.0.0.0
Opq-Area 200.1.204.0 128.1.138.140 361 84 80000003 0.0.0.0
Opq-Area 200.255.204.0 128.1.138.137 1739 36 80000003 0.0.0.0
Opq-Area 200.255.204.0 128.1.138.138 1742 36 80000005 0.0.0.0
Opq-Area 200.255.204.0 128.1.138.139 1743 36 80000004 0.0.0.0
Opq-Area 200.255.204.0 128.1.138.140 356 36 80000006 0.0.0.0
Opq-Area 202.255.238.0 128.1.138.137 1798 68 80000002 0.0.0.0
Opq-Area 202.255.238.0 128.1.138.138 1799 68 80000002 0.0.0.0
Opq-Area 202.255.238.0 128.1.138.139 1796 68 80000002 0.0.0.0
Opq-Area 202.255.238.0 128.1.138.140 361 68 80000003 0.0.0.0
[~ABR-ospf-1]
[~ABR-ospf-1]dis ospf lsdb summary
OSPF Process 1 with Router ID 2.2.2.2
Area: 0.0.0.0
Link State Database
Type : Sum-Net
Ls id : 10.0.0.0
Adv rtr : 2.2.2.2
Ls age : 101
Len : 28
Options : E
seq# : 80000001
chksum : 0xb693
Net mask : 255.255.0.0
Tos 0 metric: 1
Area: 0.0.0.1
Link State Database
Type : Sum-Net
Ls id : 10.1.24.0
Adv rtr : 2.2.2.2
Ls age : 525
Len : 28
Options : E
seq# : 80000001
chksum : 0xa18f
Net mask : 255.255.255.0
Tos 0 metric: 1
[~ABR-ospf-1]
以上是关于玩转华为ENSP模拟器系列 | 配置OSPF ABR路由聚合示例的主要内容,如果未能解决你的问题,请参考以下文章
玩转华为ENSP模拟器系列 | 配置LDP与OSPF联动示例
玩转华为ENSP模拟器系列 | 配置BFD for OSPF特性示例
玩转华为ENSP模拟器系列 | 配置OSPF ABR路由聚合示例