一、实验目的:
1、掌握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, 11 subnets, 2 masks
C 172.16.252.0/24 is directly connected, Loopback3
C 172.16.248.0/24 is directly connected, Loopback2
C 172.16.244.0/24 is directly connected, Loopback1
C 172.16.240.0/24 is directly connected, Loopback0
C 172.16.224.0/24 is directly connected, Serial1/1
O IA 172.16.1.0/24 [110/128] via 172.16.224.1, 00:03:14, Serial1/1
O IA 172.16.3.1/32 [110/65] via 172.16.224.1, 00:03:14, Serial1/1
O IA 172.16.112.1/32 [110/129] via 172.16.224.1, 00:03:14, Serial1/1
O IA 172.16.96.1/32 [110/129] via 172.16.224.1, 00:03:14, Serial1/1
O IA 172.16.80.1/32 [110/129] via 172.16.224.1, 00:03:14, Serial1/1
O IA 172.16.64.1/32 [110/129] via 172.16.224.1, 00:03:14, Serial1/1
在R3将直连网络重分布到OSPF中,配置如下
R3(config)#router ospf 1
R3(config-router)#redistribute connected subnets
查看R1的路由表,将R3的物理直连网络学习到了如下:
R1#sh ip route
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 7 subnets, 2 masks
O IA 172.16.224.0/24 [110/128] via 172.16.1.2, 00:02:43, Serial1/1
C 172.16.1.0/24 is directly connected, Serial1/1
O 172.16.3.1/32 [110/65] via 172.16.1.2, 00:02:43, Serial1/1
C 172.16.112.0/24 is directly connected, Loopback3
C 172.16.96.0/24 is directly connected, Loopback2
C 172.16.80.0/24 is directly connected, Loopback1
C 172.16.64.0/24 is directly connected, Loopback0
10.0.0.0/24 is subnetted, 1 subnets
C 10.0.0.0 is directly connected, Loopback5
查看R3的路由表
R3#sh ip route
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 11 subnets, 2 masks
C 172.16.252.0/24 is directly connected, Loopback3
C 172.16.248.0/24 is directly connected, Loopback2
C 172.16.244.0/24 is directly connected, Loopback1
C 172.16.240.0/24 is directly connected, Loopback0
C 172.16.224.0/24 is directly connected, Serial1/1
O IA 172.16.1.0/24 [110/128] via 172.16.224.1, 00:00:41, Serial1/1
O IA 172.16.3.1/32 [110/65] via 172.16.224.1, 00:00:41, Serial1/1
O IA 172.16.112.1/32 [110/129] via 172.16.224.1, 00:00:41, Serial1/1
O IA 172.16.96.1/32 [110/129] via 172.16.224.1, 00:00:41, Serial1/1
O IA 172.16.80.1/32 [110/129] via 172.16.224.1, 00:00:41, Serial1/1
O IA 172.16.64.1/32 [110/129] via 172.16.224.1, 00:00:41, Serial1/1
已经将R3的物理直连网络加入到了area 51中去。
2、在R3使用show ip ospf database查看LSA链路状态信息,
R3#sh ip ospf database
OSPF Router with ID (172.16.252.1) (Process ID 1)
Router Link States (Area 51)
Link ID ADV Router Age Seq# Checksum Link count
172.16.3.1 172.16.3.1 358 0x80000002 0x003BEE 2
172.16.252.1 172.16.252.1 115 0x80000002 0x00EE3F 2
Summary Net Link States (Area 51)
Link ID ADV Router Age Seq# Checksum
172.16.1.0 172.16.3.1 385 0x80000001 0x00CDB0
172.16.3.1 172.16.3.1 385 0x80000001 0x003585
172.16.64.1 172.16.3.1 385 0x80000001 0x001627
172.16.80.1 172.16.3.1 385 0x80000001 0x0065C7
172.16.96.1 172.16.3.1 385 0x80000001 0x00B468
172.16.112.1 172.16.3.1 385 0x80000001 0x000409
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
172.16.240.0 172.16.252.1 115 0x80000001 0x0084B3 0
172.16.244.0 172.16.252.1 115 0x80000001 0x0058DB 0
172.16.248.0 172.16.252.1 115 0x80000001 0x002C04 0
172.16.252.0 172.16.252.1 115 0x80000001 0x00FF2C 0
可以看到出现Type-5链路状态信息,现在将area 51配置成非绝对末节区域。
R2(config)#router ospf 1
R2(config-router)#area 51 nssa
R2(config-router)#
R3(config)#router ospf 1
R3(config-router)#area 51 nssa
R3(config-router)#
*Nov 18 00:02:52.959: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.3.1 on Serial1/1 from FULL to DOWN, Neighbor Down: Adjacency forced to reset
*Nov 18 00:03:12.595: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.3.1 on Serial1/1 from LOADING to FULL, Loading Done
再次在R3使用show ip ospf database查看LSA链路状态信息
R3#sh ip ospf data
OSPF Router with ID (172.16.252.1) (Process ID 1)
Router Link States (Area 51)
Link ID ADV Router Age Seq# Checksum Link count
172.16.3.1 172.16.3.1 12 0x80000004 0x00E23D 2
172.16.252.1 172.16.252.1 16 0x80000004 0x009095 2
Summary Net Link States (Area 51)
Link ID ADV Router Age Seq# Checksum
172.16.1.0 172.16.3.1 18 0x80000002 0x007106
172.16.3.1 172.16.3.1 18 0x80000002 0x00D8DA
172.16.64.1 172.16.3.1 18 0x80000002 0x00B97C
172.16.80.1 172.16.3.1 18 0x80000002 0x00091D
172.16.96.1 172.16.3.1 18 0x80000002 0x0058BD
172.16.112.1 172.16.3.1 18 0x80000002 0x00A75E
Type-7 AS External Link States (Area 51)
Link ID ADV Router Age Seq# Checksum Tag
172.16.240.0 172.16.252.1 35 0x80000001 0x00A3EA 0
172.16.244.0 172.16.252.1 35 0x80000001 0x007713 0
172.16.248.0 172.16.252.1 36 0x80000001 0x004B3B 0
172.16.252.0 172.16.252.1 36 0x80000001 0x001F63 0
R3#
可以看到在R3的拓扑数据库里还有汇总的链路LSA,但Type-5链路状态信息已经没有了,转变成了Type-7的链路状态信息,也就是说还可以让type3,type4的LAS扩散到非绝对末节区域中。配置R2来禁止汇总链路LSA扩散到非绝对末节区域中, 配置如下:
R2(config)#router ospf 1
R2(config-router)#area 51 nssa no-summary
配置完后查看R的路由表,内部区域路由被一条默认路由所代替:
R3#sh ip route
Gateway of last resort is 172.16.224.1 to network 0.0.0.0
172.16.0.0/24 is subnetted, 5 subnets
C 172.16.252.0 is directly connected, Loopback3
C 172.16.248.0 is directly connected, Loopback2
C 172.16.244.0 is directly connected, Loopback1
C 172.16.240.0 is directly connected, Loopback0
C 172.16.224.0 is directly connected, Serial1/1
O*IA 0.0.0.0/0 [110/65] via 172.16.224.1, 00:00:22, Serial1/1
在R2上使用show ip ospf database查看拓扑数据库的信息,发现有TYPE5和TYPE7的链路状态LSA.
R2#sh ip ospf database
OSPF Router with ID (172.16.3.1) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
172.16.3.1 172.16.3.1 192 0x80000004 0x009C03 3
172.16.112.1 172.16.112.1 721 0x80000003 0x000206 2
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
172.16.64.1 172.16.112.1 823 0x80000001 0x00957A
172.16.80.1 172.16.112.1 788 0x80000001 0x00E41B
172.16.96.1 172.16.112.1 778 0x80000001 0x0034BB
172.16.112.1 172.16.112.1 758 0x80000001 0x00835C
172.16.224.0 172.16.3.1 667 0x80000001 0x002F6F
Router Link States (Area 51)
Link ID ADV Router Age Seq# Checksum Link count
172.16.3.1 172.16.3.1 187 0x80000004 0x00E23D 2
172.16.252.1 172.16.252.1 192 0x80000004 0x009095 2
Summary Net Link States (Area 51)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 172.16.3.1 58 0x80000001 0x008BE9
Type-7 AS External Link States (Area 51)
Link ID ADV Router Age Seq# Checksum Tag
172.16.240.0 172.16.252.1 212 0x80000001 0x00A3EA 0
172.16.244.0 172.16.252.1 212 0x80000001 0x007713 0
172.16.248.0 172.16.252.1 212 0x80000001 0x004B3B 0
172.16.252.0 172.16.252.1 212 0x80000001 0x001F63 0
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
172.16.240.0 172.16.3.1 172 0x80000001 0x000E84 0
172.16.244.0 172.16.3.1 172 0x80000001 0x00E1AC 0
172.16.248.0 172.16.3.1 172 0x80000001 0x00B5D4 0
172.16.252.0 172.16.3.1 172 0x80000001 0x0089FC 0
使用show ip route 查看R2的路由表:
R2#sh ip route
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 11 subnets, 2 masks
O N2 172.16.252.0/24 [110/20] via 172.16.224.2, 00:01:44, Serial1/2
O N2 172.16.248.0/24 [110/20] via 172.16.224.2, 00:01:44, Serial1/2
O N2 172.16.244.0/24 [110/20] via 172.16.224.2, 00:01:44, Serial1/2
O N2 172.16.240.0/24 [110/20] via 172.16.224.2, 00:01:44, Serial1/2
C 172.16.224.0/24 is directly connected, Serial1/2
C 172.16.1.0/24 is directly connected, Serial1/0
C 172.16.3.0/24 is directly connected, Loopback0
O IA 172.16.112.1/32 [110/65] via 172.16.1.1, 00:01:44, Serial1/0
O IA 172.16.96.1/32 [110/65] via 172.16.1.1, 00:01:44, Serial1/0
O IA 172.16.80.1/32 [110/65] via 172.16.1.1, 00:01:44, Serial1/0
O IA 172.16.64.1/32 [110/65] via 172.16.1.1, 00:01:44, Serial1/0
同样,使用show ip route 查看R1的路由表
R1# sh ip route
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 11 subnets, 2 masks
O E2 172.16.252.0/24 [110/20] via 172.16.1.2, 00:03:53, Serial1/1
O E2 172.16.248.0/24 [110/20] via 172.16.1.2, 00:03:53, Serial1/1
O E2 172.16.244.0/24 [110/20] via 172.16.1.2, 00:03:53, Serial1/1
O E2 172.16.240.0/24 [110/20] via 172.16.1.2, 00:03:53, Serial1/1
O IA 172.16.224.0/24 [110/128] via 172.16.1.2, 00:04:09, Serial1/1
C 172.16.1.0/24 is directly connected, Serial1/1
O 172.16.3.1/32 [110/65] via 172.16.1.2, 00:04:09, Serial1/1
C 172.16.112.0/24 is directly connected, Loopback3
C 172.16.96.0/24 is directly connected, Loopback2
C 172.16.80.0/24 is directly connected, Loopback1
C 172.16.64.0/24 is directly connected, Loopback0
10.0.0.0/24 is subnetted, 1 subnets
可以看到R2将N2(TYPE7)的LSA,转换成E2(TYPE5)的LSA扩散到区域1里面。