OSPF的LSA分组和特殊区域 归纳总结

   ①LSA的六种重要分组

Type

LSA类别        

携带信息        

传播范围        

通告路由器

Link State ID        

LSA 1

Router LSA        

域内路由

本区域内        

区域内每台路由器

扫描二维码关注公众号,回复: 4209922 查看本文章

始发路由器的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

猜你喜欢

转载自blog.csdn.net/Mr_Bei/article/details/83716437