1、掌握类型1、2、3、4 和5 的LSA 的作用。
2、掌握OSPF 末节(Stub)区域特点。
3、掌握OSPF Stub 区域配置方法。
4、掌握OSPF Stub 区域配置要求: Stub 区域没有ASBR,它至少拥有一个ABR。
2、掌握OSPF 末节(Stub)区域特点。
3、掌握OSPF Stub 区域配置方法。
4、掌握OSPF Stub 区域配置要求: Stub 区域没有ASBR,它至少拥有一个ABR。
TOP图:
配置完IP地址,测通,动态路由协议配好,用Ping命令和show ip route通认协议工作正常。
在R3上配置路由重分发:
R3(config)#router ospf 1
R3(config-router)#redistribute rip subnets metric 200
R3(config-router)#exit
R3(config)#router rip
R3(config-router)#redistribute ospf 1 metric 10
R3(config-router)#exit
查看R1情况:
R1#show ip route
Gateway of last resort is not set
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 5 subnets, 3 masks
C 172.16.255.0/30 is directly connected, Serial0/0
O IA 172.16.255.4/30 [110/128] via 172.16.255.2, 00:10:32, Serial0/0
O IA 172.16.255.8/30 [110/192] via 172.16.255.2, 00:10:32, Serial0/0
C 172.16.1.0/24 is directly connected, Loopback0
O IA 172.16.2.1/32 [110/193] via 172.16.255.2, 00:10:32, Serial0/0(IA类型是由LSA3通告的区域间路由)
O E2 10.0.0.0/8 [110/200] via 172.16.255.2, 00:01:07, Serial0/0
O E2 192.168.1.0/24 [110/200] via 172.16.255.2, 00:01:07, Serial0/0(E2类型是由LSA5通告的外部区域路由)
R1#ping 10.1.1.1
C 172.16.255.0/30 is directly connected, Serial0/0
O IA 172.16.255.4/30 [110/128] via 172.16.255.2, 00:10:32, Serial0/0
O IA 172.16.255.8/30 [110/192] via 172.16.255.2, 00:10:32, Serial0/0
C 172.16.1.0/24 is directly connected, Loopback0
O IA 172.16.2.1/32 [110/193] via 172.16.255.2, 00:10:32, Serial0/0(IA类型是由LSA3通告的区域间路由)
O E2 10.0.0.0/8 [110/200] via 172.16.255.2, 00:01:07, Serial0/0
O E2 192.168.1.0/24 [110/200] via 172.16.255.2, 00:01:07, Serial0/0(E2类型是由LSA5通告的外部区域路由)
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 = 40/70/92 ms
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 = 40/70/92 ms
查看R1链路状态数据库:
R1 路由学习到的本次实验拓扑中所有的路由,在实际网络应用中,R1 路由并不需要学习到整个网络路由。过多的路由条目会导致路由器变大,不利于路由查询,同时也不利于网络的收敛。OSPF 网络路由是通过LSA 来进行通告。可以限制LSA 的泛洪的范围,并辅以适当的汇总路由,从而有效的减少路由表的大小,便于网络的收敛,同时增强网络稳定性。
在R1和R2上配置Area1区域为stub(末节)区域:
R1(config)#router ospf 1
R1(config-router)#area 1 stub
R1(config-router)#exit
R1(config-router)#area 1 stub
R1(config-router)#exit
R2(config)#router ospf 1
R2(config-router)#area 1 stub
R2(config-router)#exit
R2(config-router)#area 1 stub
R2(config-router)#exit
查看R1上的情况:
通过查看R1的OSPF链路数据库,可以发现类型4和类型5的LSA已经被拒绝,从而限制了LSA的泛洪范围。
查看R1路由表:
R1#show 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
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.255.2 to network 0.0.0.0
172.16.0.0/16 is variably subnetted, 5 subnets, 3 masks
C 172.16.255.0/30 is directly connected, Serial0/0
O IA 172.16.255.4/30 [110/128] via 172.16.255.2, 00:00:55, Serial0/0
O IA 172.16.255.8/30 [110/192] via 172.16.255.2, 00:00:55, Serial0/0
C 172.16.1.0/24 is directly connected, Loopback0
O IA 172.16.2.1/32 [110/193] via 172.16.255.2, 00:00:55, Serial0/0
O*IA 0.0.0.0/0 [110/65] via 172.16.255.2, 00:00:55, Serial0/0
C 172.16.255.0/30 is directly connected, Serial0/0
O IA 172.16.255.4/30 [110/128] via 172.16.255.2, 00:00:55, Serial0/0
O IA 172.16.255.8/30 [110/192] via 172.16.255.2, 00:00:55, Serial0/0
C 172.16.1.0/24 is directly connected, Loopback0
O IA 172.16.2.1/32 [110/193] via 172.16.255.2, 00:00:55, Serial0/0
O*IA 0.0.0.0/0 [110/65] via 172.16.255.2, 00:00:55, Serial0/0
因为有R2发送的默认路由,所以R1不需要接收类型3的LSA,也不需要知道ASBR的位置。
确认路由有效性:
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 = 16/72/120 ms
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 = 16/72/120 ms
综上所述,配置了末节区域(stub Area)后,路由器拒绝了类型4和类型5的LSA。