一、拓扑图

OSPF特殊区域总结_第1张图片

二、实验目的

观察stub区域以及NSSA区域的路由以及默认路由是如何产生的

说明:不启动R1和R2,启动其他路由器

三、实验步骤

STUB:

1.将AREA1 配置成STUB区域,看STUB区域的配置以及LSA和默认路由的生成

在R7上配置将RIP重分发到OSPF110,

router ospf 110

redistribute rip subnets

在R5上看路由表,结果显示有区域间的路由以及外部路由。区域间由用O IA标识,外部路由用O E2标识

R5#show ip route ospf

34.0.0.0/24 is subnetted, 1 subnets

O IA 34.1.1.0 [110/74] via 35.1.1.3, 00:05:32, Serial0/1

3.0.0.0/32 is subnetted, 1 subnets

O IA 3.3.3.3 [110/65] via 35.1.1.3, 00:05:32, Serial0/1

36.0.0.0/24 is subnetted, 1 subnets

O IA 36.1.1.0 [110/128] via 35.1.1.3, 00:05:32, Serial0/1

6.0.0.0/32 is subnetted, 4 subnets

O IA 6.6.2.6 [110/129] via 35.1.1.3, 00:04:52, Serial0/1

O IA 6.6.3.6 [110/129] via 35.1.1.3, 00:04:42, Serial0/1

O IA 6.6.0.6 [110/129] via 35.1.1.3, 00:04:52, Serial0/1

O IA 6.6.1.6 [110/129] via 35.1.1.3, 00:04:52, Serial0/1

7.0.0.0/32 is subnetted, 1 subnets

O IA 7.7.7.7 [110/139] via 35.1.1.3, 00:04:19, Serial0/1

8.0.0.0/24 is subnetted, 4 subnets

O E2 8.8.0.0 [110/20] via 35.1.1.3, 00:00:39, Serial0/1

O E2 8.8.1.0 [110/20] via 35.1.1.3, 00:00:39, Serial0/1

O E2 8.8.2.0 [110/20] via 35.1.1.3, 00:00:39, Serial0/1

O E2 8.8.3.0 [110/20] via 35.1.1.3, 00:00:39, Serial0/1

78.0.0.0/24 is subnetted, 1 subnets

O E2 78.1.1.0 [110/20] via 35.1.1.3, 00:00:39, Serial0/1

47.0.0.0/24 is subnetted, 1 subnets

O IA 47.1.1.0 [110/138] via 35.1.1.3, 00:05:32, Serial0/1

2.将区域1配置成Stub,在区域1的所有路由器上面都配置上 area 1 stub

R5#show ip route ospf

34.0.0.0/24 is subnetted, 1 subnets

O IA 34.1.1.0 [110/74] via 35.1.1.3, 00:00:08, Serial0/1

3.0.0.0/32 is subnetted, 1 subnets

O IA 3.3.3.3 [110/65] via 35.1.1.3, 00:00:08, Serial0/1

36.0.0.0/24 is subnetted, 1 subnets

O IA 36.1.1.0 [110/128] via 35.1.1.3, 00:00:08, Serial0/1

6.0.0.0/32 is subnetted, 4 subnets

O IA 6.6.2.6 [110/129] via 35.1.1.3, 00:00:08, Serial0/1

O IA 6.6.3.6 [110/129] via 35.1.1.3, 00:00:08, Serial0/1

O IA 6.6.0.6 [110/129] via 35.1.1.3, 00:00:08, Serial0/1

O IA 6.6.1.6 [110/129] via 35.1.1.3, 00:00:08, Serial0/1

7.0.0.0/32 is subnetted, 1 subnets

O IA 7.7.7.7 [110/139] via 35.1.1.3, 00:00:08, Serial0/1

47.0.0.0/24 is subnetted, 1 subnets

O IA 47.1.1.0 [110/138] via 35.1.1.3, 00:00:08, Serial0/1

O*IA 0.0.0.0/0 [110/65] via 35.1.1.3, 00:00:08, Serial0/1

结果:Stub区域里没有外部路由,去往外部的路由由ABR自动向该区域的路由器下放一条3类默认路由,Metric值为1

Stub区域里没有LSA4/5,该区域不能存在ASBR

该区域有区域间的路由

Totally Stubby区域

1.配置,在Stub区域的ABR上配置一条命令 no-summary,过滤掉LSA3

Totally Stubby区域的路由器只有区域内部的路由以及一条指向ABR的默认路由去往区域间以及外部

在R5上查看路由表,对比Stub区域

R5#show ip route ospf

O*IA 0.0.0.0/0 [110/65] via 35.1.1.3, 00:00:13, Serial0/1

R5#show ip ospf database

OSPF Router with ID (5.5.5.5) (Process ID 110)

Router Link States (Area 1)

Link ID ADV Router Age Seq# Checksum Link count

3.3.3.3 3.3.3.3 423 0x80000004 0x00B177 2

5.5.5.5 5.5.5.5 423 0x80000004 0x007486 3

Summary Net Link States (Area 1)

Link ID ADV Router Age Seq# Checksum

0.0.0.0 3.3.3.3 43 0x80000002 0x0055DB

NSSA区域:

将上图的区域3 配置成NSSA区域,将R6的四个环回口配置成RIP路由,并重分发到OSPF中,查看NSSA区域的路由表

在R4和R7上配置:area 3 nssa这条命令,以把这两台路由的区域3配置成为NSSA区域。

看R7的路由表,可以看到有8.8.0.0/22的路由,但是没有去往6.6.0.0/22的路由。

同时在R4上看路由表,发现在去往6.6.0.0/22的路由,但没有将默认路由发送到NSSA区域的内部路由器

R7#show ip route

34.0.0.0/24 is subnetted, 1 subnets

