您的位置:首页 > 其它

OSPF中的次末节区域和完全次末节区域

2010-03-17 22:42 399 查看
OSPF[/b]中的次末节区域和完全次末节区域[/b][/b]
次末节区域和末节区域不同的是他能引入外部路由,相同的是次末节区域也不接E1/E2型外部路由,我们配置NSSA的目的也就是出于这一点,如果一个非零区域和非OSPF区域相连我们通常就要把他配置成NSSA区域。还有一种完全次末节区域,和完全末节区域很相似,都不接收区域外的处默认路由外的所有的路由信息,不同的是完全次末节区域内引入N1/N2型的外部路由。
在ASBR上把外部路由转换成N1或者N2型路由(type 7),在ABR上把N1/N2路由在转换成E1/E2(type 5)的路由。另一个不同点就是ABR不会自动向区域内注入默认路由。
配置NSSA 区域的要求:在area内所有的路由器上都配置 area [/b]area-id[/i] nssa [/b]参数。
有时候我们需要往NSSA区域里注入默认路由,方法有两种:
1 把NSSA区域配置成完全次末节类型,这样ABR就会向NSSA区域中发一条默认IA型的默认路由。
2 在ABR上用area [/b]area-id[/i] nssa default-information-originate[/b],这样ABR就会向NSSA发布一条N2类型的路由。
如下面的场景:




R3连接internet,R1运行OSPF和RIP两种路由协议,这个时候我们可能需要把area 1 配置成NSSA型区域,同时需要R2向area 1注入一条默认路由,方法有两种:
1 把area 1在NSSA区域的基础上配置成完全末节类型,这样R2就会向area 1 中发一条默认IA型的默认路由,该默认路由的默认metric是1,而且在传播的过程中会增加。
2 在R2上(ABR上)用area [/b]area-id[/i] nssa default-information-originate [ metric [/b]cost[/i] ] [ metric-type { 1 | 2 } ] [/b],这样R2就会向area 1 发布一条 N1/N2类型的默认路由,默认metric为1,在传播过程中不增加。同时该参数也可以在ASBR用,因为有可能和internet互连的是非零区域,我们就需要在ASBR生成默认路由发布给OSPF,和在ABR发布不同的是在ASBR用该参数的时候必须存在一条默认路由才能使该参数生效。而area [/b]area-id[/i] nssa default-information-originate[/b]生成的默认路由的cost我们除了可以直接用metric参数修改外还可以用area area-id default-cost [/b]cost[/i]来修改。
方法1[/b]的实现及验证:[/b]
R2(config)#router ospf 1
R2(config-router)#area 1 nssa no-summary
R2(config-router)#end
看R1上的默认路由
R1#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 192.168.1.2 to network 0.0.0.0

1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
C 192.168.1.0/24 is directly connected, Serial1/1
O*IA 0.0.0.0/0 [110/65] via 192.168.1.2, 00:00:13, Serial1/1
方法2[/b]的实现及验证:[/b]
R2(config)#router ospf 1
R2(config-router)#area 1 nssa default-information-originate
R2(config-router)#end
R1#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 192.168.1.2 to network 0.0.0.0

1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
3.0.0.0/32 is subnetted, 1 subnets
O IA 3.3.3.3 [110/129] via 192.168.1.2, 00:05:05, Serial1/1
4.0.0.0/32 is subnetted, 1 subnets
O IA 4.4.4.4 [110/66] via 192.168.1.2, 00:05:05, Serial1/1
O IA 192.168.4.0/24 [110/65] via 192.168.1.2, 00:05:05, Serial1/1
C 192.168.1.0/24 is directly connected, Serial1/1
O IA 192.168.2.0/24 [110/128] via 192.168.1.2, 00:05:05, Serial1/1
O IA 192.168.3.0/24 [110/129] via 192.168.1.2, 00:05:05, Serial1/1
O*N2 0.0.0.0/0 [110/1] via 192.168.1.2, 00:00:08, Serial1/1
R2#sh ip ospf
*Aug 2 01:55:54.031: %SYS-5-CONFIG_I: Configured from console by console
Routing Process "ospf 1" with ID 2.2.2.2
Supports only single TOS(TOS0) routes
Supports opaque LSA
Supports Link-local Signaling (LLS)
It is an area border and autonomous system boundary router
Redistributing External Routes from,
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 1. Checksum Sum 0x00CE59
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 2. 1 normal 0 stub 1 nssa
External flood list length 1
Area BACKBONE(0)
Number of interfaces in this area is 2
Area has no authentication
SPF algorithm last executed 00:00:03.288 ago
SPF algorithm executed 20 times
Area ranges are
Number of LSA 5. Checksum Sum 0x01F183
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
Area 1
Number of interfaces in this area is 1
It is a NSSA area
Perform type-7/type-5 LSA translation
generates NSSA default route with cost 1
Area has no authentication
SPF algorithm last executed 00:00:03.700 ago
SPF algorithm executed 16 times
Area ranges are
Number of LSA 9. Checksum Sum 0x04472C
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
下面是在NSSA区域的ASBR向OSPF发布默认路由实验的场景



我们需要在R1上向OSPF注入默认路由,配置及验证步骤如下
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#ip route 0.0.0.0 0.0.0.0 lo 0
R1(config)#end
R1(config)#router ospf 1
R1(config-router)#area 1 nssa default-information-originate
R1(config-router)#end
R1#sh ip ospf
Routing Process "ospf 1" with ID 1.1.1.1
Supports only single TOS(TOS0) routes
Supports opaque LSA
Supports Link-local Signaling (LLS)
It is an autonomous system boundary router
Redistributing External Routes from,
connected
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 0 stub 1 nssa
External flood list length 0
Area 1
Number of interfaces in this area is 1
It is a NSSA area
generates NSSA default route with cost 1
Area has no authentication
SPF algorithm last executed 00:14:27.536 ago
SPF algorithm executed 12 times
Area ranges are
Number of LSA 7. Checksum Sum 0x03BD04
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
R2#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 192.168.1.1 to network 0.0.0.0

2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback1
4.0.0.0/24 is subnetted, 1 subnets
O E2 4.4.4.0 [110/20] via 192.168.4.1, 00:03:00, FastEthernet0/0
5.0.0.0/24 is subnetted, 1 subnets
O E2 5.5.5.0 [110/20] via 192.168.4.1, 00:03:00, FastEthernet0/0
C 192.168.4.0/24 is directly connected, FastEthernet0/0
O IA 192.168.5.0/24 [110/65] via 192.168.4.1, 00:07:55, FastEthernet0/0
10.0.0.0/24 is subnetted, 1 subnets
O E2 10.10.10.0 [110/20] via 192.168.4.1, 00:03:00, FastEthernet0/0
C 192.168.1.0/24 is directly connected, Serial1/0
C 192.168.2.0/24 is directly connected, Serial1/1
O 192.168.3.0/24 [110/65] via 192.168.4.1, 00:07:55, FastEthernet0/0
O*N2 0.0.0.0/0 [110/1] via 192.168.1.1, 00:00:31, Serial1/0

场景如下图:R2既是NSSA的ABR,又是ASBR,而NSSA区域不想引入R2重发布进来的外部路由,方法是在R2上area area-id nssa no-redistribution,这也就是阻止部分ASBR引入的N1/N2路由在NSSA区域内传播的方法



本文出自 “jimao” 博客,请务必保留此出处http://diamonder.blog.51cto.com/159220/284795
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: