1. 程式人生 > >OSPF的LSA分組和特殊區域 歸納總結

OSPF的LSA分組和特殊區域 歸納總結

   ①LSA的六種重要分組

Type

LSA類別        

攜帶資訊        

傳播範圍        

通告路由器

Link State ID        

LSA 1

Router LSA        

域內路由

本區域內        

區域內每臺路由器

始發路由器的Router-id

LSA 2

Network LSA        

MA網段中的所有路由器

本區域內        

指定路由器DR        

DR介面的IP地址        

LSA 3

Summary LSA

域間路由        

整個OSPF域

(除源區域)

ABR路由器

通告的本區域外部網路的IP地址        

LSA 4

ASBR-summary LSA        

ASBR路由器的位置        

整個OSPF區域

(除ASBR所在區域外)

ABR路由器

ASBR的Router-id        

LSA 5

AS External LSA        

域外路由        

整個OSPF域        

ASBR路由器

E路由的目標網段

LSA 7

NSSA-external LSA

域外路由        

整個NSSA區域        

ASBR路由器

N路由的目標網段 

       

 


 

   ②OSPF的特殊區域

      特殊區域包括:stub、totally stub、NSSA、totally NSSA

      設定特殊區域的作用:隔離LSA,節省網路資源,降低路由器記憶體消耗。

特殊區域

作用

末梢路由器是否引入外部路由

ABR是否向特殊區域下發預設路由

stub

阻止LSA4/5進入Stub區域

不會

totally stub

阻止LSA3/4/5進入Stub區域

不會

NSSA

阻止LSA4/5進入NSSA區域

不會

totally NSSA

阻止LSA3/4/5進入NSSA區域

不會

 

(1)stub區域(以實驗的ospf area1為例)

作用:阻止LSA4/5進入Stub區域

末梢區域的ABR會向STUB區域內的路由器下發一條LSA3預設路由

在將area 1配置為特殊區域stub之前

R1的database如下:

R1#show ip ospf database 

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

                Router Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         276         0x80000004 0x00D71C 2
2.2.2.2         2.2.2.2         276         0x80000004 0x00837B 1

                Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
12.1.1.2        2.2.2.2         276         0x80000003 0x000E06

                Summary Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
2.2.2.2         2.2.2.2         285         0x80000002 0x00F832
3.3.3.3         2.2.2.2         285         0x80000002 0x00D451
4.4.4.4         2.2.2.2         285         0x80000002 0x00B070
5.5.5.5         2.2.2.2         285         0x80000002 0x0078A5
6.6.6.6         2.2.2.2         139         0x80000001 0x0056C3
23.1.1.0        2.2.2.2         285         0x80000004 0x000E0A
25.1.1.0        2.2.2.2         285         0x80000004 0x00F322
34.1.1.0        2.2.2.2         287         0x80000006 0x008485
36.1.1.0        2.2.2.2         141         0x80000006 0x006A9D

                Summary ASB Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
4.4.4.4         2.2.2.2         287         0x80000001 0x009A87
6.6.6.6         2.2.2.2         141         0x80000001 0x003EDB

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
172.16.1.1      4.4.4.4         435         0x80000002 0x00D2FD 0
172.16.2.1      4.4.4.4         435         0x80000002 0x00C708 0
172.16.3.1      4.4.4.4         435         0x80000002 0x00BC12 0
192.168.1.1     6.6.6.6         381         0x80000001 0x006CB0 0
192.168.2.1     6.6.6.6         381         0x80000001 0x0061BA 0
192.168.3.1     6.6.6.6         381         0x80000001 0x0056C4 0

在沒有設定特殊區域stub之前,R1會接受到LSA 4和LSA 5(標紅部分)

 

也可以檢視R1的路由表,如下:

R1#show ip route

     34.0.0.0/24 is subnetted, 1 subnets
O IA    34.1.1.0 [110/3] via 12.1.1.2, 00:06:20, FastEthernet0/0
     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
     2.0.0.0/32 is subnetted, 1 subnets
O IA    2.2.2.2 [110/2] via 12.1.1.2, 00:06:20, FastEthernet0/0
     3.0.0.0/32 is subnetted, 1 subnets
O IA    3.3.3.3 [110/3] via 12.1.1.2, 00:06:20, FastEthernet0/0
     4.0.0.0/32 is subnetted, 1 subnets
O IA    4.4.4.4 [110/4] via 12.1.1.2, 00:06:20, FastEthernet0/0
     5.0.0.0/32 is subnetted, 1 subnets
O IA    5.5.5.5 [110/3] via 12.1.1.2, 00:06:22, FastEthernet0/0
     36.0.0.0/24 is subnetted, 1 subnets
O IA    36.1.1.0 [110/3] via 12.1.1.2, 00:04:20, FastEthernet0/0
     6.0.0.0/32 is subnetted, 1 subnets
O IA    6.6.6.6 [110/4] via 12.1.1.2, 00:04:20, FastEthernet0/0
     23.0.0.0/24 is subnetted, 1 subnets
O IA    23.1.1.0 [110/2] via 12.1.1.2, 00:06:23, FastEthernet0/0
     172.16.0.0/32 is subnetted, 3 subnets
O E2    172.16.1.1 [110/20] via 12.1.1.2, 00:04:15, FastEthernet0/0
O E2    172.16.3.1 [110/20] via 12.1.1.2, 00:04:15, FastEthernet0/0
O E2    172.16.2.1 [110/20] via 12.1.1.2, 00:04:15, FastEthernet0/0

     25.0.0.0/24 is subnetted, 1 subnets
O IA    25.1.1.0 [110/2] via 12.1.1.2, 00:06:23, FastEthernet0/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, FastEthernet0/0
     192.168.1.0/32 is subnetted, 1 subnets
O E2    192.168.1.1 [110/20] via 12.1.1.2, 00:04:15, FastEthernet0/0
     192.168.2.0/32 is subnetted, 1 subnets
O E2    192.168.2.1 [110/20] via 12.1.1.2, 00:04:15, FastEthernet0/0
     192.168.3.0/32 is subnetted, 1 subnets
O E2    192.168.3.1 [110/20] via 12.1.1.2, 00:04:16, FastEthernet0/0

標紅部分為域外路由,是通過LSA 5學習到的路由條目

 

然後部署特殊區域stub

R1(config)#router ospf 1

R1(config-router)#area 1 stub

R2(config)#router ospf 1

R2(config-router)#area 1 stub

注意:R1與R2都必須在ospf程序下輸入命令:area 1 stub,

不然R1與R2建鄰居時傳送的hello包的末梢位元組不一樣,鄰居就建不起來了

 

當部署area1為特殊區域stub之後

R1的database如下:

R1#show ip ospf database

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

                Router Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         11          0x80000006 0x00F102 2
2.2.2.2         2.2.2.2         12          0x80000006 0x009D61 1

                Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
12.1.1.2        2.2.2.2         12          0x80000005 0x0028EB

                Summary Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
0.0.0.0         2.2.2.2         17          0x80000001 0x0075C0
2.2.2.2         2.2.2.2         17          0x80000003 0x001517
3.3.3.3         2.2.2.2         17          0x80000003 0x00F036
4.4.4.4         2.2.2.2         17          0x80000003 0x00CC55
5.5.5.5         2.2.2.2         17          0x80000003 0x00948A
6.6.6.6         2.2.2.2         17          0x80000002 0x0072A8
23.1.1.0        2.2.2.2         17          0x80000005 0x002AEE
25.1.1.0        2.2.2.2         19          0x80000005 0x001007
34.1.1.0        2.2.2.2         19          0x80000007 0x00A06A
36.1.1.0        2.2.2.2         19          0x80000007 0x008682

R1沒有收到LSA4和LSA5的路由通告

再看R1的路由表,如下:

R1#show ip route

     34.0.0.0/24 is subnetted, 1 subnets
O IA    34.1.1.0 [110/3] via 12.1.1.2, 00:03:21, FastEthernet0/0
     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
     2.0.0.0/32 is subnetted, 1 subnets
O IA    2.2.2.2 [110/2] via 12.1.1.2, 00:03:21, FastEthernet0/0
     3.0.0.0/32 is subnetted, 1 subnets
O IA    3.3.3.3 [110/3] via 12.1.1.2, 00:03:21, FastEthernet0/0
     4.0.0.0/32 is subnetted, 1 subnets
O IA    4.4.4.4 [110/4] via 12.1.1.2, 00:03:23, FastEthernet0/0
     5.0.0.0/32 is subnetted, 1 subnets
