一、 实验目的:
1、 掌握配置OSPF末节区域,绝对末节区域
二、实验拓扑
三、实验步骤
(一)配置OSPF末节区域
1、 按照拓扑图配置好各个路由器的接口IP、OSPF协议。配置好后在R3上用命令show ip route查看路由表。
R3#sh ip route
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 9 subnets, 2 masks
C 172.16.224.0/24 is directly connected, Serial1/1
C 172.16.220.0/24 is directly connected, Loopback0
C 172.16.216.0/24 is directly connected, Loopback1
O IA 172.16.1.0/24 [110/128] via 172.16.224.1, 00:01:17, Serial1/1
O IA 172.16.3.1/32 [110/65] via 172.16.224.1, 00:01:17, Serial1/1
O IA 172.16.112.1/32 [110/129] via 172.16.224.1, 00:01:17, Serial1/1
O IA 172.16.96.1/32 [110/129] via 172.16.224.1, 00:01:17, Serial1/1
O IA 172.16.80.1/32 [110/129] via 172.16.224.1, 00:01:17, Serial1/1
O IA 172.16.64.1/32 [110/129] via 172.16.224.1, 00:01:17, Serial1/1
2、在R3上配置一条静态路由连到ISP,然后重分布到OSPF中,配置如下
R1(config)#router ospf 1
R1(config-router)#redistribute static subnets
R1(config-router)#exit
在R3上使用show ip route命令查看路由表
R3#sh ip route
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, 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 not set
172.16.0.0/16 is variably subnetted, 9 subnets, 2 masks
C 172.16.224.0/24 is directly connected, Serial1/1
C 172.16.220.0/24 is directly connected, Loopback0
C 172.16.216.0/24 is directly connected, Loopback1
O IA 172.16.1.0/24 [110/128] via 172.16.224.1, 00:07:13, Serial1/1
O IA 172.16.3.1/32 [110/65] via 172.16.224.1, 00:07:13, Serial1/1
O IA 172.16.112.1/32 [110/129] via 172.16.224.1, 00:07:13, Serial1/1
O IA 172.16.96.1/32 [110/129] via 172.16.224.1, 00:07:13, Serial1/1
O IA 172.16.80.1/32 [110/129] via 172.16.224.1, 00:07:13, Serial1/1
O IA 172.16.64.1/32 [110/129] via 172.16.224.1, 00:07:13, Serial1/1
O E2 10.0.0.0/8 [110/20] via 172.16.224.1, 00:00:04, Serial1/1
3、R3是一个内部区域路由器,在一个末节区域内,并不需要学习到外部AS的路由信息或者其他区域的汇总路由,只需要一个指向ABR(SanJose3)的默认路由就可以了。将area51配置成一个末节区域,配置如下:(注意在区域51所在的路由器上都要配置,否则无法形成邻接关系)
R3(config)#router ospf 1
R3(config-router)#area 51 stub
R2(config)#router ospf 1
R2(config-router)#area 51 stub
配置完后,使用show ip ospf查看,可以看到area51成为一个stub area。
R3#sh ip ospf
Routing Process "ospf 1" with ID 172.16.220.1
Supports only single TOS(TOS0) routes
Supports opaque LSA
Supports Link-local Signaling (LLS)
Initial SPF schedule delay 5000 msecs
Minimum hold time between two consecutive SPFs 10000 msecs
Maximum wait time between two consecutive SPFs 10000 msecs
Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs
LSA group pacing timer 240 secs
Interface flood pacing timer 33 msecs
Retransmission pacing timer 66 msecs
Number of external LSA 0. Checksum Sum 0x000000
Number of opaque AS LSA 0. Checksum Sum 0x000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 1. 0 normal 1 stub 0 nssa
External flood list length 0
Area 51
Number of interfaces in this area is 1
It is a stub area
Area has no authentication
SPF algorithm last executed 00:01:57.364 ago
SPF algorithm executed 6 times
Area ranges are
Number of LSA 9. Checksum Sum 0x035FAA
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
使用show ip route查看R3的路由表,出现了一条默认路由。
R3#sh ip route
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, 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 172.16.224.1 to network 0.0.0.0
172.16.0.0/16 is variably subnetted, 9 subnets, 2 masks
C 172.16.224.0/24 is directly connected, Serial1/1
C 172.16.220.0/24 is directly connected, Loopback0
C 172.16.216.0/24 is directly connected, Loopback1
O IA 172.16.1.0/24 [110/128] via 172.16.224.1, 00:02:24, Serial1/1
O IA 172.16.3.1/32 [110/65] via 172.16.224.1, 00:02:24, Serial1/1
O IA 172.16.112.1/32 [110/129] via 172.16.224.1, 00:02:24, Serial1/1
O IA 172.16.96.1/32 [110/129] via 172.16.224.1, 00:02:24, Serial1/1
O IA 172.16.80.1/32 [110/129] via 172.16.224.1, 00:02:24, Serial1/1
O IA 172.16.64.1/32 [110/129] via 172.16.224.1, 00:02:24, Serial1/1
O*IA 0.0.0.0/0 [110/65] via 172.16.224.1, 00:02:24, Serial1/1
末节区域对所有外部AS的路由,类型5的LAS都会被禁止扩散到末节区域内部,而用一条默认路由代替所有外部AS的路由,达到减小路由表条目的目的。
(二)配置绝对末节网络(CISCO私有特性)
如果配置了绝对末节网络,将会禁止type3,type4类型的LAS在绝对末节区域扩散。配置如下:(只需要在绝对末节区域里的ABR上配置,绝对末节区域内部的路由器只要配置成末节区域就可以了。)
R2(config)#router ospf 1
R2(config-router)#no area 51 stub
R2(config-router)#area 51 stub no-summary
R2(config-router)#exit
使用 show ip route查看R3上的路由表,内部区域的路由也没有了,用一条默认路由代替,将路由表进一步减小。
R3#sh ip route
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, 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 172.16.224.1 to network 0.0.0.0
172.16.0.0/24 is subnetted, 3 subnets
C 172.16.224.0 is directly connected, Serial1/1
C 172.16.220.0 is directly connected, Loopback0
C 172.16.216.0 is directly connected, Loopback1
O*IA 0.0.0.0/0 [110/65] via 172.16.224.1, 00:00:04, Serial1/1