一、介绍
标准区域:默认的区域类型,接收链路更新路由汇总外部路由
末节区域:将某区域设为Stub可缩小区域的LSDB,降低内存消耗。阻止LSA4/5进入Stub区域。
成为末节区域的标准:1.必须将Stub区域的所有路由器都配成Stub。 2.Stub区域不能用作虚链路的中转区域。 3.Stub中不能出现ASBR。 4.Area 0不能配成Stub。
完全末节区域(CISCO私有):更加缩小区域的LSDB,在Stub基础上,阻止LSA3。(阻止LSA3/4/5 ),也会由ABR发出一条LSA3默认路由给Stub的其他路由器。
NSSA:只有NSSA区域中才会现LSA7,可以存在ASBR,阻止LSA4/5,ABR将LSA7转成LSA5,传播到其他区域,这时,ABR也成为了ASBR,因为它也引入了LSA5,其它路由器看到LSA5的通告路由器是ABR。
二、在这节我会演示末节与完全末节两个实例
实验一:配置OSPF末节区域,在R1上运行RIP与OSPF两种路由协议,R1到R2属区域0,R2到R3属区域1,IP地址信息如图所示:
步骤一:配置3台路由器,并且发布网段.
R1:
Router>
Router>en
Router#conf t
Router(config)#hostname R1
R1(config-line)#exit
R1(config)#interface f0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#exit
R1(config)#interface loopback 0
R1(config-if)#ip address 1.1.1.1 255.255.255.0
R1(config-if)#int lo1
R1(config-if)#ip address 1.1.2.1 255.255.255.0
R1(config-if)#exit
R1(config)#router ospf 1 //启用OSPF路由协议
R1(config-router)#network 192.168.1.1 0.0.0.0 area 0
R1(config-router)#exit
R1(config)#router rip //启用RIP路由协议
R1(config-router)#version 2 //指定版本2
R1(config-router)#no auto-summary //不要自动汇总
R1(config-router)#network 1.1.1.0 //发布网段
R1(config-router)#network 1.1.2.0
R1(config-router)#end
R1#
R2:
Router>
Router>en
Router#conf t
Router(config)#hostname R2
R2(config)#interface f0/0
R2(config-if)#ip address 192.168.1.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#exit
R2(config)#interface f0/1
R2(config-if)#ip address 192.168.2.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#exit
R2(config)#interface loopback 0
R2(config-if)#ip address 2.2.1.1 255.255.255.0
R2(config-if)#int lo1
R2(config-if)#ip address 2.2.2.1 255.255.255.0
R2(config-if)#exit
R2(config)#router ospf 1 //同上
R2(config-router)#network 192.168.1.2 0.0.0.0 area 0
R2(config-router)#network 192.168.2.2 0.0.0.0 area 1
R2(config-router)#network 2.2.1.1 0.0.0.0 area 0
R2(config-router)#network 2.2.2.1 0.0.0.0 area 0
R2(config-router)#end
R2#
R3:
Router>
Router>en
Router#conf t
Router(config)#hostname R3
R3(config-line)#exit
R3(config)#interface f0/1
R3(config-if)#ip address 192.168.2.1 255.255.255.0
R3(config-if)#no sh
R3(config-if)#exit
R3(config)#router ospf 1 //同上
R3(config-router)#network 192.168.2.1 0.0.0.0 area 1
R3(config-router)#end
R3#
步骤二:在R1上把RIP与OSPF互相重发布,并在R3查看路由表
R1(config)#router ospf 1
R1(config-router)#redistribute rip
R1(config-router)#redistribute rip subnets //把RIP中路由发布进OPSF
R1(config-router)#exit
R1(config)#router rip
R1(config-router)#redistribute ospf 1 metric 1 //把OSPF发布进RIP,度量值为1
R1(config-router)#end
R1#
查看R3路由表: //学习到2条外部路由,与3条区域间路由.
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 not set
1.0.0.0/24 is subnetted, 2 subnets
O E2 1.1.1.0 [110/20] via 192.168.2.2, 00:00:45, FastEthernet0/1
//E2代表OSPF外部类型2的路由.
O E2 1.1.2.0 [110/20] via 192.168.2.2, 00:00:45, FastEthernet0/1
2.0.0.0/32 is subnetted, 2 subnets
O IA 2.2.1.1 [110/2] via 192.168.2.2, 00:03:09, FastEthernet0/1
O IA 2.2.2.1 [110/2] via 192.168.2.2, 00:03:09, FastEthernet0/1
O IA 192.168.1.0/24 [110/2] via 192.168.2.2, 00:03:09, FastEthernet0/1
C 192.168.2.0/24 is directly connected, FastEthernet0/1
R3#
步骤三:下面一步把区域1配置为末节区域,并再查看R3路由。(末节区域能阻止类型4,类型5的LSA,并产生一条OSPF的默认路由)
R2(config)#router ospf 1
R2(config-router)#area 1 stub //把区域1配置为末节区域
R3(config)#router ospf 1
R3(config-router)#area 1 stub //同上
查看R3路由表: //之前的外部E2路由不见了,取而代之的为一条OSPF默认路由.
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.2.2 to network 0.0.0.0
2.0.0.0/32 is subnetted, 2 subnets
O IA 2.2.1.1 [110/2] via 192.168.2.2, 00:01:56, FastEthernet0/1
O IA 2.2.2.1 [110/2] via 192.168.2.2, 00:01:56, FastEthernet0/1
O IA 192.168.1.0/24 [110/2] via 192.168.2.2, 00:01:56, FastEthernet0/1
C 192.168.2.0/24 is directly connected, FastEthernet0/1
O*IA 0.0.0.0/0 [110/2] via 192.168.2.2, 00:01:56, FastEthernet0/1
//带*表示默认路由,O*表示OSPF的默认路由.
R3#
步骤四:查看R3链路状态数据库是否阻止4/5类LSA,并测试能否拼通.
R3#show ip ospf database //很明显只有前三种LSA,在3类LSA中多了一条默认路由
OSPF Router with ID (192.168.2.1) (Process ID 1)
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.1 2.2.2.1 575 0x80000008 0x0065ff 1
192.168.2.1 192.168.2.1 757 0x80000a52 0x003810 1
Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
192.168.2.1 192.168.2.1 655 0x80000002 0x009fcd
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
192.168.1.0 2.2.2.1 1480 0x80000001 0x00a04c
2.2.1.1 2.2.2.1 1438 0x80000002 0x00143c
2.2.2.1 2.2.2.1 1438 0x80000003 0x000747
0.0.0.0 2.2.2.1 633 0x80000007 0x0051ff
R3#
验证:R3拼R1
R3#ping 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 33/45/64 ms
R3#
总结:因为末节区域阻止了4,5类的LSA,所以它是不能学习到E2,E1的外部路由,之所以最后能拼能R1,是因为末节区域自动加了一条默认路由指向ABR.
实验二:配置OSPF完全末节区域,拓扑如下:
步骤一:配置3台路由器,并且发布网段. //与实验一配置一样
步骤二:在R1上把RIP与OSPF互相重发布,并在R3查看路由表 //与实验一配置一样
步骤二:在R1上把RIP与OSPF互相重发布,并在R3查看路由表 //与实验一配置一样
步骤三:在R1与R3上把区域1改变成完全末节区域,并在R3上查看路由表
R2(config)#router ospf 1
R2(config-router)#area 1 stub no-summary //把区域1配置为完全末节区域
R3(config)#router ospf 1
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, 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 192.168.2.2 to network 0.0.0.0
C 192.168.2.0/24 is directly connected, FastEthernet0/1
O*IA 0.0.0.0/0 [110/2] via 192.168.2.2, 00:02:34, FastEthernet0/1
R3#
步骤四:查看R3的链路状态数据库,测试拼R1.
查看R3链路状态数据库: //3,4,5类型LSA换成一条区域间的默认路由
R3#show ip ospf database
OSPF Router with ID (192.168.2.1) (Process ID 1)
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.1 2.2.2.1 253 0x80000006 0x0087BF 1
192.168.2.1 192.168.2.1 266 0x80000004 0x00116F 1
Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
192.168.2.1 192.168.2.1 266 0x80000001 0x00C827
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 2.2.2.1 334 0x80000001 0x007BBB
R3#
R3拼R1:
R3#ping 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 424/664/1140 ms
R3#
实验完成.
本文转自 meiyanaa 51CTO博客,原文链接:http://blog.51cto.com/justim/271357,如需转载请自行联系原作者