分类: 系统运维
2009-06-27 15:51:40
实验目的:
1、掌握类型1、2、3、4和5的LSA的作用。
2、掌握OSPF末节(Stub)区域特点。
3、掌握OSPF Stub区域配置方法。
4、掌握OSPF Stub区域配置要求: Stub区域没有ASBR,它至少拥有一个ABR。
实验拓扑图:
实验步骤及要求:
1、配置各台路由器的IP地址,并且使用Ping命令确认各路由器的直连口的互通性。
2、配置OSPF与RIP的协议,并使用ping和show ip route命令进行确认协议正常工作。
3、为了完成实验需要在R3上配置重发布,配置如下:
R3(config)#router ospf 1 R3(config-router)#redistribute rip subnets metric 200 R3(config-router)#exit R3(config)# R3(config)#router rip R3(config-router)#redistribute ospf 1 metric 10 R3(config-router)#exit R3(config)#exit |
4、查看R1路由器的路由表:
R1#show ip route Gateway of last resort is not set 172.16.0.0/16 is variably subnetted, 5 subnets, 2 masks C 172.16.255.0/30 is directly connected, Serial1/1 O IA 172.16.255.4/30 [110/128] via 172.16.255.2, 00:07:32, Serial1/1 O IA 172.16.255.8/30 [110/192] via 172.16.255.2, 00:06:57, Serial1/1 C 172.16.1.0/24 is directly connected, Loopback0 O IA 172.16.2.0/24 [110/193] via 172.16.255.2, 00:06:05, Serial1/1 O E2 10.0.0.0/8 [110/200] via 172.16.255.2, 00:02:01, Serial1/1 O E2 192.168.1.0/24 [110/200] via 172.16.255.2, 00:02:01, Serial1/1 R1# R1#ping 10.1.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 672/788/984 ms R1# |
5、查看R1路由器的链路状态数据库。
R1#show ip ospf database OSPF Router with ID (172.16.1.1) (Process ID 1) Router Link States (Area 1) Link ID ADV Router Age Seq# Checksum Link count 172.16.1.1 172.16.1.1 682 0x80000003 0x003BE1 3 172.16.255.5 172.16.255.5 677 0x80000003 0x0035B1 2 Summary Net Link States (Area 1) Link ID ADV Router Age Seq# Checksum 172.16.2.0 172.16.255.5 581 0x80000001 0x004CEE 172.16.255.4 172.16.255.5 668 0x80000001 0x009BE1 172.16.255.8 172.16.255.5 633 0x80000001 0x00F543 Summary ASB Link States (Area 1) Link ID ADV Router Age Seq# Checksum 192.168.1.1 172.16.255.5 342 0x80000001 0x008648 Type-5 AS External Link States Link ID ADV Router Age Seq# Checksum Tag 10.0.0.0 192.168.1.1 348 0x80000001 0x005B1B 0 192.168.1.0 192.168.1.1 348 0x80000001 0x0021F4 0 R1# |
6、我们注意到R1路由学习到的本次实验拓扑中所有的路由,在实际网络应用中,R1路由并不需要学习到整个网络路由。过多的路由条目会导致路由器变大,不利用路由查询,同时也不利于网络的收敛。OSPF网络路由是通过LSA来进行通告。可以限制LSA的泛洪的范围,并辅以适当的汇总路由,从而有效的减少路由表的大小,便于网络的收敛,同时增强网络稳定性。
7、在R1和R2上配置area 1区域为stub区域。
R1(config)#router ospf 1 R1(config-router)#area 1 stub R1(config-router)#exit R1(config)#exit |
R2(config)#router ospf 1 R2(config-router)#area 1 stub R2(config-router)#exit R2(config)# |
8、再次查看R1的链路状态数据库。
R1#show ip ospf database OSPF Router with ID (172.16.1.1) (Process ID 1) Router Link States (Area 1) Link ID ADV Router Age Seq# Checksum Link count 172.16.1.1 172.16.1.1 155 0x80000005 0x0055C7 3 172.16.255.5 172.16.255.5 155 0x80000005 0x004F97 2 Summary Net Link States (Area 1) Link ID ADV Router Age Seq# Checksum 0.0.0.0 172.16.255.5 168 0x80000001 0x00017B 172.16.2.0 172.16.255.5 168 0x80000002 0x0068D3 172.16.255.4 172.16.255.5 168 0x80000002 0x00B7C6 172.16.255.8 172.16.255.5 168 0x80000002 0x001228 R1# |
通过查看R1的数据库,可以发现类型4和5的LSA被拒绝了,从而限制了LSA的泛洪范围。
9、查看R1的路由表,确认路由表变化。因为有R2发送的默认路由,因此R1也不需要接收类型3的LSA,即无需要知晓ASBR的位置。
R1#show ip route Gateway of last resort is 172.16.255.2 to network 0.0.0.0 172.16.0.0/16 is variably subnetted, 5 subnets, 2 masks C 172.16.255.0/30 is directly connected, Serial1/1 O IA 172.16.255.4/30 [110/128] via 172.16.255.2, 00:04:19, Serial1/1 O IA 172.16.255.8/30 [110/192] via 172.16.255.2, 00:04:19, Serial1/1 C 172.16.1.0/24 is directly connected, Loopback0 O IA 172.16.2.0/24 [110/193] via 172.16.255.2, 00:04:19, Serial1/1 O*IA 0.0.0.0/0 [110/65] via 172.16.255.2, 00:04:19, Serial1/1 R1# |
10、使用ping命令确认路由有效性。
R1#ping 10.1.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 240/393/684 ms R1# |
11、通过以上配置,需要掌握的是:末节区域(stub area)拒绝了类型4和类型5的LSA。
12、实验完成。