1. 程式人生 > 實用技巧 >OSPF特殊區域總結

OSPF特殊區域總結

一、拓撲圖

clip_p_w_picpath002

二、實驗目的

觀察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

轉載於:https://blog.51cto.com/liu008qing/454213