ospf特殊区域,默认路由,汇总,认证<?xml:namespace prefix = o />

 

一:OSPF特殊区域:

 
LSA types allowed per area type.
                      

 

 

 

 

 

 

Area Type

1&2

3

4

5

7

Backbone (area 0)

Yes

Yes

Yes

Yes

No

Non-backbone, non-stub

Yes

Yes

Yes

Yes

No

Stub

Yes

Yes

No

No

No

Totally stubby

Yes

No[*]

No

No

No

Not-so-stubby

Yes

Yes

NO

No

Yes

Total NSSA

Yes

No

No

No

Yes

 

 
[*] Except for a single type 3 LSA per ABR, advertising the default route.

 

 

Stub区域特点如下:

 

1.As in any area, all routers in a stub area must have identical link-state databases. To ensure this condition, all stub routers will

set a flag (the E-bit) in their Hello packets to zero(表示不接受45LSA; they will not accept any Hello from a router in which the E-bit is set to one. As

a result, adjacencies will not be established with any router that is not configured as a stub router.

2. Virtual links cannot be configured within, nor transit, a stub area.

3.No router within a stub area can be an ASBR. This restriction is intuitively understandable because ASBRs produce type 5

LSAs, and type 5 LSAs cannot exist within a stub area.

4.A stub area might have more than one ABR, but because of the default route, the internal routers cannot determine which router

is the optimal gateway to the ASBR.

 

根据特性一可以看出,stub区域需要在区域内的所有路由器上进行配置,配置命令如下:

Area 1 stub

Stub区域的ABR会产生一条三类的默认路由在区域内泛洪

 

 

 

Total stub 区域特点: :

除具备stub 区域的所有特点外,还具备有阻止3LSA的特性,Total stub 区域需要在stub 区域的基础上,在ABR上配置如下命令:

Area 1 stub no-summary

 

NSSA区域的特点:

 

The NSSA External LSA has a flag in its header known as the P-bit. The NSSA ASBR has the option of setting or clearing the P-bit. If the

NSSA's ABR receives a type 7 LSA with the P-bit set to one, it will translate the type 7 LSA into a type 5 LSA and flood it throughout the

other areas. If the P-bit is set to zero, no translation will take place and the destination in the type 7 LSA will not be

advertised outside of the NSSA. This option allows you to design an NSSA in which the external destinations learned in that area are

known only in that area.

 

NSSA区域也需要在区域内所有路由器上进行配置,命令如下:

Area 1 nssa

 

注意:NSSA区域的ABR不会自动产生一条3类的默认路由,需要管理员在ABR上进行手工配置,命令如下:

Area 1 nssa default-information-originate

 

Total NSSA区域的特点:

 

NSSA区域的基础上,阻止了3LSA,并且能够自动产生一条3类的在区域内泛洪

 

提出疑问:为什么NSSA区域不能自动产生3类的默认路由,而

Stub total stub total nssa却可以?

 

解决疑问:要知道,NSSA区域能够通过7LSA引入外部路由,并且NSSAABR并不阻止3LSA的进入,因此,NSSA区域内部的路由器,可以在不需要默认路由的情况下实现域间通信和与外部通信,而其他三种特殊区域在没有默认路由的情况下,显然无法实现域间通信和与外部通信,故需要自动产生3类的默认路由加以弥补

 

 

 

 

 

 

二:默认路由:

 

OSPF有两种方式产生默认路由:

1  通过命令 default-information originate

若想此命令生效,在路由器的路由表中必须要有一条默认路由,可通过静态路由写入一条静态路由,而后,路由器将产生一条5类的静态路由在整个OSPF域内进行泛洪

 

注意:若路由器处于特殊区域内,则将无法配置此命令!(若是特殊区域的ABR,且其至少连接了一个常规区域,则可配置此命令)

 

2  通过命令 default-information originate always

配置了此命令后,则不管路由器上是否有默认路由,路由器都会产生一条5类的静态路由在整个OSPF域内进行泛洪

 

注意:若路由器处于特殊区域内,则将无法配置此命令!(若是特殊区域的ABR,且其至少连接了一个常规区域,则可配置此命令)

 

三:OSPF地址汇总:

汇总有两种命令

1Area 1 range 172.168.0.0 255.255.252.0

此命令的意思是,将area 1 中的172.168.0.0 汇总成掩码长度为18 的地址,并向除area 1以外的区域以三类LSA的形式泛洪,由此可以推断出,此命令一般用于ABR上。

注意:ABR上配置了该命令后,ABR路由器会首先检查路由表,只有当汇总的主网段在路由表中出现,并且该路由条目是由LSA1计算的来的(即通过network引入),ABR路由器才会产生一条3类的汇总LSA,向其他区域泛洪

2Summary-address 172.168.0.0 255.255.252.0

此命令的意思是,将该汇总信息向其所连的所有区域以5LSA的形式泛洪(一般用于ASBR上)

注意:ASBR上配置了该命令后,ASBR路由器会首先检查路由表,只有当汇总的主网段在路由表中出现,并且该路由条目是由他自己通过重分布引入,ASBR路由器才会产生一条5类的汇总LSA,在整个区域内泛洪

 

四:OSPF认证

1.两个OSPF路由器之间的认证:

遵循以下步骤:

一:配置密钥(在接口模式中配置)

Ip ospf authentication-key cisco(明文认证)

 

Ip ospf message-digest-key 1 md5 cisco MD5密文认证)

 

 

 

二:启用认证(在接口模式中配置)

Ip ospf authentication(明文认证)

 

Ip ospf authentication message-digest MD5密文认证)

 

2.区域认证:

遵循以下步骤:

一:区域内部启用认证(OSPF进程模式下配置),配置此命令的路由器将会要求与该区域内的所有邻居进行认证

 

Area 0 authentication (明文认证)

 

Area 0 authentication message-digestMD5密文认证)

 

二:配置密钥(接口模式下配置)

Ip ospf authentication-key cisco(明文认证)

 

Ip ospf message-digest-key 1 md5 cisco MD5密文认证)