O IA    5.5.5.5 [110/3] via 12.1.1.2, 00:03:23, FastEthernet0/0
     36.0.0.0/24 is subnetted, 1 subnets
O IA    36.1.1.0 [110/3] via 12.1.1.2, 00:03:23, FastEthernet0/0
     6.0.0.0/32 is subnetted, 1 subnets
O IA    6.6.6.6 [110/4] via 12.1.1.2, 00:03:23, FastEthernet0/0
     23.0.0.0/24 is subnetted, 1 subnets
O IA    23.1.1.0 [110/2] via 12.1.1.2, 00:03:23, FastEthernet0/0
     25.0.0.0/24 is subnetted, 1 subnets
O IA    25.1.1.0 [110/2] via 12.1.1.2, 00:03:23, FastEthernet0/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, FastEthernet0/0
O*IA 0.0.0.0/0 [110/2] via 12.1.1.2, 00:03:23, FastEthernet0/0

R1的路由表沒有域外路由條目,取而代之的是一條預設路由(標紅部分)

此預設路由是由末梢區域的ABR即R2,下發的一條LSA3預設路由

 

(2)totally stub區域(以實驗的ospf area3為例)

在Stub基礎上,又阻止LSA3,即阻止LSA3、LSA4、LSA5進入totally stub區域

ABR發出一條LSA3預設路由給Stub區域內的其他路由器

在將area 1配置為特殊區域stub之前

R5的database如下:

R5#show ip ospf database 

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

                Router Link States (Area 3)

Link ID         ADV Router      Age         Seq#       Checksum Link count
2.2.2.2         2.2.2.2         1516        0x80000003 0x008E54 1
5.5.5.5         5.5.5.5         1520        0x80000003 0x00FFA3 2

                Net Link States (Area 3)

Link ID         ADV Router      Age         Seq#       Checksum
25.1.1.5        5.5.5.5         1520        0x80000002 0x008662

                Summary Net Link States (Area 3)

Link ID         ADV Router      Age         Seq#       Checksum
1.1.1.1         2.2.2.2         511         0x80000002 0x0031FC
2.2.2.2         2.2.2.2         1516        0x80000002 0x00F832
3.3.3.3         2.2.2.2         1516        0x80000002 0x00D451
4.4.4.4         2.2.2.2         1263        0x80000002 0x00B070
6.6.6.6         2.2.2.2         1021        0x80000002 0x0054C4
12.1.1.0        2.2.2.2         511         0x8000000C 0x008D8D
23.1.1.0        2.2.2.2         1516        0x80000004 0x000E0A
34.1.1.0        2.2.2.2         1267        0x80000006 0x008485
36.1.1.0        2.2.2.2         1024        0x80000006 0x006A9D

                Summary ASB Link States (Area 3)

Link ID         ADV Router      Age         Seq#       Checksum
4.4.4.4         2.2.2.2         1266        0x80000002 0x009888
6.6.6.6         2.2.2.2         1024        0x80000002 0x003CDC

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
172.16.1.1      4.4.4.4         1300        0x80000003 0x00D0FE 0
172.16.2.1      4.4.4.4         1300        0x80000003 0x00C509 0
172.16.3.1      4.4.4.4         1300        0x80000003 0x00BA13 0
192.168.1.1     6.6.6.6         1281        0x80000002 0x006AB1 0
192.168.2.1     6.6.6.6         1281        0x80000002 0x005FBB 0
192.168.3.1     6.6.6.6         1281        0x80000002 0x0054C5 0

在沒有設定特殊區域stub之前,R5會接受到LSA3、LSA 4和LSA 5(標紅部分)

其中LSA3通告的是域間路由、LSA4通告的是ASBR的位置、LSA5通告的是域外路由

 

也可以檢視R5的路由表,如下:

R5#show ip route

     34.0.0.0/24 is subnetted, 1 subnets
O IA    34.1.1.0 [110/3] via 25.1.1.2, 00:56:33, FastEthernet0/0
     1.0.0.0/32 is subnetted, 1 subnets
O IA    1.1.1.1 [110/3] via 25.1.1.2, 00:44:31, FastEthernet0/0
     2.0.0.0/32 is subnetted, 1 subnets
