玩转华为ENSP模拟器系列 | 配置OSPF的Stub区域示例
Posted COCOgsta
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了玩转华为ENSP模拟器系列 | 配置OSPF的Stub区域示例相关的知识,希望对你有一定的参考价值。
素材来源:华为路由器配置指南
一边学习一边整理试验笔记,并与大家分享,侵权即删,谢谢支持!
附上汇总贴:玩转华为ENSP模拟器系列 | 合集_COCOgsta的博客-CSDN博客_ensp实验大全
目标
介绍了将引入了静态路由的普通区域配置成Stub区域的过程,可以在不影响路由可达性的前提下减少通告到此区域内的LSA数量。
组网需求
如图1所示,所有的路由器都运行OSPF,整个自治系统划分为3个区域。其中DeviceA和DeviceB作为ABR来发布区域之间的路由,DeviceD作为ASBR引入了外部路由(静态路由)。
要求将Area1配置为Stub区域,减少通告到此区域内的LSA数量,但不影响路由的可达性。
配置思路
- 在各路由器上配置OSPF基本功能,实现互连。
- 在DeviceD上配置静态路由,并在OSPF中引入。
- 配置Area1为Stub区域(需要在Area1内所有的路由器上配置stub命令),在DeviceC上查看OSPF路由信息。
- 在DeviceA上配置禁止向Stub区域通告Type3 LSA,在DeviceC上查看OSPF路由信息。
操作步骤
- 配置接口的IP地址(略)
- 配置OSPF基本功能
- 配置DeviceD引入静态路由
DeviceD:
ip route-static 10.0.0.0 255.0.0.0 NULL0
ospf 1
import-route static type 1
查看DeviceC的ABR和ASBR信息。
[~DeviceC]display ospf abr-asbr
OSPF Process 1 with Router ID 3.3.3.3
Routing Table to ABR and ASBR
Type Destination Area Cost Nexthop RtType
INTRA-AREA 1.1.1.1 0.0.0.1 1 192.168.1.1 ABR
INTER-AREA 4.4.4.4 0.0.0.1 3 192.168.1.1 ASBR
[~DeviceC]
查看DeviceC的OSPF路由表。
[~DeviceC] display ospf routing
OSPF Process 1 with Router ID 3.3.3.3
Routing Tables
Routing for Network
Destination Cost Type NextHop AdvRouter Area
172.16.1.0/24 1 Direct 172.16.1.1 3.3.3.3 0.0.0.1
172.17.1.0/24 4 Inter-area 192.168.1.1 1.1.1.1 0.0.0.1
192.168.0.0/24 2 Inter-area 192.168.1.1 1.1.1.1 0.0.0.1
192.168.1.0/24 1 Direct 192.168.1.2 3.3.3.3 0.0.0.1
192.168.2.0/24 3 Inter-area 192.168.1.1 1.1.1.1 0.0.0.1
Routing for ASEs
Destination Cost Type Tag NextHop AdvRouter
10.0.0.0/8 4 Type1 1 192.168.1.1 4.4.4.4
Total Nets: 6
Intra Area: 2 Inter Area: 3 ASE: 1 NSSA: 0
OSPF Process 65534 with Router ID 128.1.138.137
Routing Tables
Routing for Network
Destination Cost Type NextHop AdvRouter Area
128.1.138.137/32 0 Direct 128.1.138.137 128.1.138.137 0.0.0.0
128.1.138.138/32 100 Stub 128.1.138.138 128.1.138.138 0.0.0.0
128.1.138.138/32 100 Stub 128.1.138.138 128.1.138.138 0.0.0.0
128.1.138.139/32 100 Stub 128.1.138.139 128.1.138.139 0.0.0.0
128.1.138.139/32 100 Stub 128.1.138.139 128.1.138.139 0.0.0.0
128.1.138.140/32 200 Stub 128.1.138.138 128.1.138.140 0.0.0.0
128.1.138.140/32 200 Stub 128.1.138.138 128.1.138.140 0.0.0.0
128.1.138.141/32 300 Stub 128.1.138.138 128.1.138.141 0.0.0.0
128.1.138.141/32 300 Stub 128.1.138.138 128.1.138.141 0.0.0.0
128.1.138.142/32 400 Stub 128.1.138.138 128.1.138.142 0.0.0.0
128.1.138.142/32 400 Stub 128.1.138.138 128.1.138.142 0.0.0.0
Total Nets: 6
Intra Area: 6 Inter Area: 0 ASE: 0 NSSA: 0
[~DeviceC]
说明:当DeviceC所在区域为普通区域时,可以看到路由表中存在AS外部的路由。
- 配置Area1为Stub区域
配置DeviceA。
DeviceA:
ospf 1
area 0.0.0.1
stub
配置DeviceC。
DeviceC:
ospf 1
area 0.0.0.1
stub
配置DeviceE。
DeviceE:
ospf 1
area 0.0.0.1
stub
显示DeviceC的路由表。
[~DeviceC]display ospf routing
OSPF Process 1 with Router ID 3.3.3.3
Routing Tables
Routing for Network
Destination Cost Type NextHop AdvRouter Area
0.0.0.0/0 2 Inter-area 192.168.1.1 1.1.1.1 0.0.0.1
172.16.1.0/24 1 Direct 172.16.1.1 3.3.3.3 0.0.0.1
172.17.1.0/24 4 Inter-area 192.168.1.1 1.1.1.1 0.0.0.1
192.168.0.0/24 2 Inter-area 192.168.1.1 1.1.1.1 0.0.0.1
192.168.1.0/24 1 Direct 192.168.1.2 3.3.3.3 0.0.0.1
192.168.2.0/24 3 Inter-area 192.168.1.1 1.1.1.1 0.0.0.1
Total Nets: 6
Intra Area: 2 Inter Area: 4 ASE: 0 NSSA: 0
OSPF Process 65534 with Router ID 128.1.138.137
Routing Tables
Routing for Network
Destination Cost Type NextHop AdvRouter Area
128.1.138.137/32 0 Direct 128.1.138.137 128.1.138.137 0.0.0.0
128.1.138.138/32 100 Stub 128.1.138.138 128.1.138.138 0.0.0.0
128.1.138.138/32 100 Stub 128.1.138.138 128.1.138.138 0.0.0.0
128.1.138.139/32 100 Stub 128.1.138.139 128.1.138.139 0.0.0.0
128.1.138.139/32 100 Stub 128.1.138.139 128.1.138.139 0.0.0.0
128.1.138.140/32 200 Stub 128.1.138.138 128.1.138.140 0.0.0.0
128.1.138.140/32 200 Stub 128.1.138.138 128.1.138.140 0.0.0.0
128.1.138.141/32 300 Stub 128.1.138.138 128.1.138.141 0.0.0.0
128.1.138.141/32 300 Stub 128.1.138.138 128.1.138.141 0.0.0.0
128.1.138.142/32 400 Stub 128.1.138.138 128.1.138.142 0.0.0.0
128.1.138.142/32 400 Stub 128.1.138.138 128.1.138.142 0.0.0.0
Total Nets: 6
Intra Area: 6 Inter Area: 0 ASE: 0 NSSA: 0
[~DeviceC]
说明:当把DeviceC所在区域配置为Stub区域时,已经看不到AS外部的路由,取而代之的是一条缺省路由。
- 配置禁止向Stub区域通告Type3 LSA
DeviceA:
ospf 1
area 0.0.0.1
stub no-summary
- 验证配置结果
查看DeviceC的OSPF路由表。
[~DeviceC]display ospf routing
OSPF Process 1 with Router ID 3.3.3.3
Routing Tables
Routing for Network
Destination Cost Type NextHop AdvRouter Area
0.0.0.0/0 2 Inter-area 192.168.1.1 1.1.1.1 0.0.0.1
172.16.1.0/24 1 Direct 172.16.1.1 3.3.3.3 0.0.0.1
192.168.1.0/24 1 Direct 192.168.1.2 3.3.3.3 0.0.0.1
Total Nets: 3
Intra Area: 2 Inter Area: 1 ASE: 0 NSSA: 0
OSPF Process 65534 with Router ID 128.1.138.137
Routing Tables
Routing for Network
Destination Cost Type NextHop AdvRouter Area
128.1.138.137/32 0 Direct 128.1.138.137 128.1.138.137 0.0.0.0
128.1.138.138/32 100 Stub 128.1.138.138 128.1.138.138 0.0.0.0
128.1.138.138/32 100 Stub 128.1.138.138 128.1.138.138 0.0.0.0
128.1.138.139/32 100 Stub 128.1.138.139 128.1.138.139 0.0.0.0
128.1.138.139/32 100 Stub 128.1.138.139 128.1.138.139 0.0.0.0
128.1.138.140/32 200 Stub 128.1.138.138 128.1.138.140 0.0.0.0
128.1.138.140/32 200 Stub 128.1.138.138 128.1.138.140 0.0.0.0
128.1.138.141/32 300 Stub 128.1.138.138 128.1.138.141 0.0.0.0
128.1.138.141/32 300 Stub 128.1.138.138 128.1.138.141 0.0.0.0
128.1.138.142/32 400 Stub 128.1.138.138 128.1.138.142 0.0.0.0
128.1.138.142/32 400 Stub 128.1.138.138 128.1.138.142 0.0.0.0
Total Nets: 6
Intra Area: 6 Inter Area: 0 ASE: 0 NSSA: 0
[~DeviceC]
说明:禁止向Stub区域通告Summary LSA后,Stub路由器的路由表项进一步减少,只保留了一条通往区域外部的缺省路由。
以上是关于玩转华为ENSP模拟器系列 | 配置OSPF的Stub区域示例的主要内容,如果未能解决你的问题,请参考以下文章
玩转华为ENSP模拟器系列 | 配置LDP与OSPF联动示例
玩转华为ENSP模拟器系列 | 配置BFD for OSPF特性示例
玩转华为ENSP模拟器系列 | 配置OSPF ABR路由聚合示例