






Stub(区域内所有路由器都需要配置stub):
屏蔽LSA4、5且生成一条LSA 3的缺省路由,display ospf lsdb时不会看到LSA 4与LSA 5;但此时ABR还会将其他区域内的网段以LSA 3传递给本区域(即保留OSPF区域间路由)。
Totally Stub(只在ABR上配置:stub no-summray,该区域内其他路由器仍配置stub即可),此时去往区间路由也依靠默认路由。无论是stub还是Totally stub,其他区域都能收到来自Area 1的LSA 3,故其他路由器仍旧依靠OSPF向RTD传递路由。


RTA注入外部路由时,因为Area 1的Stub/Totally Stub区域性质,无法学习到外部路由(LSA 5被屏蔽);但因为Area 1存在默认路由,可通过D→B→A→外部网络;同时RTD与外部网络存在路由(且为最优路径),也因为Area 1的特殊区域性质而无法学习;即问题为:RTD无法通过最优路径抵达外部网络(次优路径问题);
那么现在可以将RTD、B都配置为nssa区域,nssa区域允许外部路由注入(那么RTD成为ASBR,可以学习到最优路径)同时也不允许存在LSA 5,此时引出LSA 7概念,LSA 7与LSA 5相似,在该案例中,LSA 7在ABR(RTB)中被转换为LSA 5;Area 2也因为LSA 5的性质生成LSA 4,因为RTB传递出LSA 5,故其他区域内的路由器认为RTB为ASBR
关于LSA 3缺省路由与LSA 7缺省路由
在RTB、D处配置nssa,会产生一条LSA 7缺省路由;若在RTB处配置nssa no-summray时(即Totally NSSA)时,又会额外产生一条LSA 3缺省路由。






要求:全网运行OSPF,使用汇聚、特殊区域等技术使各区域内LSA数量优化到最少,全网通。
做好基本接口配置,网段配置由左至右分别为24.0.0.0/24,12.0.0.0/24,16.0.0.0/24,13.0.0.0/24,35.0.0.0/24。R4、R6配置环回口,且R4将环回口网段宣告至OSPF Area24中。
注意:
Area 35未与Area 0连接,且按照优化需求,应在Area 24配置汇总,在Area 16配置Nssa区域,在Area 35配置Totally Stub区域。
R1:
- sysname R1
- #
- undo info-center enable
- #
- interface GigabitEthernet0/0/0
- ip address 12.0.0.1 255.255.255.0
- #
- interface GigabitEthernet0/0/1
- ip address 16.0.0.1 255.255.255.0
- #
- interface GigabitEthernet0/0/2
- ip address 13.0.0.1 255.255.255.0
- #
- ospf 1 router-id 1.1.1.1
- area 0.0.0.0
- network 12.0.0.0 0.0.0.255
- area 0.0.0.13
- network 13.0.0.0 0.0.0.255
- vlink-peer 3.3.3.3
- area 0.0.0.16
- network 16.0.0.0 0.0.0.255
- nssa
R2:
- sysname R2
- #
- undo info-center enable
- #
- interface GigabitEthernet0/0/0
- ip address 24.0.0.2 255.255.255.0
- #
- interface GigabitEthernet0/0/1
- ip address 12.0.0.2 255.255.255.0
- #
- ospf 1 router-id 2.2.2.2
- area 0.0.0.0
- network 12.0.0.0 0.0.0.255
- area 0.0.0.24
- abr-summary 172.16.0.0 255.255.252.0
- network 24.0.0.0 0.0.0.255
R4:
- sysname R4
- #
- undo info-center enable
- #
- interface GigabitEthernet0/0/0
- ip address 24.0.0.4 255.255.255.0
- #
- interface LoopBack0
- ip address 172.16.0.1 255.255.255.0
- #
- interface LoopBack1
- ip address 172.16.1.1 255.255.255.0
- #
- interface LoopBack2
- ip address 172.16.2.1 255.255.255.0
- #
- interface LoopBack3
- ip address 172.16.3.1 255.255.255.0
- #
- ospf 1 router-id 4.4.4.4
- area 0.0.0.24
- network 24.0.0.0 0.0.0.255
- network 172.16.0.0 0.0.0.255
- network 172.16.1.0 0.0.0.255
- network 172.16.2.0 0.0.0.255
- network 172.16.3.0 0.0.0.255
R6:
- sysname R6
- #
- undo info-center enable
- #
- interface GigabitEthernet0/0/0
- ip address 16.0.0.6 255.255.255.0
- #
- interface LoopBack0
- ip address 172.16.4.1 255.255.255.0
- #
- interface LoopBack1
- ip address 172.16.5.1 255.255.255.0
- #
- interface LoopBack2
- ip address 172.16.6.1 255.255.255.0
- #
- interface LoopBack3
- ip address 172.16.7.1 255.255.255.0
- #
- ospf 1 router-id 6.6.6.6
- import-route direct
- area 0.0.0.16
- network 16.0.0.0 0.0.0.255
- nssa
R3:
- sysname R3
- #
- undo info-center enable
- #
- interface GigabitEthernet0/0/0
- ip address 13.0.0.3 255.255.255.0
- #
- interface GigabitEthernet0/0/1
- ip address 35.0.0.3 255.255.255.0
- #
- ospf 1 router-id 3.3.3.3
- area 0.0.0.13
- network 13.0.0.0 0.0.0.255
- vlink-peer 1.1.1.1
- area 0.0.0.35
- network 35.0.0.0 0.0.0.255
- stub no-summary
R5:
- sysname R5
- #
- undo info-center enable
- #
- interface GigabitEthernet0/0/0
- ip address 35.0.0.5 255.255.255.0
- #
- interface LoopBack0
- ip address 5.5.5.5 255.255.255.0
- #
- ospf 1 router-id 5.5.5.5
- area 0.0.0.35
- network 5.5.5.0 0.0.0.255
- network 35.0.0.0 0.0.0.255
- stub