O IA    2.2.2.2 [110/2] via 25.1.1.2, 01:00:23, FastEthernet0/0
     3.0.0.0/32 is subnetted, 1 subnets
O IA    3.3.3.3 [110/3] via 25.1.1.2, 01:00:23, FastEthernet0/0
     4.0.0.0/32 is subnetted, 1 subnets
O IA    4.4.4.4 [110/4] via 25.1.1.2, 00:56:34, FastEthernet0/0

     5.0.0.0/32 is subnetted, 1 subnets
C       5.5.5.5 is directly connected, Loopback0
     36.0.0.0/24 is subnetted, 1 subnets
O IA    36.1.1.0 [110/3] via 25.1.1.2, 00:52:15, FastEthernet0/0
     6.0.0.0/32 is subnetted, 1 subnets
O IA    6.6.6.6 [110/4] via 25.1.1.2, 00:52:15, FastEthernet0/0
     23.0.0.0/24 is subnetted, 1 subnets
O IA    23.1.1.0 [110/2] via 25.1.1.2, 01:00:25, FastEthernet0/0

     172.16.0.0/32 is subnetted, 3 subnets
O E2    172.16.1.1 [110/20] via 25.1.1.2, 00:44:23, FastEthernet0/0
O E2    172.16.3.1 [110/20] via 25.1.1.2, 00:44:23, FastEthernet0/0
O E2    172.16.2.1 [110/20] via 25.1.1.2, 00:44:23, FastEthernet0/0

     25.0.0.0/24 is subnetted, 1 subnets
C       25.1.1.0 is directly connected, FastEthernet0/0
     12.0.0.0/24 is subnetted, 1 subnets
O IA    12.1.1.0 [110/2] via 25.1.1.2, 00:44:28, FastEthernet0/0

     192.168.1.0/32 is subnetted, 1 subnets
O E2    192.168.1.1 [110/20] via 25.1.1.2, 00:44:23, FastEthernet0/0
     192.168.2.0/32 is subnetted, 1 subnets
O E2    192.168.2.1 [110/20] via 25.1.1.2, 00:44:23, FastEthernet0/0
     192.168.3.0/32 is subnetted, 1 subnets
O E2    192.168.3.1 [110/20] via 25.1.1.2, 00:44:24, FastEthernet0/0

標藍部分為域間路由,是通過LSA 3學習到的路由條目

標紅部分為域外路由,是通過LSA 5學習到的路由條目

 

然後部署特殊區域totally stub

R1(config)#router ospf 1

R1(config-router)#area 3 stub

R2(config)#router ospf 1

R2(config-router)#area 3 stub

R2(config-router)#area 3 stub no-summary     //(只需在ABR上做)

 

當部署area1為特殊區域stub之後

R5的database如下:

R5#show ip ospf database

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

                Router Link States (Area 3)

Link ID         ADV Router      Age         Seq#       Checksum Link count
2.2.2.2         2.2.2.2         9           0x80000005 0x00A83A 1
5.5.5.5         5.5.5.5         9           0x80000005 0x001A89 2

                Net Link States (Area 3)

Link ID         ADV Router      Age         Seq#       Checksum
25.1.1.5        5.5.5.5         5           0x80000004 0x00A048

                Summary Net Link States (Area 3)

Link ID         ADV Router      Age         Seq#       Checksum
0.0.0.0         2.2.2.2         11          0x80000002 0x0073C1

R1沒有收到LSA4和LSA5的路由通告,原來的LSA3的路由通告被替換成由R2下發的預設路由

 

再看R5的路由表,如下:

R5#show ip route

     5.0.0.0/32 is subnetted, 1 subnets
C       5.5.5.5 is directly connected, Loopback0
     25.0.0.0/24 is subnetted, 1 subnets
C       25.1.1.0 is directly connected, FastEthernet0/0
O*IA 0.0.0.0/0 [110/2] via 25.1.1.2, 00:03:13, FastEthernet0/0

R1的路由表沒有域間路由條目和域外路由條目,取而代之的是一條預設路由(標紅部分)

此預設路由是由末梢區域的ABR即R2,下發的一條LSA3預設路由

 

 

(3)NSSA區域(以實驗的ospf area2為例)

作用:NSSA區域和Stub區域一樣會阻止LSA4/5

NSSA區域可以存在ASBR

