在配置步骤三中,我们将 Area 1 配置为 NSSA Area,我们观察一下配置后的路由表、lsdb效果:
R5
[R5]dis ip ro
Routing Tables: Public
Destinations : 13 Routes : 13
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/0 O_NSSA 150 1 2.2.2.1 S0/6/3 生成一条默认路由
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 区域间的路由、三类LSA生成的路由
3.3.3.2/32 O_NSSA 150 1 2.2.2.1 S0/6/3 七类LSA生成的路由
4.4.4.0/30 OSPF 10 4686 2.2.2.1 S0/6/3 区域间的路由、三类LSA生成的路由
6.6.6.6/32 Direct 0 0 127.0.0.1 InLoop0
7.7.7.7/32 O_NSSA 150 1 2.2.2.1 S0/6/3 七类LSA生成的路由
10.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
10.1.1.2/32 O_NSSA 150 1 2.2.2.1 S0/6/3 七类LSA生成的路由
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
如上表,区域0、区域2的互连地址是三类LSA生成的路由
而8.8.8.8、9.9.9.8并没有学到,同时10.1.1.3 10.1.1.4也没有学到,为什么呢?因为是区域外路由,请看如下的LSDB表
[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 353 48 80000002 0
Router 10.1.1.1 10.1.1.1 356 48 80000002 0
Sum-Net 3.3.3.0 10.1.1.2 354 28 80000001 1562
Sum-Net 4.4.4.0 10.1.1.2 354 28 80000001 3124
NSSA 6.6.6.6 10.1.1.1 391 36 80000001 1
NSSA 2.2.2.1 10.1.1.1 391 36 80000001 1
NSSA 2.2.2.0 10.1.1.1 391 36 80000001 1
NSSA 10.1.1.1 10.1.1.1 391 36 80000001 1
NSSA 0.0.0.0 10.1.1.2 358 36 80000001 1
NSSA 7.7.7.7 10.1.1.2 358 36 80000001 1
NSSA 3.3.3.0 10.1.1.2 358 36 80000001 1
NSSA 3.3.3.2 10.1.1.2 358 36 80000001 1
NSSA 2.2.2.0 10.1.1.2 358 36 80000001 1
NSSA 2.2.2.2 10.1.1.2 358 36 80000001 1
NSSA 10.1.1.2 10.1.1.2 358 36 80000001 1
如上表,并没有学到8.8.8.8、9.9.9.8、10.1.1.3 10.1.1.4的lsa,所以并不能学到,但是能不能ping通呢??
<R5>ping 8.8.8.8
PING 8.8.8.8: 56 data bytes, press CTRL_C to break
Reply from 8.8.8.8: bytes=56 Sequence=1 ttl=254 time=4 ms
Reply from 8.8.8.8: bytes=56 Sequence=2 ttl=254 time=26 ms
Request time out
Reply from 8.8.8.8: bytes=56 Sequence=4 ttl=254 time=10 ms
Reply from 8.8.8.8: bytes=56 Sequence=5 ttl=254 time=10 ms
--- 8.8.8.8 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 4/12/26 ms
<R5>ping 9.9.9.9
PING 9.9.9.9: 56 data bytes, press CTRL_C to break
Reply from 9.9.9.9: bytes=56 Sequence=1 ttl=253 time=20 ms
Reply from 9.9.9.9: bytes=56 Sequence=2 ttl=253 time=1 ms
Reply from 9.9.9.9: bytes=56 Sequence=3 ttl=253 time=5 ms
Reply from 9.9.9.9: bytes=56 Sequence=4 ttl=253 time=1 ms
Reply from 9.9.9.9: bytes=56 Sequence=5 ttl=253 time=10 ms
--- 9.9.9.9 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/7/20 ms
<R5>
<R5>ping 10.1.1.3
PING 10.1.1.3: 56 data bytes, press CTRL_C to break
Reply from 10.1.1.3: bytes=56 Sequence=1 ttl=254 time=25 ms
Reply from 10.1.1.3: bytes=56 Sequence=2 ttl=254 time=15 ms
Reply from 10.1.1.3: bytes=56 Sequence=3 ttl=254 time=5 ms
Request time out
Request time out
--- 10.1.1.3 ping statistics ---
5 packet(s) transmitted
3 packet(s) received
40.00% packet loss
round-trip min/avg/max = 5/15/25 ms
<R5>ping 10.1.1.4
PING 10.1.1.4: 56 data bytes, press CTRL_C to break
Reply from 10.1.1.4: bytes=56 Sequence=1 ttl=253 time=20 ms
Reply from 10.1.1.4: bytes=56 Sequence=2 ttl=253 time=25 ms
Reply from 10.1.1.4: bytes=56 Sequence=3 ttl=253 time=15 ms
Reply from 10.1.1.4: bytes=56 Sequence=4 ttl=253 time=4 ms
Reply from 10.1.1.4: bytes=56 Sequence=5 ttl=253 time=4 ms
--- 10.1.1.4 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 4/13/25 ms
<R5>
R1
[R1]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_NSSA 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_NSSA 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 2 48 80000005 0
Router 10.1.1.2 10.1.1.2 1686 48 80000003 0
Sum-Net 4.4.4.0 10.1.1.3 322 28 80000002 1562
Sum-Net 2.2.2.0 10.1.1.2 263 28 80000001 1562
Sum-Asbr 10.1.1.4 10.1.1.3 6 28 80000002 1562
Area: 0.0.0.1
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.1.1.2 10.1.1.2 262 48 80000002 0
Router 10.1.1.1 10.1.1.1 268 48 80000002 0
Sum-Net 3.3.3.0 10.1.1.2 263 28 80000001 1562
Sum-Net 4.4.4.0 10.1.1.2 263 28 80000001 3124
NSSA 0.0.0.0 10.1.1.2 268 36 80000001 1
NSSA 7.7.7.7 10.1.1.2 268 36 80000001 1
NSSA 3.3.3.0 10.1.1.2 268 36 80000001 1
NSSA 3.3.3.2 10.1.1.2 268 36 80000001 1
NSSA 2.2.2.0 10.1.1.2 268 36 80000001 1
NSSA 2.2.2.2 10.1.1.2 268 36 80000001 1
NSSA 10.1.1.2 10.1.1.2 268 36 80000001 1
NSSA 6.6.6.6 10.1.1.1 304 36 80000001 1
NSSA 2.2.2.1 10.1.1.1 304 36 80000001 1
NSSA 2.2.2.0 10.1.1.1 304 36 80000001 1
NSSA 10.1.1.1 10.1.1.1 304 36 80000001 1
AS External Database
Type LinkState ID AdvRouter Age Len Sequence Metric
External 7.7.7.7 10.1.1.2 269 36 80000002 1
External 6.6.6.6 10.1.1.2 258 36 80000001 1
External 3.3.3.0 10.1.1.2 269 36 80000002 1
External 3.3.3.2 10.1.1.2 269 36 80000002 1
External 2.2.2.1 10.1.1.2 258 36 80000001 1
External 2.2.2.0 10.1.1.2 269 36 80000002 1
External 2.2.2.2 10.1.1.2 269 36 80000002 1
External 10.1.1.1 10.1.1.2 258 36 80000001 1
External 10.1.1.2 10.1.1.2 269 36 80000002 1
External 6.6.6.6 10.1.1.1 1680 36 80000001 1
External 9.9.9.9 10.1.1.4 10 36 80000002 1
External 8.8.8.8 10.1.1.3 1703 36 80000001 1
External 4.4.4.1 10.1.1.4 10 36 80000002 1
External 4.4.4.0 10.1.1.4 10 36 80000002 1
External 4.4.4.0 10.1.1.3 1703 36 80000001 1
External 4.4.4.2 10.1.1.3 1703 36 80000001 1
External 3.3.3.1 10.1.1.3 3 36 80000002 1
External 3.3.3.0 10.1.1.3 3 36 80000002 1
External 2.2.2.1 10.1.1.1 1680 36 80000001 1
External 2.2.2.0 10.1.1.1 1680 36 80000001 1
External 10.1.1.4 10.1.1.4 6 36 80000002 1
External 10.1.1.1 10.1.1.1 1680 36 80000001 1
External 10.1.1.3 10.1.1.3 3 36 80000002 1
第四步
R4
[R4]
[R4]dis ip ro
Routing Tables: Public
Destinations : 12 Routes : 12
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/0 OSPF 10 1563 4.4.4.1 S0/6/1
3.3.3.0/30 O_NSSA 150 1 4.4.4.1 S0/6/1
3.3.3.1/32 O_NSSA 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
8.8.8.8/32 O_NSSA 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.3/32 O_NSSA 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
与NSSA区域相对比,此时的路由表中少了三类LSA产生的路由表(除去一条默认路由是三类LSA产生的)
同样没有学习到引入的区域外路由,6.6.6.6 7.7.7.7 10.1.1.1 10.1.1.2
<R4>ping 6.6.6.6
PING 6.6.6.6: 56 data bytes, press CTRL_C to break
Reply from 6.6.6.6: bytes=56 Sequence=1 ttl=253 time=26 ms
Reply from 6.6.6.6: bytes=56 Sequence=2 ttl=253 time=10 ms
Reply from 6.6.6.6: bytes=56 Sequence=3 ttl=253 time=1 ms
Reply from 6.6.6.6: bytes=56 Sequence=4 ttl=253 time=10 ms
Reply from 6.6.6.6: bytes=56 Sequence=5 ttl=253 time=1 ms
--- 6.6.6.6 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/9/26 ms
<R4>ping 7.7.7.7
PING 7.7.7.7: 56 data bytes, press CTRL_C to break
Reply from 7.7.7.7: bytes=56 Sequence=1 ttl=254 time=10 ms
Reply from 7.7.7.7: bytes=56 Sequence=2 ttl=254 time=1 ms
Reply from 7.7.7.7: bytes=56 Sequence=3 ttl=254 time=5 ms
Reply from 7.7.7.7: bytes=56 Sequence=4 ttl=254 time=4 ms
Reply from 7.7.7.7: bytes=56 Sequence=5 ttl=254 time=10 ms
--- 7.7.7.7 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/6/10 ms
<R4>ping 10.1.1.1
PING 10.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 10.1.1.1: bytes=56 Sequence=1 ttl=253 time=20 ms
Reply from 10.1.1.1: bytes=56 Sequence=2 ttl=253 time=26 ms
Reply from 10.1.1.1: bytes=56 Sequence=3 ttl=253 time=20 ms
Request time out
Reply from 10.1.1.1: bytes=56 Sequence=5 ttl=253 time=1 ms
--- 10.1.1.1 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 1/16/26 ms
<R4>ping 10.1.1.2
PING 10.1.1.2: 56 data bytes, press CTRL_C to break
Reply from 10.1.1.2: bytes=56 Sequence=1 ttl=254 time=4 ms
Reply from 10.1.1.2: bytes=56 Sequence=2 ttl=254 time=4 ms
Reply from 10.1.1.2: bytes=56 Sequence=3 ttl=254 time=26 ms
Reply from 10.1.1.2: bytes=56 Sequence=4 ttl=254 time=10 ms
Reply from 10.1.1.2: bytes=56 Sequence=5 ttl=254 time=1 ms
--- 10.1.1.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/9/26 ms
[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 16 48 80000002 0
Router 10.1.1.3 10.1.1.3 17 48 80000002 0
Sum-Net 0.0.0.0 10.1.1.3 22 28 80000001 1
NSSA 9.9.9.9 10.1.1.4 73 36 80000001 1
NSSA 4.4.4.1 10.1.1.4 73 36 80000001 1
NSSA 4.4.4.0 10.1.1.4 73 36 80000001 1
NSSA 10.1.1.4 10.1.1.4 73 36 80000001 1
NSSA 0.0.0.0 10.1.1.3 22 36 80000001 1
NSSA 8.8.8.8 10.1.1.3 22 36 80000001 1
NSSA 4.4.4.0 10.1.1.3 22 36 80000001 1
NSSA 4.4.4.2 10.1.1.3 22 36 80000001 1
NSSA 3.3.3.1 10.1.1.3 22 36 80000001 1
NSSA 3.3.3.0 10.1.1.3 22 36 80000001 1
NSSA 10.1.1.3 10.1.1.3 22 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_NSSA 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_NSSA 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 486 48 80000005 0
Router 10.1.1.2 10.1.1.2 470 48 80000004 0
Sum-Net 4.4.4.0 10.1.1.3 143 28 80000001 1562
Sum-Net 2.2.2.0 10.1.1.2 750 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 144 48 80000002 0
Router 10.1.1.3 10.1.1.3 143 48 80000002 0
Sum-Net 0.0.0.0 10.1.1.3 148 28 80000001 1
NSSA 0.0.0.0 10.1.1.3 148 36 80000001 1
NSSA 8.8.8.8 10.1.1.3 148 36 80000001 1
NSSA 4.4.4.0 10.1.1.3 148 36 80000001 1
NSSA 4.4.4.2 10.1.1.3 148 36 80000001 1
NSSA 3.3.3.1 10.1.1.3 148 36 80000001 1
NSSA 3.3.3.0 10.1.1.3 148 36 80000001 1
NSSA 10.1.1.3 10.1.1.3 148 36 80000001 1
NSSA 9.9.9.9 10.1.1.4 201 36 80000001 1
NSSA 4.4.4.1 10.1.1.4 201 36 80000001 1
NSSA 4.4.4.0 10.1.1.4 202 36 80000001 1
NSSA 10.1.1.4 10.1.1.4 202 36 80000001 1
AS External Database
Type LinkState ID AdvRouter Age Len Sequence Metric
External 9.9.9.9 10.1.1.3 139 36 80000001 1
External 8.8.8.8 10.1.1.3 149 36 80000003 1
External 4.4.4.1 10.1.1.3 139 36 80000001 1
External 4.4.4.0 10.1.1.3 149 36 80000003 1
External 4.4.4.2 10.1.1.3 149 36 80000003 1
External 3.3.3.1 10.1.1.3 149 36 80000003 1
External 3.3.3.0 10.1.1.3 149 36 80000003 1
External 10.1.1.4 10.1.1.3 139 36 80000001 1
External 10.1.1.3 10.1.1.3 149 36 80000003 1
External 7.7.7.7 10.1.1.2 756 36 80000002 1
External 6.6.6.6 10.1.1.1 2166 36 80000001 1
External 6.6.6.6 10.1.1.2 745 36 80000001 1
External 9.9.9.9 10.1.1.4 494 36 80000002 1
External 4.4.4.1 10.1.1.4 494 36 80000002 1
External 4.4.4.0 10.1.1.4 494 36 80000002 1
External 3.3.3.0 10.1.1.2 756 36 80000002 1
External 3.3.3.2 10.1.1.2 756 36 80000002 1
External 2.2.2.1 10.1.1.1 2166 36 80000001 1
External 2.2.2.1 10.1.1.2 745 36 80000001 1
External 2.2.2.0 10.1.1.2 756 36 80000002 1
External 2.2.2.0 10.1.1.1 2166 36 80000001 1
External 2.2.2.2 10.1.1.2 756 36 80000002 1
External 10.1.1.4 10.1.1.4 490 36 80000002 1
External 10.1.1.1 10.1.1.1 2166 36 80000001 1
External 10.1.1.1 10.1.1.2 746 36 80000001 1
External 10.1.1.2 10.1.1.2 757 36 80000002 1
NSSA 实际是 Stub 区域的扩展,它与 Stub 区域有许多相似之处。配置 NSSA 区域时,也需
要注意:
骨干区域不能配置成 NSSA区域;
NSSA区域不能用作传输区域,即,虚连接不能穿过 NSSA 区域;
如果要将一个区域配置成 NSSA区域,则该区域中的所有路由器都必须配置此属性;
与 Stub 区域的一个不同是:NSSA区域内可以存在 ASBR。
参数 default-route-advertise 用来产生发布缺省路由的 Type-7 LSA,这个参数只能用于 NSSA
的 ASBR 或ABR:
在NSSA的ABR上配置时,不论系统的路由表中是否存在缺省路由0.0.0.0,都会产生Type-7
LSA缺省路由;
在 NSSA的 ASBR 上配置时,只有当路由表中存在缺省路由 0.0.0.0,才会产生 Type-7 LSA
缺省路由。
附加实验:
1、在第三步中,如果r5和r1两边都在区域下只配置nssa这一条命令,则在R5上看就没有一条缺省路由,ping区域间的Ip就ping通,所以加一条default-route-advertise命令是很有必要的。