OSPF特殊区域

版权声明: https://blog.csdn.net/Breeze_CAT/article/details/79748417

OSPF特殊区域

Stub末节区域

OSPF的stub标识的区域成为stub末节区域,在此区域内,过滤外部来的LSA-4和LSA-5,即stub区域不接受自治系统外部的路由信息,若需要路由到自治系统外部网络,需要通过默认路由(0.0.0.0)来实现,在stub区域内不存在ASBR(过滤了LSA-5)。

配置命令:area 1 stub(需要在区域内的路由器全部配置)
配置成功后,ABR会自动下放默认路由,若有一个或多个ABR的时候,可能有多条默认路由,根据cost值优先选路。
区域0 不可以配置stub标识。
Stub区域不能有虚链路穿过。

Stub配置演示

这里写图片描述
我们用上面拓扑图为例,我们将区域1配置为stub
在R1上配置:

R1>en
R1#conf t
R1(config)#int lo 0
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#exi
R1(config)#int lo 1
R1(config-if)#ip add 10.1.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#exi
R1(config)#int f0/0
R1(config-if)#ip add 12.1.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#exi
R1(config)#router eigrp 90
R1(config-router)#no au
R1(config-router)#net 10.1.1.1 0.0.0.255 
R1(config-router)#net 1.1.1.1 0.0.0.255
R1(config-router)#exi
R1(config)#router os 100
R1(config-router)#router-id 1.1.1.1
R1(config-router)#net 12.1.1.1 0.0.0.255 a 1
R1(config-router)#exi

在R2上配置:

R2>en
R2#conf t
R2(config)#int lo 0
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#exi
R2(config)#int f0/0
R2(config-if)#ip add 12.1.1.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#exi
R2(config)#int f0/1
R2(config-if)#ip add 23.1.1.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#exi
R2(config)#router os 100
R2(config-router)#router-id 2.2.2.2
R2(config-router)#net 12.1.1.2 0.0.0.255 a 1
R2(config-router)#net 23.1.1.2 0.0.0.255 a 0
R2(config-router)#net 2.2.2.2 0.0.0.255 a 1
R2(config-router)#exi

在R3上配置:

R3>en
R3#conf t
R3(config)#int lo 0
R3(config-if)#ip add 3.3.3.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#exi
R3(config)#int f0/1
R3(config-if)#ip add 23.1.1.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#exi
R3(config)#int f0/0
R3(config-if)#ip add 34.1.1.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#exi
R3(config)#router os 100
R3(config-router)#router-id 3.3.3.3
R3(config-router)#net 23.1.1.3 0.0.0.255 a 0
R3(config-router)#net 3.3.3.3 0.0.0.255 a 0
R3(config-router)#net 34.1.1.3 0.0.0.255 a 2   
R3(config-router)#exi

在R4上配置:

R4>en
R4#conf t
R4(config)#int lo 0
R4(config-if)#ip add 4.4.4.4 255.255.255.0
R4(config-if)#no sh
R4(config-if)#exi
R4(config)#int f0/0
R4(config-if)#ip add 34.1.1.4 255.255.255.0
R4(config-if)#no sh
R4(config-if)#exi
R4(config)#int lo 1
R4(config-if)#ip add 40.1.1.1 255.255.255.0
R4(config-if)#no sh
R4(config-if)#exi
R4(config)#router os 100
R4(config-router)#router-id 4.4.4.4
R4(config-router)#net 34.1.1.4 0.0.0.255 a 2
R4(config-router)#exi
R4(config)#router rip 
R4(config-router)#v 2 
R4(config-router)#no au
R4(config-router)#net 4.4.4.0
R4(config-router)#net 40.1.1.0
R4(config-router)#exi

我们在R1和R4上进行重分发:

R1(config)#router os 100
R1(config-router)#redistribute eigrp 90 subnets 
R1(config-router)#exi
R1(config)#router ei 90
R1(config-router)#redistribute ospf 100 metric 1000 10 255 1 1000
R1(config-router)#exi
R4(config)#router os 100
R4(config-router)#redistribute rip subnets 
R4(config-router)#exi
R4(config)#router rip 
R4(config-router)#redistribute ospf 1
R4(config-router)#exi

接下来我们在R1和R2上查看一下路由表:

R1(config)#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
O IA    34.1.1.0 [110/30] via 12.1.1.2, 00:01:47, FastEthernet0/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       2.2.2.2 [110/11] via 12.1.1.2, 00:01:47, FastEthernet0/0
     3.0.0.0/32 is subnetted, 1 subnets