ASBR(R4)會引入外部路由,但是以LSA7引入的,只有NSSA區域中才會現LSA7

NSSA區域的邊界ABR(R3)會將LSA7轉成LSA5,傳播到其他區域。這時,ABR(R3)也成為了ASBR,因為它也引入了LSA5。其它區域路由器看到LSA5的通告路由器是ABR(R3)

 

在將area 2配置為特殊區域NSSA之前

可以檢視R4的路由表,如下:

R4(config)#do show ip route

     34.0.0.0/24 is subnetted, 1 subnets
C       34.1.1.0 is directly connected, FastEthernet0/0
     1.0.0.0/32 is subnetted, 1 subnets
O IA    1.1.1.1 [110/4] via 34.1.1.3, 00:00:49, FastEthernet0/0
     2.0.0.0/32 is subnetted, 1 subnets
O IA    2.2.2.2 [110/3] via 34.1.1.3, 00:00:54, FastEthernet0/0
     3.0.0.0/32 is subnetted, 1 subnets
O IA    3.3.3.3 [110/2] via 34.1.1.3, 00:00:54, FastEthernet0/0
     4.0.0.0/32 is subnetted, 1 subnets
C       4.4.4.4 is directly connected, Loopback0
     5.0.0.0/32 is subnetted, 1 subnets
O IA    5.5.5.5 [110/4] via 34.1.1.3, 00:00:56, FastEthernet0/0
     36.0.0.0/24 is subnetted, 1 subnets
O IA    36.1.1.0 [110/2] via 34.1.1.3, 00:00:55, FastEthernet0/0
     6.0.0.0/32 is subnetted, 1 subnets
O IA    6.6.6.6 [110/3] via 34.1.1.3, 00:00:56, FastEthernet0/0
     23.0.0.0/24 is subnetted, 1 subnets
O IA    23.1.1.0 [110/2] via 34.1.1.3, 00:00:56, FastEthernet0/0
     172.16.0.0/32 is subnetted, 3 subnets
C       172.16.1.1 is directly connected, Loopback1
C       172.16.3.1 is directly connected, Loopback3
C       172.16.2.1 is directly connected, Loopback2
     25.0.0.0/24 is subnetted, 1 subnets
O IA    25.1.1.0 [110/3] via 34.1.1.3, 00:00:56, FastEthernet0/0
     12.0.0.0/24 is subnetted, 1 subnets
O IA    12.1.1.0 [110/3] via 34.1.1.3, 00:00:56, FastEthernet0/0
     192.168.1.0/32 is subnetted, 1 subnets
O E2    192.168.1.1 [110/20] via 34.1.1.3, 00:00:46, FastEthernet0/0
     192.168.2.0/32 is subnetted, 1 subnets
O E2    192.168.2.1 [110/20] via 34.1.1.3, 00:00:47, FastEthernet0/0
     192.168.3.0/32 is subnetted, 1 subnets
O E2    192.168.3.1 [110/20] via 34.1.1.3, 00:00:47, FastEthernet0/0

標紅部分為來自R6的域外路由,是通過LSA 5學習到的路由條目

 

檢視R3的路由表,如下:

R3(config)#do show ip rout

     34.0.0.0/24 is subnetted, 1 subnets
C       34.1.1.0 is directly connected, FastEthernet1/0
     1.0.0.0/32 is subnetted, 1 subnets
O IA    1.1.1.1 [110/3] via 23.1.1.2, 00:01:46, FastEthernet0/0
     2.0.0.0/32 is subnetted, 1 subnets
O       2.2.2.2 [110/2] via 23.1.1.2, 00:01:56, FastEthernet0/0
     3.0.0.0/32 is subnetted, 1 subnets
C       3.3.3.3 is directly connected, Loopback0
     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/2] via 34.1.1.4, 00:01:56, FastEthernet1/0
     5.0.0.0/32 is subnetted, 1 subnets
O IA    5.5.5.5 [110/3] via 23.1.1.2, 00:01:57, FastEthernet0/0
     36.0.0.0/24 is subnetted, 1 subnets
C       36.1.1.0 is directly connected, FastEthernet2/0
     6.0.0.0/32 is subnetted, 1 subnets
O       6.6.6.6 [110/2] via 36.1.1.6, 00:01:58, FastEthernet2/0
     23.0.0.0/24 is subnetted, 1 subnets
