【理论准备】
【配置步骤】
⑴
见实验一基本 OSPF 实验中 Router A、Router B、Router C、Router D 的最终配置文件。
⑵ 路由引入配置:
R5:
[R5]int loop 1
[R5-LoopBack1]ip add 6.6.6.1 32
[R5-LoopBack1]quit
[R5]ospf
[R5-ospf-1]import-route direct
R1:
[R1]int loop 1
[R1-LoopBack1]ip add 7.7.7.1 32
[R1-LoopBack1]quit
[R1]ospf
[R5B-ospf-1]import-route direct
R2:
[R2]int loop 1
[R2-LoopBack1]ip add 8.8.8.1 32
[R2-LoopBack1]quit
[R2]ospf
[R2-ospf-1]import-route direct
R4:
[R4]int loop 1
[R4-LoopBack1]ip add 9.9.9.1 32
[R4-LoopBack1]quit
[R4]ospf
[R4-ospf-1]import-route direct
⑶ NSSA 区域配置
R5:
[R5]ospf
[R5-ospf-1]area 1
[R5-ospf-1-area-0.0.0.1]nssa
R1:
[R1]ospf
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1] nssa default-route-advertise
⑷完全 NSSA区域配置
R2:
[R2]ospf
[R2-ospf-1]area 2
[R2-ospf-1-area-0.0.0.2] nssa default-route-advertise no-summary
R4:
[R4]ospf
[R4-ospf-1]area 2
[R4-ospf-1-area-0.0.0.2]nssa no-summary
【测试以上配置】
⑴ 配置步骤一后的测试:
所有的路由器最终都学习到了全网的路由。
⑵ 配置步骤二后的测试:
第 OSPF 中,在四台路由器中,
应能看到 3条引入的外部路由和一条直连路由,分别是:6.6.6.0/24、7.7.7.0/24、8.8.8.0/24
和 9.9.9.0/24;四台路由器得到的外部路由条目如下:
R5
[R5-ospf-1]dis ip ro
Routing Tables: Public
Destinations : 19 Routes : 19
Destination/Mask Proto Pre Cost NextHop Interface
2.2.2.0/30 Direct 0 0 2.2.2.2 S0/6/3
2.2.2.1/32 Direct 0 0 2.2.2.1 S0/6/3
2.2.2.2/32 Direct 0 0 127.0.0.1 InLoop0
3.3.3.0/30 OSPF 10 3124 2.2.2.1 S0/6/3
3.3.3.1/32 O_ASE 150 1 2.2.2.1 S0/6/3
3.3.3.2/32 O_ASE 150 1 2.2.2.1 S0/6/3
4.4.4.0/30 OSPF 10 4686 2.2.2.1 S0/6/3
4.4.4.1/32 O_ASE 150 1 2.2.2.1 S0/6/3
4.4.4.2/32 O_ASE 150 1 2.2.2.1 S0/6/3
6.6.6.6/32 Direct 0 0 127.0.0.1 InLoop0
7.7.7.7/32 O_ASE 150 1 2.2.2.1 S0/6/3
8.8.8.8/32 O_ASE 150 1 2.2.2.1 S0/6/3
9.9.9.9/32 O_ASE 150 1 2.2.2.1 S0/6/3
10.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
10.1.1.2/32 O_ASE 150 1 2.2.2.1 S0/6/3
10.1.1.3/32 O_ASE 150 1 2.2.2.1 S0/6/3
10.1.1.4/32 O_ASE 150 1 2.2.2.1 S0/6/3
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
[R5]dis ospf lsdb
OSPF Process 1 with Router ID 10.1.1.1
Link State Database
Area: 0.0.0.1
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.1.1.2 10.1.1.2 199 48 80000003 0
Router 10.1.1.1 10.1.1.1 190 48 80000006 0
Sum-Net 3.3.3.0 10.1.1.2 519 28 80000001 1562
Sum-Net 4.4.4.0 10.1.1.2 519 28 80000001 3124
Sum-Asbr 10.1.1.4 10.1.1.2 221 28 80000001 3124
Sum-Asbr 10.1.1.3 10.1.1.2 210 28 80000001 1562
AS External Database
Type LinkState ID AdvRouter Age Len Sequence Metric
External 6.6.6.6 10.1.1.1 190 36 80000001 1
External 2.2.2.1 10.1.1.1 190 36 80000001 1
External 2.2.2.0 10.1.1.1 190 36 80000001 1
External 10.1.1.1 10.1.1.1 190 36 80000001 1
External 7.7.7.7 10.1.1.2 199 36 80000001 1
External 9.9.9.9 10.1.1.4 228 36 80000001 1
External 8.8.8.8 10.1.1.3 216 36 80000001 1
External 4.4.4.1 10.1.1.4 228 36 80000001 1
External 4.4.4.0 10.1.1.4 228 36 80000001 1
External 4.4.4.0 10.1.1.3 216 36 80000001 1
External 4.4.4.2 10.1.1.3 216 36 80000001 1
External 3.3.3.1 10.1.1.3 216 36 80000001 1
External 3.3.3.0 10.1.1.3 216 36 80000001 1
External 3.3.3.0 10.1.1.2 199 36 80000001 1
External 3.3.3.2 10.1.1.2 199 36 80000001 1
External 2.2.2.0 10.1.1.2 199 36 80000001 1
External 2.2.2.2 10.1.1.2 199 36 80000001 1
External 10.1.1.4 10.1.1.4 228 36 80000001 1
External 10.1.1.3 10.1.1.3 216 36 80000001 1
External 10.1.1.2 10.1.1.2 199 36 80000001 1
R1
[R1-ospf-1]dis ip ro
Routing Tables: Public
Destinations : 19 Routes : 19
Destination/Mask Proto Pre Cost NextHop Interface
2.2.2.0/30 Direct 0 0 2.2.2.1 S0/6/3
2.2.2.1/32 Direct 0 0 127.0.0.1 InLoop0
2.2.2.2/32 Direct 0 0 2.2.2.2 S0/6/3
3.3.3.0/30 Direct 0 0 3.3.3.1 S0/6/0
3.3.3.1/32 Direct 0 0 127.0.0.1 InLoop0
3.3.3.2/32 Direct 0 0 3.3.3.2 S0/6/0
4.4.4.0/30 OSPF 10 3124 3.3.3.2 S0/6/0
4.4.4.1/32 O_ASE 150 1 3.3.3.2 S0/6/0
4.4.4.2/32 O_ASE 150 1 3.3.3.2 S0/6/0
6.6.6.6/32 O_ASE 150 1 2.2.2.2 S0/6/3
7.7.7.7/32 Direct 0 0 127.0.0.1 InLoop0
8.8.8.8/32 O_ASE 150 1 3.3.3.2 S0/6/0
9.9.9.9/32 O_ASE 150 1 3.3.3.2 S0/6/0
10.1.1.1/32 O_ASE 150 1 2.2.2.2 S0/6/3
10.1.1.2/32 Direct 0 0 127.0.0.1 InLoop0
10.1.1.3/32 O_ASE 150 1 3.3.3.2 S0/6/0
10.1.1.4/32 O_ASE 150 1 3.3.3.2 S0/6/0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
[R1]
[R1]dis ospf lsdb
OSPF Process 1 with Router ID 10.1.1.2
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.1.1.3 10.1.1.3 226 48 80000004 0
Router 10.1.1.2 10.1.1.2 210 48 80000003 0
Sum-Net 4.4.4.0 10.1.1.3 549 28 80000001 1562
Sum-Net 2.2.2.0 10.1.1.2 530 28 80000001 1562
Sum-Asbr 10.1.1.4 10.1.1.3 232 28 80000001 1562
Sum-Asbr 10.1.1.1 10.1.1.2 197 28 80000001 1562
Area: 0.0.0.1
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.1.1.2 10.1.1.2 210 48 80000003 0
Router 10.1.1.1 10.1.1.1 203 48 80000006 0
Sum-Net 3.3.3.0 10.1.1.2 530 28 80000001 1562
Sum-Net 4.4.4.0 10.1.1.2 530 28 80000001 3124
Sum-Asbr 10.1.1.4 10.1.1.2 231 28 80000001 3124
Sum-Asbr 10.1.1.3 10.1.1.2 220 28 80000001 1562
AS External Database
Type LinkState ID AdvRouter Age Len Sequence Metric
External 7.7.7.7 10.1.1.2 210 36 80000001 1
External 3.3.3.0 10.1.1.2 210 36 80000001 1
External 3.3.3.2 10.1.1.2 210 36 80000001 1
External 2.2.2.0 10.1.1.2 210 36 80000001 1
External 2.2.2.2 10.1.1.2 210 36 80000001 1
External 10.1.1.2 10.1.1.2 210 36 80000001 1
External 6.6.6.6 10.1.1.1 203 36 80000001 1
External 9.9.9.9 10.1.1.4 238 36 80000001 1
External 8.8.8.8 10.1.1.3 226 36 80000001 1
External 4.4.4.1 10.1.1.4 238 36 80000001 1
External 4.4.4.0 10.1.1.4 238 36 80000001 1
External 4.4.4.0 10.1.1.3 226 36 80000001 1
External 4.4.4.2 10.1.1.3 226 36 80000001 1
External 3.3.3.1 10.1.1.3 226 36 80000001 1
External 3.3.3.0 10.1.1.3 226 36 80000001 1
External 2.2.2.1 10.1.1.1 203 36 80000001 1
External 2.2.2.0 10.1.1.1 203 36 80000001 1
External 10.1.1.4 10.1.1.4 238 36 80000001 1
External 10.1.1.1 10.1.1.1 203 36 80000001 1
External 10.1.1.3 10.1.1.3 226 36 80000001 1
R2
[R2]dis ip ro
Routing Tables: Public
Destinations : 19 Routes : 19
Destination/Mask Proto Pre Cost NextHop Interface
2.2.2.0/30 OSPF 10 3124 3.3.3.1 S0/6/0
2.2.2.1/32 O_ASE 150 1 3.3.3.1 S0/6/0
2.2.2.2/32 O_ASE 150 1 3.3.3.1 S0/6/0
3.3.3.0/30 Direct 0 0 3.3.3.2 S0/6/0
3.3.3.1/32 Direct 0 0 3.3.3.1 S0/6/0
3.3.3.2/32 Direct 0 0 127.0.0.1 InLoop0
4.4.4.0/30 Direct 0 0 4.4.4.1 S0/6/1
4.4.4.1/32 Direct 0 0 127.0.0.1 InLoop0
4.4.4.2/32 Direct 0 0 4.4.4.2 S0/6/1
6.6.6.6/32 O_ASE 150 1 3.3.3.1 S0/6/0
7.7.7.7/32 O_ASE 150 1 3.3.3.1 S0/6/0
8.8.8.8/32 Direct 0 0 127.0.0.1 InLoop0
9.9.9.9/32 O_ASE 150 1 4.4.4.2 S0/6/1
10.1.1.1/32 O_ASE 150 1 3.3.3.1 S0/6/0
10.1.1.2/32 O_ASE 150 1 3.3.3.1 S0/6/0
10.1.1.3/32 Direct 0 0 127.0.0.1 InLoop0
10.1.1.4/32 O_ASE 150 1 4.4.4.2 S0/6/1
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
[R2]dis ospf lsdb
OSPF Process 1 with Router ID 10.1.1.3
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.1.1.3 10.1.1.3 236 48 80000004 0
Router 10.1.1.2 10.1.1.2 222 48 80000003 0
Sum-Net 4.4.4.0 10.1.1.3 559 28 80000001 1562
Sum-Net 2.2.2.0 10.1.1.2 543 28 80000001 1562
Sum-Asbr 10.1.1.4 10.1.1.3 242 28 80000001 1562
Sum-Asbr 10.1.1.1 10.1.1.2 209 28 80000001 1562
Area: 0.0.0.2
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.1.1.4 10.1.1.4 248 48 80000006 0
Router 10.1.1.3 10.1.1.3 236 48 80000003 0
Sum-Net 3.3.3.0 10.1.1.3 559 28 80000001 1562
Sum-Net 2.2.2.0 10.1.1.3 542 28 80000001 3124
Sum-Asbr 10.1.1.2 10.1.1.3 216 28 80000001 1562
Sum-Asbr 10.1.1.1 10.1.1.3 208 28 80000001 3124
AS External Database
Type LinkState ID AdvRouter Age Len Sequence Metric
External 8.8.8.8 10.1.1.3 236 36 80000001 1
External 4.4.4.0 10.1.1.3 236 36 80000001 1
External 4.4.4.2 10.1.1.3 236 36 80000001 1
External 3.3.3.1 10.1.1.3 236 36 80000001 1
External 3.3.3.0 10.1.1.3 236 36 80000001 1
External 10.1.1.3 10.1.1.3 236 36 80000001 1
External 7.7.7.7 10.1.1.2 222 36 80000001 1
External 6.6.6.6 10.1.1.1 215 36 80000001 1
External 9.9.9.9 10.1.1.4 248 36 80000001 1
External 4.4.4.1 10.1.1.4 248 36 80000001 1
External 4.4.4.0 10.1.1.4 248 36 80000001 1
External 3.3.3.0 10.1.1.2 222 36 80000001 1
External 3.3.3.2 10.1.1.2 222 36 80000001 1
External 2.2.2.1 10.1.1.1 215 36 80000001 1
External 2.2.2.0 10.1.1.2 222 36 80000001 1
External 2.2.2.0 10.1.1.1 215 36 80000001 1
External 2.2.2.2 10.1.1.2 222 36 80000001 1
External 10.1.1.4 10.1.1.4 248 36 80000001 1
External 10.1.1.1 10.1.1.1 215 36 80000001 1
External 10.1.1.2 10.1.1.2 222 36 80000001 1
R4
[R4]dis ip ro
Routing Tables: Public
Destinations : 19 Routes : 19
Destination/Mask Proto Pre Cost NextHop Interface
2.2.2.0/30 OSPF 10 4686 4.4.4.1 S0/6/1
2.2.2.1/32 O_ASE 150 1 4.4.4.1 S0/6/1
2.2.2.2/32 O_ASE 150 1 4.4.4.1 S0/6/1
3.3.3.0/30 OSPF 10 3124 4.4.4.1 S0/6/1
3.3.3.1/32 O_ASE 150 1 4.4.4.1 S0/6/1
3.3.3.2/32 O_ASE 150 1 4.4.4.1 S0/6/1
4.4.4.0/30 Direct 0 0 4.4.4.2 S0/6/1
4.4.4.1/32 Direct 0 0 4.4.4.1 S0/6/1
4.4.4.2/32 Direct 0 0 127.0.0.1 InLoop0
6.6.6.6/32 O_ASE 150 1 4.4.4.1 S0/6/1
7.7.7.7/32 O_ASE 150 1 4.4.4.1 S0/6/1
8.8.8.8/32 O_ASE 150 1 4.4.4.1 S0/6/1
9.9.9.9/32 Direct 0 0 127.0.0.1 InLoop0
10.1.1.1/32 O_ASE 150 1 4.4.4.1 S0/6/1
10.1.1.2/32 O_ASE 150 1 4.4.4.1 S0/6/1
10.1.1.3/32 O_ASE 150 1 4.4.4.1 S0/6/1
10.1.1.4/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
[R4]
[R4]dis ospf lsdb
OSPF Process 1 with Router ID 10.1.1.4
Link State Database
Area: 0.0.0.2
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.1.1.4 10.1.1.4 276 48 80000006 0
Router 10.1.1.3 10.1.1.3 266 48 80000003 0
Sum-Net 3.3.3.0 10.1.1.3 589 28 80000001 1562
Sum-Net 2.2.2.0 10.1.1.3 571 28 80000001 3124
Sum-Asbr 10.1.1.2 10.1.1.3 245 28 80000001 1562
Sum-Asbr 10.1.1.1 10.1.1.3 238 28 80000001 3124
AS External Database
Type LinkState ID AdvRouter Age Len Sequence Metric
External 9.9.9.9 10.1.1.4 276 36 80000001 1
External 4.4.4.1 10.1.1.4 276 36 80000001 1
External 4.4.4.0 10.1.1.4 276 36 80000001 1
External 10.1.1.4 10.1.1.4 276 36 80000001 1
External 7.7.7.7 10.1.1.2 251 36 80000001 1
External 6.6.6.6 10.1.1.1 245 36 80000001 1
External 8.8.8.8 10.1.1.3 266 36 80000001 1
External 4.4.4.0 10.1.1.3 266 36 80000001 1
External 4.4.4.2 10.1.1.3 266 36 80000001 1
External 3.3.3.1 10.1.1.3 266 36 80000001 1
External 3.3.3.0 10.1.1.3 266 36 80000001 1
External 3.3.3.0 10.1.1.2 251 36 80000001 1
External 3.3.3.2 10.1.1.2 251 36 80000001 1
External 2.2.2.1 10.1.1.1 245 36 80000001 1
External 2.2.2.0 10.1.1.2 251 36 80000001 1
External 2.2.2.0 10.1.1.1 245 36 80000001 1
External 2.2.2.2 10.1.1.2 251 36 80000001 1
External 10.1.1.1 10.1.1.1 245 36 80000001 1
External 10.1.1.3 10.1.1.3 266 36 80000001 1
External 10.1.1.2 10.1.1.2 251 36 80000001 1