O IA    3.3.3.3 [110/21] via 12.1.1.2, 00:01:47, FastEthernet0/0
     4.0.0.0/24 is subnetted, 1 subnets
O E2    4.4.4.0 [110/20] via 12.1.1.2, 00:00:33, FastEthernet0/0
     23.0.0.0/24 is subnetted, 1 subnets
O IA    23.1.1.0 [110/20] via 12.1.1.2, 00:01:49, FastEthernet0/0
     40.0.0.0/24 is subnetted, 1 subnets
O E2    40.1.1.0 [110/20] via 12.1.1.2, 00:00:35, FastEthernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Loopback1
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, FastEthernet0/0
R2(config)#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
O IA    34.1.1.0 [110/20] via 23.1.1.3, 00:01:58, FastEthernet0/1
     1.0.0.0/24 is subnetted, 1 subnets
O E2    1.1.1.0 [110/20] via 12.1.1.1, 00:00:44, FastEthernet0/0
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback0
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/11] via 23.1.1.3, 00:02:45, FastEthernet0/1
     4.0.0.0/24 is subnetted, 1 subnets
O E2    4.4.4.0 [110/20] via 23.1.1.3, 00:00:44, FastEthernet0/1
     23.0.0.0/24 is subnetted, 1 subnets
C       23.1.1.0 is directly connected, FastEthernet0/1
     40.0.0.0/24 is subnetted, 1 subnets
O E2    40.1.1.0 [110/20] via 23.1.1.3, 00:00:47, FastEthernet0/1
     10.0.0.0/24 is subnetted, 1 subnets
O E2    10.1.1.0 [110/20] via 12.1.1.1, 00:00:48, FastEthernet0/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, FastEthernet0/0

ok和预期一样,接下来进行stub区域的配置,我们将区域1配置为stub:

R1(config)#router os 100
R1(config-router)#area 1 stub
R2(config)#router os 100
R2(config-router)#ar 1 st

稍等一下等收敛完成后我们再查看一下路由表

R1(config)#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 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/30] via 12.1.1.2, 00:00:01, FastEthernet0/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       2.2.2.2 [110/11] via 12.1.1.2, 00:00:01, FastEthernet0/0
     3.0.0.0/32 is subnetted, 1 subnets
O IA    3.3.3.3 [110/21] via 12.1.1.2, 00:00:01, FastEthernet0/0
     23.0.0.0/24 is subnetted, 1 subnets
O IA    23.1.1.0 [110/20] via 12.1.1.2, 00:00:03, FastEthernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Loopback1
     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/11] via 12.1.1.2, 00:00:05, FastEthernet0/0
R2#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
O IA    34.1.1.0 [110/20] via 23.1.1.3, 00:01:09, FastEthernet0/1
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback0
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/11] via 23.1.1.3, 00:01:24, FastEthernet0/1
     4.0.0.0/24 is subnetted, 1 subnets
O E2    4.4.4.0 [110/20] via 23.1.1.3, 00:01:09, FastEthernet0/1
     23.0.0.0/24 is subnetted, 1 subnets
C       23.1.1.0 is directly connected, FastEthernet0/1
     40.0.0.0/24 is subnetted, 1 subnets
O E2    40.1.1.0 [110/20] via 23.1.1.3, 00:01:12, FastEthernet0/1
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, FastEthernet0/0

我们可以看见,Area 1配置为stub区域之后,所有的外部路由都传不进来了,R2丢失了通过R1去往EIGRP区域的路由,R1丢失了R2传过来的去往RIP的路由,但由于R2是ABR,会给R1一条去往自己的默认路由。由于R2不只是在一个区域之中,所以并不会丢失区域0接收到的去往RIP的路由。

Totally-Stub完全末节区域

OSPF的完全末节区域是思科私有的,过滤LSA-3、LSA-4、LSA-5三个LSA,也就是说不只是自治系统外部的路由,就连自治系统内部其他区域的路由也同样不接受。如果完全末节区域内想要路由至完全末节区域外的话也需要通过默认路由(0.0.0.0)来实现。
配置命令:area 1 stub no-summary(只需要在ABR上配置即可)
配置成后,ABR会自动下放默认路由。

Totally-Stub完全末节区域的配置

我们还是用刚才的拓扑图,也是将区域1配置为Totally-Stub:
在R2上进行配置就可以了:

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

接下来在R1和R2上查看路由表

R1#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 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
     2.0.0.0/32 is subnetted, 1 subnets
O       2.2.2.2 [110/11] via 12.1.1.2, 00:02:04, FastEthernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Loopback1
     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/11] via 12.1.1.2, 00:00:06, FastEthernet0/0