C       23.1.1.0 is directly connected, FastEthernet0/0
     172.16.0.0/32 is subnetted, 3 subnets
O E2    172.16.1.1 [110/20] via 34.1.1.4, 00:01:38, FastEthernet1/0
O E2    172.16.3.1 [110/20] via 34.1.1.4, 00:01:38, FastEthernet1/0
O E2    172.16.2.1 [110/20] via 34.1.1.4, 00:01:38, FastEthernet1/0

     25.0.0.0/24 is subnetted, 1 subnets
O IA    25.1.1.0 [110/2] via 23.1.1.2, 00:01:53, FastEthernet0/0
     12.0.0.0/24 is subnetted, 1 subnets
O IA    12.1.1.0 [110/2] via 23.1.1.2, 00:01:53, FastEthernet0/0
     192.168.1.0/32 is subnetted, 1 subnets
O E2    192.168.1.1 [110/20] via 36.1.1.6, 00:01:38, FastEthernet2/0
     192.168.2.0/32 is subnetted, 1 subnets
O E2    192.168.2.1 [110/20] via 36.1.1.6, 00:01:38, FastEthernet2/0
     192.168.3.0/32 is subnetted, 1 subnets
O E2    192.168.3.1 [110/20] via 36.1.1.6, 00:01:39, FastEthernet2/0

R3收到R4的域外路由是LSA 5型別的

 

然後部署特殊區域NSSA

R3(config)#router ospf 2

R3(config-router)#area 2 nssa

R4(config)#router ospf 2

R4(config-router)#area 2 nssa

注意:R1與R2都必須在ospf程序下輸入命令:area 1 nssa,

不然R1與R2建鄰居時傳送的hello包的末梢位元組不一樣,鄰居就建不起來了

 

當部署area2為特殊區域NSSA之後

R4的路由表,如下:

R4(config-router)#do show ip route

    34.0.0.0/24 is subnetted, 1 subnets
C       34.1.1.0 is directly connected, FastEthernet0/0
     1.0.0.0/32 is subnetted, 1 subnets
O IA    1.1.1.1 [110/4] via 34.1.1.3, 00:00:19, FastEthernet0/0
     2.0.0.0/32 is subnetted, 1 subnets
O IA    2.2.2.2 [110/3] via 34.1.1.3, 00:00:19, FastEthernet0/0
     3.0.0.0/32 is subnetted, 1 subnets
O IA    3.3.3.3 [110/2] via 34.1.1.3, 00:00:19, FastEthernet0/0
     4.0.0.0/32 is subnetted, 1 subnets
C       4.4.4.4 is directly connected, Loopback0
     5.0.0.0/32 is subnetted, 1 subnets
O IA    5.5.5.5 [110/4] via 34.1.1.3, 00:00:20, FastEthernet0/0
     36.0.0.0/24 is subnetted, 1 subnets
O IA    36.1.1.0 [110/2] via 34.1.1.3, 00:00:21, FastEthernet0/0
     6.0.0.0/32 is subnetted, 1 subnets
O IA    6.6.6.6 [110/3] via 34.1.1.3, 00:00:21, FastEthernet0/0
     23.0.0.0/24 is subnetted, 1 subnets
O IA    23.1.1.0 [110/2] via 34.1.1.3, 00:00:21, FastEthernet0/0
     172.16.0.0/32 is subnetted, 3 subnets
C       172.16.1.1 is directly connected, Loopback1
C       172.16.3.1 is directly connected, Loopback3
C       172.16.2.1 is directly connected, Loopback2
     25.0.0.0/24 is subnetted, 1 subnets
O IA    25.1.1.0 [110/3] via 34.1.1.3, 00:00:21, FastEthernet0/0
     12.0.0.0/24 is subnetted, 1 subnets
O IA    12.1.1.0 [110/3] via 34.1.1.3, 00:00:21, FastEthernet0/0

R1的路由表沒有域外路由條目,但是R4身上沒有被下發預設路由

這是因為NSSA不會自動下發預設路由

只需在ABR(R3)上的ospf程序下輸入命令即可

R3(config-router)#area 2 nssa default-information-originate 

 

再看R4的路由表,如下:

R4(config-router)#do 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 34.1.1.3 to network 0.0.0.0

     34.0.0.0/24 is subnetted, 1 subnets
