ospf nssa区域4类lsa的问题:
拓扑
r1----r5----r2
首先将r1与r5的链路配置在区域1中,将r5与r2的链路配置在区域0中,配置几个r1的loopback地址做测试,r5上show ip route和show ip ospf database如下:
R5#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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

     1.0.0.0/32 is subnetted, 1 subnets
O E2    1.1.1.1 [110/20] via 192.168.1.1, 00:04:24, Serial0/0
     5.0.0.0/32 is subnetted, 1 subnets
C       5.5.5.5 is directly connected, Loopback0
     10.0.0.0/24 is subnetted, 3 subnets
O E2    10.1.3.0 [110/20] via 192.168.1.1, 00:04:24, Serial0/0
O E2    10.1.2.0 [110/20] via 192.168.1.1, 00:04:24, Serial0/0
O E2    10.1.1.0 [110/20] via 192.168.1.1, 00:04:24, Serial0/0
     192.168.1.0/30 is subnetted, 2 subnets
C       192.168.1.0 is directly connected, Serial0/0
C       192.168.1.4 is directly connected, Serial0/1

R5#show ip ospf database 

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


                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
2.2.2.2         2.2.2.2         300         0x80000002 0x8221   2
5.5.5.5         5.5.5.5         300         0x80000002 0x2C6B   2

                Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.1.0     5.5.5.5         321         0x80000001 0xA6DA  

                Summary ASB Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.10.10.10     5.5.5.5         296         0x80000001 0x9926  

                Router Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum Link count
5.5.5.5         5.5.5.5         317         0x80000003 0xB8C4   2
10.10.10.10     10.10.10.10     298         0x80000003 0x85E3   2

                Summary Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.1.4     5.5.5.5         312         0x80000001 0x7EFE  

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
1.1.1.1         10.10.10.10     288         0x80000001 0x8CE7   0
10.1.1.0        10.10.10.10     288         0x80000001 0x214B   0
10.1.2.0        10.10.10.10     288         0x80000001 0x1655   0
10.1.3.0        10.10.10.10     288         0x80000001 0xB5F    0
可以看到有4类的lsa,link ID为r1的router-id,ADV Router为r5的router-id,表明是由r5产生的这个4类的lsa,用于指定asbr的router-id的地址,然后查看r2的lsa:
R5#show ip route 
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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

     1.0.0.0/32 is subnetted, 1 subnets
O N2    1.1.1.1 [110/20] via 192.168.1.1, 00:00:01, Serial0/0
     5.0.0.0/32 is subnetted, 1 subnets
C       5.5.5.5 is directly connected, Loopback0
     10.0.0.0/24 is subnetted, 3 subnets
O N2    10.1.3.0 [110/20] via 192.168.1.1, 00:00:01, Serial0/0
O N2    10.1.2.0 [110/20] via 192.168.1.1, 00:00:01, Serial0/0
O N2    10.1.1.0 [110/20] via 192.168.1.1, 00:00:01, Serial0/0
     192.168.1.0/30 is subnetted, 2 subnets
C       192.168.1.0 is directly connected, Serial0/0
C       192.168.1.4 is directly connected, Serial0/1

R2#show ip ospf database 

       OSPF Router with ID (2.2.2.2) (Process ID 1)


                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
2.2.2.2         2.2.2.2         484         0x80000002 0x8221   2
5.5.5.5         5.5.5.5         484         0x80000002 0x2C6B   2

                Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.1.0     5.5.5.5         505         0x80000001 0xA6DA  

                Summary ASB Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.10.10.10     5.5.5.5         480         0x80000001 0x9926  

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
1.1.1.1         10.10.10.10     471         0x80000001 0x8CE7   0
10.1.1.0        10.10.10.10     472         0x80000001 0x214B   0
10.1.2.0        10.10.10.10     472         0x80000001 0x1655   0
10.1.3.0        10.10.10.10     472         0x80000001 0xB5F    0
也具有4类lsa,并且在5类lsa中link ID是asbr重发布过来的地址,ADV Router全部都是r1的router-id,说明as外部地址都是通过r1学到的,而r1可以通过r5到达。
下面把area 1配置成为nssa区域,然后在观察r5的show ip route和show ip ospf database:
R5#show ip ospf database 

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


                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
2.2.2.2         2.2.2.2         746         0x80000002 0x8221   2
5.5.5.5         5.5.5.5         16          0x80000003 0x3064   2

                Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.1.0     5.5.5.5         767         0x80000001 0xA6DA  

                Router Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum Link count
5.5.5.5         5.5.5.5         10          0x80000005 0x6013   2
10.10.10.10     10.10.10.10     9           0x80000005 0x273A   2

                Summary Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.1.4     5.5.5.5         16          0x80000002 0x2254  

                Type-7 AS External Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum Tag
1.1.1.1         10.10.10.10     14          0x80000001 0x43BB   0
10.1.1.0        10.10.10.10     14          0x80000001 0xD71F   0
10.1.2.0        10.10.10.10     14          0x80000001 0xCC29   0
10.1.3.0        10.10.10.10     14          0x80000001 0xC133   0

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
1.1.1.1         5.5.5.5         6           0x80000001 0x6EAE   0
10.1.1.0        5.5.5.5         6           0x80000001 0x312    0
10.1.2.0        5.5.5.5         6           0x80000001 0xF71C   0
10.1.3.0        5.5.5.5         6           0x80000001 0xEC26   0
通过路由表和lsa数据库可以看到r5将7类lsa转变成为5类的lsa,注意在转变成为5类lsa的时候ADV Router变为r5的router-id了,再看一下r2的lsa数据库:
R2#show ip ospf database 

       OSPF Router with ID (2.2.2.2) (Process ID 1)


                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
2.2.2.2         2.2.2.2         904         0x80000002 0x8221   2
5.5.5.5         5.5.5.5         175         0x80000003 0x3064   2

                Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.1.0     5.5.5.5         926         0x80000001 0xA6DA  

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
1.1.1.1         5.5.5.5         164         0x80000001 0x6EAE   0
10.1.1.0        5.5.5.5         164         0x80000001 0x312    0
10.1.2.0        5.5.5.5         164         0x80000001 0xF71C   0
10.1.3.0        5.5.5.5         164         0x80000001 0xEC26   0
也同样没有4类lsa了,看一下5类lsa中所有链路地址都是通过r5学到的,所以也就不需要知道真正asbr的位置在哪,只需要把数据转发给r5,由r5根据路由表转发给asbr就可以了,这就是没有4类lsa的原因了。


PS:TCP/IP路由卷一中讲述ospf nssa区域的时候说nssa不拒绝4类lsa,是错误的,看的时候请注意更正!






















本文转自loveme2351CTO博客,原文链接:http://blog.51cto.com/loveme23/102566 ,如需转载请自行联系原作者