R2#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
O IA    34.1.1.0 [110/20] via 23.1.1.3, 00:00:48, FastEthernet0/1
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback0
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/11] via 23.1.1.3, 00:00:48, FastEthernet0/1
     4.0.0.0/24 is subnetted, 1 subnets
O E2    4.4.4.0 [110/20] via 23.1.1.3, 00:00:48, FastEthernet0/1
     23.0.0.0/24 is subnetted, 1 subnets
C       23.1.1.0 is directly connected, FastEthernet0/1
     40.0.0.0/24 is subnetted, 1 subnets
O E2    40.1.1.0 [110/20] via 23.1.1.3, 00:00:50, FastEthernet0/1
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, FastEthernet0/0

和stub类似,R1不只是失去了OE2的路由,并且失去了OIA的路由,但同样的,它获得了自己的ABR下发的一条默认路由。同时R2也失去了去往EIGRP区域的路由,但没有失去区域0收到的去往RIP的路由。

NSSA Not-So-Stubby-Area

OSPF的NSSA区域是一个在Stub区域的基础上有一些微小的变化,它过滤LSA-4和LSA-5并且允许有ASBR。向NSSA中重分发会产生LSA-7,这类LSA只存在NSSA中,并且只有NSSA的ASBR会产生LSA-7,在NSSA中需要在ABR上进行配置才会下放默认路由。
配置命令:area 1 nssa default-information-originate
这里写图片描述
在上面拓扑图中,Area2被配置成了NSSA区域,在NSSA区域内的R4设备接收到的R1EIGRP部分的重分发会被标记为N2,而R3接收到R4重分发的RIPV2的路由条目也会被标记为N2,但R1和R2接收到的RIPV2的路由确实E2标记,这里涉及到“NSSA中的ABR会进行一个叫做七转五的操作,将LSA-7转换为LSA-5”所以在这个拓扑中R3就是进行七转五的ABR,所以在R1和R2上面观察到的RIPV2的ASBR是R3。

NSSA的配置

我们就用刚才的拓扑图,先将Area1还原,再将Area2配置为NSSA区域:

R1(config)#router os 100
R1(config-router)#no area 1 stub
R2(config)#router os 100
R2(config-router)#no ar 1 st no
R2(config-router)#no ar 1 st   
R2(config-router)#exi

NSSA配置:

R3(config)#router os 100
R3(config-router)#ar 2 nssa
R4(config)#router os 100
R4(config-router)#ar 2 nssa

接下来我们在R3和R4上查看路由表:

R4#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, FastEthernet0/0
     2.0.0.0/32 is subnetted, 1 subnets
O IA    2.2.2.2 [110/21] via 34.1.1.3, 00:02:16, FastEthernet0/0
     3.0.0.0/32 is subnetted, 1 subnets
O IA    3.3.3.3 [110/11] via 34.1.1.3, 00:02:16, FastEthernet0/0
     4.0.0.0/24 is subnetted, 1 subnets
C       4.4.4.0 is directly connected, Loopback0
     23.0.0.0/24 is subnetted, 1 subnets
O IA    23.1.1.0 [110/20] via 34.1.1.3, 00:02:16, FastEthernet0/0
     40.0.0.0/24 is subnetted, 1 subnets
C       40.1.1.0 is directly connected, Loopback1
     12.0.0.0/24 is subnetted, 1 subnets
O IA    12.1.1.0 [110/30] via 34.1.1.3, 00:02:20, FastEthernet0/0

Nssa区域会过滤LSA-4和LSA-5但允许拥有ASBR,所以在R4上看路由表,它失去了去往EIGRP区域的路由,但由于直连的关系,并没有失去RIP区域的路由,而且在我们没有配置之前,R4上并没有自动下放的默认路由。然后在R3上查看路由表:

R3#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, FastEthernet0/0
     1.0.0.0/24 is subnetted, 1 subnets
O E2    1.1.1.0 [110/20] via 23.1.1.2, 00:02:47, FastEthernet0/1
     2.0.0.0/32 is subnetted, 1 subnets
O IA    2.2.2.2 [110/11] via 23.1.1.2, 00:02:47, FastEthernet0/1
     3.0.0.0/24 is subnetted, 1 subnets
C       3.3.3.0 is directly connected, Loopback0
     4.0.0.0/24 is subnetted, 1 subnets
O N2    4.4.4.0 [110/20] via 34.1.1.4, 00:02:47, FastEthernet0/0
     23.0.0.0/24 is subnetted, 1 subnets
