OSPF LSA 类型 ——连载四 ASBR 汇总 LSA <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

 

1

<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" />

(基本配置见“ OSPF LSA 类型 ——连载一”)

 

4        ASBR 汇总 LSA

 

            ASBR 汇总 LSA 通告的是一个区域外部的 ASBR 路由器,且只能在单个区域中泛洪。由外部路由起源区域的 ABR 产生,泛洪到起源区域的整个 AS 中。

 

           LSA 传播范围:泛洪到整个 AS 中,(把 ASBR Router ID 传播到其他区域,让其他区域的路由器得知 ASBR 的位置。)

           LSA 通告路由器: ABR Router ID (经过一个 ABR ,就会改为这个 ABR Router ID

           LSA 链路状态 ID ASBR Router ID

           LSA 包含的内容:本区域中的路由信息,包括网络号和掩码

 

注意: ASBR 直连的区域内,不会产生 4 类的 LSA ,因为 ASBR 会发出 1 类的 LSA ,其中会指明自己是 ASBR

 

          show ip os database asbr-summary     查看一条 ASBR 汇总 LSA

 

实验前必须先将 R5 连接的 172.16.1.0 网络重分发进 OSPF ,因为此时 R3 还未能学到去往 172.16.1.0 网络的路由。

 

先看一下没有重分布之前, R3 上的路由信息( R5 一直都存在一条 172.16.1.0 的直连路由):

R3# sh ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />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 not set

 

     35.0.0.0/24 is subnetted, 1 subnets

C       35.1.1.0 is directly connected, Serial1/1

     24.0.0.0/24 is subnetted, 1 subnets

O IA    24.1.1.0 [110/138] via 13.1.1.1, 01:33:17, Serial1/0

     12.0.0.0/24 is subnetted, 1 subnets

O       12.1.1.0 [110/74] via 13.1.1.1, 01:33:17, Serial1/0

     13.0.0.0/24 is subnetted, 1 subnets

C       13.1.1.0 is directly connected, Serial1/0

 

现在再把 R5 RIP 信息重分布进 OSPF

R5(config)#router ospf 110

R5(config-router)#redistribute rip subnet

 

再一次观察一下 R3 上的路由信息:

R3#sh ip route

 

     35.0.0.0/24 is subnetted, 1 subnets

C       35.1.1.0 is directly connected, Serial1/1

     172.16.0.0/24 is subnetted, 1 subnets

O E2    172.16.1.0 [110/ 20 ] via 35.1.1.5, 00:00:02, Serial1/1

     24.0.0.0/24 is subnetted, 1 subnets

O IA    24.1.1.0 [110/138] via 13.1.1.1, 00:00:02, Serial1/0

     12.0.0.0/24 is subnetted, 1 subnets

O       12.1.1.0 [110/74] via 13.1.1.1, 01:37:09, Serial1/0

     13.0.0.0/24 is subnetted, 1 subnets

C       13.1.1.0 is directly connected, Serial1/0

 

这时, OSPF 网络中的其他路由器也都学习到了 172.16.0.0 网络的路由了,且都是以 O E2 形式。

 

外部路由重分布进OSPF有两种类型

·重分布进OSPF的路由默认为E2,Cost=20,且传递过程中不改变COST。

·如果改为E1类型,则在传输过程中会累加每个入接口的cost值

 

 

 

 

如果有去往同一目标的多条路由重分布进OSPF,OSPF在选择外部路由的时候,遵循的原则是:

[1] O E1 优于 O E2

[2]在同样的情况下,Cost越小越优先

[3]在cost相同的情况下,选择到达ASBR最优的路径

 

我们现在到R4上查看一下,看R4上有没有这条LSA信息:

R4#show ip ospf database asbr-summary

 

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

 

                Summary ASB Link States (Area 1)

 

  Routing Bit Set on this LSA

  LS age: 1700

  Options: (No TOS-capability, DC, Upward)

  LS Type: Summary Links(AS Boundary Router)

  Link State ID: 5.5.5.5 (AS Boundary Router address)     // ASBR( 连接外部网络的路由器 ) Router ID

  Advertising Router: 2.2.2.2        // ABR Router ID

  LS Seq Number: 80000001

  Checksum: 0xC1D3

  Length: 28

  Network Mask: /0                   //没有实际意义,被设置为0.0.0.0(《TCP/IP 路由第一卷》是这么解释的,但为什么说没有实际意义,我还没搞清楚)

        TOS: 0  Metric: 138