课题内容:
将 area 1 配置为stub和totally stub区域,观察链路状态数据库及路由表
将 area 2 配置为nssa和totally nssa区域,观察链路状态数据库及路由表
配置强制由R1执行7转5的动作
在R4上将环回口重分布进OSPF特殊区域2,不允许该路由信息进入骨干区域
在R2上向特殊区域2内注入默认路由,该默认路由仅仅允许在特殊区域2内存在
拓扑图:
接上回,将area 1 配置为stub和totally stub区域
Stub:
R5(config)#router ospf 110
R5(config-router)#area 1 stub
R3(config)#router ospf 110
R3(config-router)#area 1 stub
观察链路状态数据库及路由表
R5#show ip route ospf | begin Gateway
Gateway of last resort is 10.1.35.3 to network 0.0.0.0
O*IA 0.0.0.0/0 [110/11] via 10.1.35.3, 00:00:23, Ethernet0/3
10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
O IA 10.1.1.1/32 [110/74] via 10.1.35.3, 00:00:23, Ethernet0/3
O IA 10.1.1.3/32 [110/10] via 10.1.35.3, 00:00:23, Ethernet0/3
O IA 10.1.1.4/32 [110/74] via 10.1.35.3, 00:00:23, Ethernet0/3
O IA 10.1.124.0/24 [110/84] via 10.1.35.3, 00:00:23, Ethernet0/3
172.16.0.0/32 is subnetted, 5 subnets
O IA 172.16.1.1 [110/75] via 10.1.35.3, 00:00:23, Ethernet0/3
O IA 172.16.1.2 [110/85] via 10.1.35.3, 00:00:23, Ethernet0/3
O IA 172.16.1.3 [110/11] via 10.1.35.3, 00:00:23, Ethernet0/3
O IA 172.16.1.4 [110/75] via 10.1.35.3, 00:00:23, Ethernet0/3
// R5上没有收到来自R2重分布进OSPF的外部路由 //
证明了 stub区域是不允许五类LSA进入的;
收到了一个来自ABR生成的三类LSA,内容为一条默认路由的链路状态;
Totally Stub:
R3(config)#router ospf 110
R3(config-router)#area 1 stub no-summary
验证:
R5#show ip route ospf | begin Gateway
Gateway of last resort is 10.1.35.3 to network 0.0.0.0
O*IA 0.0.0.0/0 [110/11] via 10.1.35.3, 00:00:15, Ethernet0/3
// area 1 的区域内路由器在刚才的基础之上,路由器再次精简了,其中OSPF的路由只剩下一条默认了;
将 area 2 配置为nssa和totally nssa区域
Nssa:
R2(config)#router ospf 110
R2(config-router)#area 2 nssa
R1(config)#router ospf 110
R1(config-router)#area 2 nssa
R4(config)#router ospf 110
R4(config-router)#area 2 nssa
验证:
R2#show ip ospf database | begin Type-7
Type-7 AS External Link States (Area 2)
Link ID ADV Router Age Seq# Checksum Tag
10.2.0.0 172.16.1.2 57 0x80000001 0x0059B4 0
R2#show ip ospf database nssa-external
OSPF Router with ID (172.16.1.2) (Process ID 110)
Type-7 AS External Link States (Area 2)
LS age: 87
Options: (No TOS-capability, Type 7/5 translation, DC, Upward)
LS Type: AS External Link
Link State ID: 10.2.0.0 (External Network Number )
Advertising Router: 172.16.1.2
LS Seq Number: 80000001
Checksum: 0x59B4
Length: 36
Network Mask: /22
Metric Type: 2 (Larger than any link state path)
MTID: 0
Metric: 20
Forward Address: 172.16.1.2
External Route Tag: 0
转发地址字段,选举自ASBR设备上最大的环回口IP地址;
R1#show ip route ospf | include O N
O N2 10.2.0.0/22 [110/20] via 10.1.124.2, 00:03:17, Ethernet0/1
R3#show ip route ospf | include O E
O E2 10.2.0.0/22 [110/20] via 10.1.1.4, 00:03:47, Serial1/2
R3#show ip ospf database external
OSPF Router with ID (172.16.1.3) (Process ID 110)
Type-5 AS External Link States
Routing Bit Set on this LSA in topology Base with MTID 0
LS age: 253
Options: (No TOS-capability, DC, Upward)
LS Type: AS External Link
Link State ID: 10.2.0.0 (External Network Number )
Advertising Router: 172.16.1.4
LS Seq Number: 80000001
Checksum: 0xE134
Length: 36
Network Mask: /22
Metric Type: 2 (Larger than any link state path)
MTID: 0
Metric: 20
Forward Address: 172.16.1.2
External Route Tag: 0
//转发地址在nssa区域注入进来的外部路由中有重要意义,标识出了真实的ASBR究竟在哪里 //
Totally NSSA:
R1(config)#router ospf 110
R1(config-router)#area 2 nssa no-summary
R4(config)#router ospf 110
R4(config-router)#area 2 nssa no-summary
验证:
R2#show ip route ospf | begin Gateway
Gateway of last resort is 10.1.124.4 to network 0.0.0.0
O*IA 0.0.0.0/0 [110/11] via 10.1.124.4, 00:00:22, Ethernet0/2
[110/11] via 10.1.124.1, 00:00:39, Ethernet0/2
10.0.0.0/8 is variably subnetted, 11 subnets, 3 masks
O 10.2.0.0/22 is a summary, 00:09:16, Null0
R2#show ip ospf database database-summary
OSPF Router with ID (172.16.1.2) (Process ID 110)
Area 2 database summary
LSA Type Count Delete Maxage
Router 3 0 0
Network 1 0 0
Summary Net 2 0 0
Summary ASBR 0 0 0
Type-7 Ext 1 0 0
Prefixes redistributed in Type-7 1
Opaque Link 0 0 0
Opaque Area 0 0 0
Subtotal 7 0 0
Process 110 database summary
LSA Type Count Delete Maxage
Router 3 0 0
Network 1 0 0
Summary Net 2 0 0
Summary ASBR 0 0 0
Type-7 Ext 1 0 0
Opaque Link 0 0 0
Opaque Area 0 0 0
Type-5 Ext 0 0 0
Prefixes redistributed in Type-5 0
Opaque AS 0 0 0
Non-self 5
Total 7 0 0
// R2作为Totally NSSA区域的区域内路由器,LSDB已经进行了必要的精简和瘦身 //
配置强制由R1执行7转5的动作
R1#show run | s r o
router ospf 110
area 2 nssa translate type7 always
R3#show ip ospf database | begin Type-5
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
10.2.0.0 172.16.1.1 24 0x80000001 0x00F325 0
在R4上将环回口重分布进OSPF特殊区域2,不允许该路由信息进入骨干区域
R4(config)#interface loopback 1
R4(config-if)#ip address 10.4.1.1 255.255.255.255
R4(config)#router ospf 110
R4(config-router)#redistribute connected nssa-only subnets
验证:
R4#show ip ospf database nssa-external self-originate
OSPF Router with ID (172.16.1.4) (Process ID 110)
Type-7 AS External Link States (Area 2)
LS age: 16
Options: (No TOS-capability, No Type 7/5 translation, DC, Upward)
LS Type: AS External Link
Link State ID: 10.4.1.1 (External Network Number )
Advertising Router: 172.16.1.4
LS Seq Number: 80000001
Checksum: 0x527A
Length: 36
Network Mask: /32
Metric Type: 2 (Larger than any link state path)
MTID: 0
Metric: 20
Forward Address: 0.0.0.0
External Route Tag: 0
// 注意:红字标识,标识该LSA不允许被执行 七转五的操作 //
因此,除了区域2之外,其它区域均无法收到该外部路由;
在R2上向特殊区域2内注入默认路由,该默认路由仅仅允许在特殊区域2内存在
R2(config-router)#area 2 nssa default-information-originate nssa-only
// 注意,该命令与参数仅仅在本地已经有一条默认路由的情况下才生效,能够在本地LADB中形成一条七类LSA,内容为默认路由;
R2#show ip ospf database nssa-external 0.0.0.0
OSPF Router with ID (172.16.1.2) (Process ID 110)
Type-7 AS External Link States (Area 2)
LS age: 71
Options: (No TOS-capability, No Type 7/5 translation, DC, Upward)
LS Type: AS External Link
Link State ID: 0.0.0.0 (External Network Number )
Advertising Router: 172.16.1.2
LS Seq Number: 80000001
Checksum: 0xBC75
Length: 36
Network Mask: /0
Metric Type: 2 (Larger than any link state path)
MTID: 0
Metric: 1
Forward Address: 172.16.1.2
External Route Tag: 0
一旦特殊区域与骨干区域失联,则会失去ABR,这时本区域的所有设备即可通过这条备用的默认路由出去;
谢谢大家!