C       34.1.1.0 is directly connected, FastEthernet0/0
     1.0.0.0/32 is subnetted, 1 subnets
O IA    1.1.1.1 [110/4] via 34.1.1.3, 00:00:04, FastEthernet0/0
     2.0.0.0/32 is subnetted, 1 subnets
O IA    2.2.2.2 [110/3] via 34.1.1.3, 00:00:04, FastEthernet0/0
     3.0.0.0/32 is subnetted, 1 subnets
O IA    3.3.3.3 [110/2] via 34.1.1.3, 00:00:04, FastEthernet0/0
     4.0.0.0/32 is subnetted, 1 subnets
C       4.4.4.4 is directly connected, Loopback0
     5.0.0.0/32 is subnetted, 1 subnets
O IA    5.5.5.5 [110/4] via 34.1.1.3, 00:00:06, FastEthernet0/0
     36.0.0.0/24 is subnetted, 1 subnets
O IA    36.1.1.0 [110/2] via 34.1.1.3, 00:00:06, FastEthernet0/0
     6.0.0.0/32 is subnetted, 1 subnets
O IA    6.6.6.6 [110/3] via 34.1.1.3, 00:00:06, FastEthernet0/0
     23.0.0.0/24 is subnetted, 1 subnets
O IA    23.1.1.0 [110/2] via 34.1.1.3, 00:00:06, FastEthernet0/0
     172.16.0.0/32 is subnetted, 3 subnets
C       172.16.1.1 is directly connected, Loopback1
C       172.16.3.1 is directly connected, Loopback3
C       172.16.2.1 is directly connected, Loopback2
     25.0.0.0/24 is subnetted, 1 subnets
O IA    25.1.1.0 [110/3] via 34.1.1.3, 00:00:07, FastEthernet0/0
     12.0.0.0/24 is subnetted, 1 subnets
O IA    12.1.1.0 [110/3] via 34.1.1.3, 00:00:07, FastEthernet0/0
O*N2 0.0.0.0/0 [110/1] via 34.1.1.3, 00:00:07, FastEthernet0/0

現在就有從ABR下發的7型預設路由了

 

然後再檢視R3的路由表

R3(config-router)#do 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 not set

     34.0.0.0/24 is subnetted, 1 subnets
C       34.1.1.0 is directly connected, FastEthernet1/0
     1.0.0.0/32 is subnetted, 1 subnets
O IA    1.1.1.1 [110/3] via 23.1.1.2, 00:01:51, FastEthernet0/0
     2.0.0.0/32 is subnetted, 1 subnets
O       2.2.2.2 [110/2] via 23.1.1.2, 00:01:51, FastEthernet0/0
     3.0.0.0/32 is subnetted, 1 subnets
C       3.3.3.3 is directly connected, Loopback0
     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/2] via 34.1.1.4, 00:01:51, FastEthernet1/0
     5.0.0.0/32 is subnetted, 1 subnets
O IA    5.5.5.5 [110/3] via 23.1.1.2, 00:01:52, FastEthernet0/0
     36.0.0.0/24 is subnetted, 1 subnets
C       36.1.1.0 is directly connected, FastEthernet2/0
     6.0.0.0/32 is subnetted, 1 subnets
O       6.6.6.6 [110/2] via 36.1.1.6, 00:01:53, FastEthernet2/0
     23.0.0.0/24 is subnetted, 1 subnets
C       23.1.1.0 is directly connected, FastEthernet0/0
     172.16.0.0/32 is subnetted, 3 subnets
O N2    172.16.1.1 [110/20] via 34.1.1.4, 00:01:53, FastEthernet1/0
O N2    172.16.3.1 [110/20] via 34.1.1.4, 00:01:53, FastEthernet1/0
O N2    172.16.2.1 [110/20] via 34.1.1.4, 00:01:53, FastEthernet1/0

     25.0.0.0/24 is subnetted, 1 subnets
O IA    25.1.1.0 [110/2] via 23.1.1.2, 00:01:53, FastEthernet0/0
     12.0.0.0/24 is subnetted, 1 subnets
O IA    12.1.1.0 [110/2] via 23.1.1.2, 00:01:53, FastEthernet0/0
     192.168.1.0/32 is subnetted, 1 subnets
