OSPF  Stub area & Totally stub

一、      实验目的

1、         stubtotally stub区域存在的条件。

2、         它们会对哪几类LSA进行过滤。

3、         它们存在的好处

二、      实验拓扑

三、      Stub区域实验

首先将RIP重发布到area 2 内。查看R1的路由表和OSPF 数据库。

R1(config-router)#do show ip rout

Gateway of last resort is not set

     34.0.0.0/24 is subnetted, 1 subnets

O IA    34.1.1.0 [110/192] via 12.1.1.2, 00:09:33, Serial0/0

     1.0.0.0/24 is subnetted, 1 subnets

C       1.1.1.0 is directly connected, Loopback0

     2.0.0.0/32 is subnetted, 1 subnets

O IA    2.2.2.2 [110/65] via 12.1.1.2, 00:09:33, Serial0/0

     3.0.0.0/32 is subnetted, 1 subnets

O IA    3.3.3.3 [110/129] via 12.1.1.2, 00:09:33, Serial0/0

     4.0.0.0/32 is subnetted, 1 subnets

O IA    4.4.4.4 [110/193] via 12.1.1.2, 00:09:33, Serial0/0

     5.0.0.0/24 is subnetted, 1 subnets

O E1    5.5.5.0 [110/202] via 12.1.1.2, 00:00:05, Serial0/0

     23.0.0.0/24 is subnetted, 1 subnets

O IA    23.1.1.0 [110/128] via 12.1.1.2, 00:09:34, Serial0/0

     12.0.0.0/24 is subnetted, 1 subnets

C       12.1.1.0 is directly connected, Serial0/0

     45.0.0.0/24 is subnetted, 1 subnets

O E1    45.1.1.0 [110/202] via 12.1.1.2, 00:00:06, Serial0/0

 

R1(config-router)#do 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         618         0x80000008 0x005DFD 3

2.2.2.2         2.2.2.2         619         0x80000008 0x008CDD 2

                Summary Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum

2.2.2.2         2.2.2.2         645         0x80000004 0x00F434

3.3.3.3         2.2.2.2         645         0x80000004 0x00499B

4.4.4.4         2.2.2.2         645         0x80000004 0x009D03

23.1.1.0        2.2.2.2         645         0x80000004 0x008652

34.1.1.0        2.2.2.2         645         0x80000004 0x007914

                Summary ASB Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum

4.4.4.4         2.2.2.2         102         0x80000001 0x008B18

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag

5.5.5.0         4.4.4.4         38          0x80000001 0x00D239 0

45.1.1.0        4.4.4.4         40          0x80000001 0x0025C6 0

R1上存在着345LSA.

再将area 1设置成stub 区域,查看路由表和OSPF数据库。

 R1(config-router)#do show ip rout

Gateway of last resort is 12.1.1.2 to network 0.0.0.0

     34.0.0.0/24 is subnetted, 1 subnets

O IA    34.1.1.0 [110/192] via 12.1.1.2, 00:00:01, Serial0/0

     1.0.0.0/24 is subnetted, 1 subnets

C       1.1.1.0 is directly connected, Loopback0

     2.0.0.0/32 is subnetted, 1 subnets

O IA    2.2.2.2 [110/65] via 12.1.1.2, 00:00:01, Serial0/0

     3.0.0.0/32 is subnetted, 1 subnets

O IA    3.3.3.3 [110/129] via 12.1.1.2, 00:00:01, Serial0/0

     4.0.0.0/32 is subnetted, 1 subnets

O IA    4.4.4.4 [110/193] via 12.1.1.2, 00:00:01, Serial0/0

     23.0.0.0/24 is subnetted, 1 subnets

O IA    23.1.1.0 [110/128] via 12.1.1.2, 00:00:01, Serial0/0

     12.0.0.0/24 is subnetted, 1 subnets

C       12.1.1.0 is directly connected, Serial0/0

O*IA 0.0.0.0/0 [110/65] via 12.1.1.2, 00:00:03, Serial0/0

R1(config-router)#do show ip ospf da

            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         27          0x8000000F 0x006DE8 3

2.2.2.2         2.2.2.2         27          0x8000000F 0x009CC8 2

                Summary Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum

0.0.0.0         2.2.2.2         42          0x80000001 0x0075C0

2.2.2.2         2.2.2.2         42          0x80000008 0x000B1C

3.3.3.3         2.2.2.2         42          0x80000008 0x005F83

4.4.4.4         2.2.2.2         42          0x80000008 0x00B3EA

23.1.1.0        2.2.2.2         42          0x80000008 0x009C3A

34.1.1.0        2.2.2.2         42          0x80000008 0x008FFB

      和原有路由表相比,多出了一条O*IA(三类的默认路由)的路由条目,而没有了O E1的路由(由5LSA学到的路由)。注意它的cost [110/65]默认下放的cost值是1,可以通过 area 1 default-cost ….修改。如果区域1中有两台ABR可以能过此命令实现选路。在配制stub区域时区域内的所有路由器都要配制成stub区域。

和原有OSPF数据库相比,没有了4类和5LSA,而是在3类中多出了0.0.0.0         2.2.2.2         42          0x80000001 0x0075C0 一条3类默认路由。

四、      totally stub

在路由表中即有区域内的明细路由还有默认路由,很显然是重复的。

Area 1设置成Totally stub 区域。

R2(config-router)#area 1 stub no-summary

注意这条命令只在ABR上输入。因为是由ABR来完成过滤。

查看R1的路由表

R1#show ip rout

Gateway of last resort is 12.1.1.2 to network 0.0.0.0

     1.0.0.0/24 is subnetted, 1 subnets

C       1.1.1.0 is directly connected, Loopback0

     12.0.0.0/24 is subnetted, 1 subnets

C       12.1.1.0 is directly connected, Serial0/0

O*IA 0.0.0.0/0 [110/65] via 12.1.1.2, 00:03:11, Serial0/0

再查看R1OSPF数据库

R1#show ip ospf da

            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         392         0x80000004 0x005011 3

2.2.2.2         2.2.2.2         303         0x80000006 0x00AEBF 2

                Summary Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum

0.0.0.0         2.2.2.2         311         0x80000001 0x0075C0

stub区域的路由表和OSPF数据相比没有了34类和5类的LSA.取而代之的是一条三类默认路由。

                             作用                                是否下放默认路由

Stub                     过滤4类和5LSA              是(LSA3Seed cost = 1

           Totally stub           过滤345LSA           是(LSA3Seed cost = 1

Totally stub cisco私有协议。通过对两种区域的对比可以发现如果要将某一区域划成Stub区域,不如直接划成Totally stub区域。