末节区域要求:

1 末节区域不能是area 0

2 末节区域里不能有ASBR,因为ASBR要注入外部路由

3 末节区域里不能做virtual-link(虚链路)的传递区域



末节区域的特点:

1 不接受ospf之外的路由信息

2 在ABR上会生成默认路由来代替ospf外部路由

3 如果加no-summary参数的时候末节区域就变成完全末节区域了,在完全末节区域里不接受任何路由条目,并自动生成一条默认路由。



4 有一种特殊的情况是:该区域哟1个以上的ABR,但还是把该区域设置成末节区域,问题出现了,因为每个ABR都会产生默认路由并注入到区域内,默认情况下这样区域内的路由器在去往外部网络时可能会选择到非最优的ABR作为出口,这种情况,我们只能根据实际网络拓扑来手动改变默认路由的metric来控制。(本次试验不包含这种情况)




实验:拓扑图

ospf 末梢区域和完全末梢区域 ospf末节区域配置_网络

具体的配置不再贴出,只贴出重要的:

 

R1的路由配置:
!
router ospf 1
log-adjacency-changes
redistribute rip subnets 
network 192.168.2.0 0.0.0.3 area 0
network 192.168.1.0 0.0.0.3 area 1
!
router rip
version 2
network 192.168.4.0
default-information originate
no auto-summary
!
 
R2的路由配置:
!
router ospf 1
log-adjacency-changes
network 192.168.3.0 0.0.0.3 area 2
network 192.168.2.0 0.0.0.3 area 0
!
 
R3的路由配置:
!
router ospf 1
log-adjacency-changes
network 192.168.3.0 0.0.0.3 area 2
!
 
R4的路由配置:
!
router rip
version 2
network 192.168.4.0
no auto-summary
!

 

配置完成后用R3去pingR4 能通,说明全网互通

ospf 末梢区域和完全末梢区域 ospf末节区域配置_ospf 末梢区域和完全末梢区域_02

 

 

 

 

 

1,末节区域(area 1):

R2上配置
R2(config-router)#area 1 stub 
 
R3上配置:
R3(config-router)#area 1 stub 
 
配置完成后查看R3的路由条目:
R3#show ip route 
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
 
Gateway of last resort is 192.168.3.2 to network 0.0.0.0
 
192.168.2.0/30 is subnetted, 1 subnets
O IA192.168.2.0 [110/845] via 192.168.3.2, 00:00:04, Serial1/2
192.168.3.0/30 is subnetted, 1 subnets
C192.168.3.0 is directly connected, Serial1/2
O*IA 0.0.0.0/0 [110/782] via 192.168.3.2, 00:00:04, Serial1/2
(说明学习到的ospf之外所有的路由也就是类型5的路由汇总成一条默认路由)
 
 
 
2,完全末节区域(area 1):
R2上配置:
R2(config-router)#area 1 stub no-summary 
 
R3上配置:
R3(config-router)#area 1 stub no-summary 
 
配置完成后查看R3的路由条目:
R3#show ip route 
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
 
Gateway of last resort is 192.168.3.2 to network 0.0.0.0
 
192.168.3.0/30 is subnetted, 1 subnets
C192.168.3.0 is directly connected, Serial1/2
O*IA 0.0.0.0/0 [110/782] via 192.168.3.2, 00:05:08, Serial1/2
(说明所有学到的路由全汇总成一条默认路由)

 

 https://blog.51cto.com/tianhaoblog/1259370