O E2    192.168.1.1 [110/20] via 36.1.1.6, 00:01:53, FastEthernet2/0
     192.168.2.0/32 is subnetted, 1 subnets
O E2    192.168.2.1 [110/20] via 36.1.1.6, 00:01:53, FastEthernet2/0
     192.168.3.0/32 is subnetted, 1 subnets
O E2    192.168.3.1 [110/20] via 36.1.1.6, 00:01:54, FastEthernet2/0

可以看到從R4傳送過來的域外路由是LSA 7

R3會將LSA7轉成LSA5,傳播到其他區域,我們可以看下R2的路由表

R2#show ip rout

     34.0.0.0/24 is subnetted, 1 subnets
O IA    34.1.1.0 [110/2] via 23.1.1.3, 00:05:23, FastEthernet1/0
     1.0.0.0/32 is subnetted, 1 subnets
O       1.1.1.1 [110/2] via 12.1.1.1, 00:24:58, FastEthernet0/0
     2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback0
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/2] via 23.1.1.3, 00:22:29, FastEthernet1/0
     4.0.0.0/32 is subnetted, 1 subnets
O IA    4.4.4.4 [110/3] via 23.1.1.3, 00:05:18, FastEthernet1/0
     5.0.0.0/32 is subnetted, 1 subnets
O       5.5.5.5 [110/2] via 25.1.1.5, 00:25:10, FastEthernet2/0
     36.0.0.0/24 is subnetted, 1 subnets
O IA    36.1.1.0 [110/2] via 23.1.1.3, 00:22:31, FastEthernet1/0
     6.0.0.0/32 is subnetted, 1 subnets
O IA    6.6.6.6 [110/3] via 23.1.1.3, 00:22:31, FastEthernet1/0
     23.0.0.0/24 is subnetted, 1 subnets
C       23.1.1.0 is directly connected, FastEthernet1/0
     172.16.0.0/32 is subnetted, 3 subnets
O E2    172.16.1.1 [110/20] via 23.1.1.3, 00:05:19, FastEthernet1/0
O E2    172.16.3.1 [110/20] via 23.1.1.3, 00:05:18, FastEthernet1/0
O E2    172.16.2.1 [110/20] via 23.1.1.3, 00:05:18, FastEthernet1/0

     25.0.0.0/24 is subnetted, 1 subnets
C       25.1.1.0 is directly connected, FastEthernet2/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, FastEthernet0/0
     192.168.1.0/32 is subnetted, 1 subnets
O E2    192.168.1.1 [110/20] via 23.1.1.3, 00:05:21, FastEthernet1/0
     192.168.2.0/32 is subnetted, 1 subnets
O E2    192.168.2.1 [110/20] via 23.1.1.3, 00:05:21, FastEthernet1/0
     192.168.3.0/32 is subnetted, 1 subnets
O E2    192.168.3.1 [110/20] via 23.1.1.3, 00:05:21, FastEthernet1/0

可以看到在R2上,接收到的是LSA5

 

(3)toally NSSA區域(以實驗的ospf area4為例)

Totally NSSA,不僅能阻LSA/4/5,還能阻止LSA3,並且由ABR產生LSA3預設路由傳播到NSSA其他路由器

R2,R5部署totally NSSA與R3,R4部署NSSA的基本步驟一樣,唯一的區別是需要在ABR(R3)多輸入一條命令

R3(config-router)#area 4 nssa no-summary 

記得需要在R3給area 4 下發預設路由

當部署area4為特殊區域totally NSSA之後,可以檢視R6的路由表,如下:

R6(config-router)#do show ip route

     36.0.0.0/24 is subnetted, 1 subnets
C       36.1.1.0 is directly connected, FastEthernet0/0
     6.0.0.0/32 is subnetted, 1 subnets
C       6.6.6.6 is directly connected, Loopback0
     192.168.1.0/32 is subnetted, 1 subnets
C       192.168.1.1 is directly connected, Loopback1
     192.168.2.0/32 is subnetted, 1 subnets
C       192.168.2.1 is directly connected, Loopback2
     192.168.3.0/32 is subnetted, 1 subnets
C       192.168.3.1 is directly connected, Loopback3
O*IA 0.0.0.0/0 [110/2] via 36.1.1.3, 00:02:11, FastEthernet0/0

totally NSSA區域阻止了LSA3/4/5