C       23.1.1.0 is directly connected, FastEthernet0/1
     40.0.0.0/24 is subnetted, 1 subnets
O N2    40.1.1.0 [110/20] via 34.1.1.4, 00:02:51, FastEthernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
O E2    10.1.1.0 [110/20] via 23.1.1.2, 00:02:52, FastEthernet0/1
     12.0.0.0/24 is subnetted, 1 subnets
O IA    12.1.1.0 [110/20] via 23.1.1.2, 00:02:53, FastEthernet0/1

再R3上查看路由表,我们会发现,由于R3不只是属于一个区域,所以并没有失去OE2的去往EIGRP区域的路由,但却多了两条标记为ON2的去往RIP区域的路由,这是由于nssa区域允许存在ASBR,而NSSA区域的ASBR宣告的外部路由会被标记为ASBR,但我们上面介绍过,ON2这种标记只存在于NSSA区域,当这种外部路由发往其他区域的时候,会在ABR上进行一种叫做七转五的操作,在这张拓扑图中,进行七转五的就是R3。所以我们预测不差的话, 在R1上查看路由表,依旧会看见标记为OE2的去往RIP区域的路由。那么下面我们来验证一下:

R1#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
O IA    34.1.1.0 [110/30] via 12.1.1.2, 00:10:59, FastEthernet0/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       2.2.2.2 [110/11] via 12.1.1.2, 00:10:59, FastEthernet0/0
     3.0.0.0/32 is subnetted, 1 subnets
O IA    3.3.3.3 [110/21] via 12.1.1.2, 00:10:59, FastEthernet0/0
     4.0.0.0/24 is subnetted, 1 subnets
O E2    4.4.4.0 [110/20] via 12.1.1.2, 00:08:55, FastEthernet0/0
     23.0.0.0/24 is subnetted, 1 subnets
O IA    23.1.1.0 [110/20] via 12.1.1.2, 00:11:01, FastEthernet0/0
     40.0.0.0/24 is subnetted, 1 subnets
O E2    40.1.1.0 [110/20] via 12.1.1.2, 00:08:58, FastEthernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Loopback1
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, FastEthernet0/0

验证正确,但我们之前说过,进行七转五的路由器,也就是发送LSA-5的路由器才能称为ASBR,那么是不是这样呢,我们在R1上查看链路状态数据库:

R1#show ip ospf database asbr-summary 

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

                Summary ASB Link States (Area 1)

  Routing Bit Set on this LSA
  LS age: 807
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(AS Boundary Router)
  Link State ID: 3.3.3.3 (AS Boundary Router address)
  Advertising Router: 2.2.2.2
  LS Seq Number: 80000001
  Checksum: 0x1905
  Length: 28
  Network Mask: /0
        TOS: 0  Metric: 10

可见,router-id为3.3.3.3的为ASBR即R3。

那么我们别忘了R4还没有默认路由呢,下面我们为R4下放默认路由(在R3上配置):

R3(config)#router os 100
R3(config-router)#ar 2 nssa default-information-originate
R4#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
     2.0.0.0/32 is subnetted, 1 subnets
O IA    2.2.2.2 [110/21] via 34.1.1.3, 00:14:40, FastEthernet0/0
     3.0.0.0/32 is subnetted, 1 subnets
O IA    3.3.3.3 [110/11] via 34.1.1.3, 00:14:40, FastEthernet0/0
     4.0.0.0/24 is subnetted, 1 subnets
C       4.4.4.0 is directly connected, Loopback0
     23.0.0.0/24 is subnetted, 1 subnets
O IA    23.1.1.0 [110/20] via 34.1.1.3, 00:14:42, FastEthernet0/0
     40.0.0.0/24 is subnetted, 1 subnets
C       40.1.1.0 is directly connected, Loopback1
     12.0.0.0/24 is subnetted, 1 subnets
O IA    12.1.1.0 [110/30] via 34.1.1.3, 00:14:42, FastEthernet0/0
O*N2 0.0.0.0/0 [110/1] via 34.1.1.3, 00:00:05, FastEthernet0/0

我们看见了标记为ON2的默认路由,NSSA下方的默认路由不标记为ON2,仔细想想也是这样,根据之前讲过的自然可以分析得出结论。

Totally-NSSA

完全NSSA区域和NSSA区域的区别是不会下放默认路由。
配置命令:area 2 nssa no-summary
过滤掉明细路由:area 2 nssa no-redistribution default-information-originate

猜你喜欢

转载自blog.csdn.net/Breeze_CAT/article/details/79748417