O IA 34.1.1.0 [110/74] via 47.1.1.4, 00:01:18, Serial0/2

35.0.0.0/24 is subnetted, 1 subnets

O IA 35.1.1.0 [110/138] via 47.1.1.4, 00:01:18, Serial0/2

3.0.0.0/32 is subnetted, 1 subnets

O IA 3.3.3.3 [110/75] via 47.1.1.4, 00:01:18, Serial0/2

5.0.0.0/32 is subnetted, 1 subnets

O IA 5.5.5.5 [110/139] via 47.1.1.4, 00:01:18, Serial0/2

36.0.0.0/24 is subnetted, 1 subnets

O IA 36.1.1.0 [110/138] via 47.1.1.4, 00:01:18, Serial0/2

7.0.0.0/24 is subnetted, 1 subnets

C 7.7.7.0 is directly connected, Loopback0

8.0.0.0/24 is subnetted, 4 subnets

R 8.8.0.0 [120/1] via 78.1.1.8, 00:00:22, Serial0/3

R 8.8.1.0 [120/1] via 78.1.1.8, 00:00:22, Serial0/3

R 8.8.2.0 [120/1] via 78.1.1.8, 00:00:22, Serial0/3

R 8.8.3.0 [120/1] via 78.1.1.8, 00:00:22, Serial0/3

78.0.0.0/24 is subnetted, 1 subnets

C 78.1.1.0 is directly connected, Serial0/3

47.0.0.0/24 is subnetted, 1 subnets

C 47.1.1.0 is directly connected, Serial0/2

总结:

1.NSSA区域允许接入ASBR,以引入外部路由

2.不允许非本区域的外部路由进入本区域,也就是说过滤掉了LSA4/5.

3.NSSA区域的ABR不会自动生成一条默认路由去往区域内部的路由器,需手工输入:area 3 nssa default-information-originate

注意,不能在路由进程中输入:default-information originate,这条命令不起效,不能向R7注入默认路由

此时再看R7的路由表

34.0.0.0/24 is subnetted, 1 subnets

O IA 34.1.1.0 [110/74] via 47.1.1.4, 00:02:54, Serial0/2

35.0.0.0/24 is subnetted, 1 subnets

O IA 35.1.1.0 [110/138] via 47.1.1.4, 00:02:54, Serial0/2

3.0.0.0/32 is subnetted, 1 subnets

O IA 3.3.3.3 [110/75] via 47.1.1.4, 00:02:54, Serial0/2

5.0.0.0/32 is subnetted, 1 subnets

O IA 5.5.5.5 [110/139] via 47.1.1.4, 00:02:54, Serial0/2

36.0.0.0/24 is subnetted, 1 subnets

O IA 36.1.1.0 [110/138] via 47.1.1.4, 00:02:54, Serial0/2

7.0.0.0/24 is subnetted, 1 subnets

C 7.7.7.0 is directly connected, Loopback0

8.0.0.0/24 is subnetted, 4 subnets

R 8.8.0.0 [120/1] via 78.1.1.8, 00:00:05, Serial0/3

R 8.8.1.0 [120/1] via 78.1.1.8, 00:00:05, Serial0/3

R 8.8.2.0 [120/1] via 78.1.1.8, 00:00:05, Serial0/3

R 8.8.3.0 [120/1] via 78.1.1.8, 00:00:05, Serial0/3

78.0.0.0/24 is subnetted, 1 subnets

C 78.1.1.0 is directly connected, Serial0/3

47.0.0.0/24 is subnetted, 1 subnets

C 47.1.1.0 is directly connected, Serial0/2

O*N2 0.0.0.0/0 [110/1] via 47.1.1.4, 00:01:30, Serial0/2

多了一条7类LSA发布的外部路由

Totally NSSA

在NSSA区域的基础上,减少了3类LSA。

配置在NSSA区域的ABR上,加上一条命令:area 3 nssa no-summary default-information-originate

R7#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

Gateway of last resort is 47.1.1.4 to network 0.0.0.0

7.0.0.0/24 is subnetted, 1 subnets

C 7.7.7.0 is directly connected, Loopback0

8.0.0.0/24 is subnetted, 4 subnets

R 8.8.0.0 [120/1] via 78.1.1.8, 00:00:02, Serial0/3

R 8.8.1.0 [120/1] via 78.1.1.8, 00:00:02, Serial0/3

R 8.8.2.0 [120/1] via 78.1.1.8, 00:00:02, Serial0/3

R 8.8.3.0 [120/1] via 78.1.1.8, 00:00:02, Serial0/3

78.0.0.0/24 is subnetted, 1 subnets

C 78.1.1.0 is directly connected, Serial0/3

47.0.0.0/24 is subnetted, 1 subnets

C 47.1.1.0 is directly connected, Serial0/2

O*IA 0.0.0.0/0 [110/65] via 47.1.1.4, 00:00:06, Serial0/2

特殊区域的总结

区域名称

过滤的LSA

路由

是否自动生成默认路由

配置命令

Stub

LSA4/5

区域内及区域间的路由

ABR自动生成

区域内所有路由器配置Area AID stub

Totally Stubby

LSA4/5 LSA3

区域内路由

ABR自动生成

区域内Area AID stub

ABR :Aere AID stub no-summary

NSSA

LSA4/5

允许LSA7

区域内及区域间的路由

允许本区域引入的外部路由ON1/2

在ABR上配置

Area aid nssa default-information-originate

区域内所有路由器配置

Area aid nssa

Totally NSSA

LSA4/5 LSA3

允许LSA7

区域内路由

允许本区域引入的外部路由ON1/2

在ABR上配置

Area aid nssa no-summary default-information-originate

区域内所有路由器配置area aid nssa

ABR:area aid nssa no-summary