OSPF末节和完全末节区域
末节区域要求:
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
1 末节区域不能是area 0
2 末节区域里不能有ASBR,因为ASBR要注入外部路由
3 末节 区域里不能做virtual-link的传递区域
末节区域的特点:
不接受OSPF外部的路由信息
在ABR上会生成默认路由来代替OSFP外部路由,且该默认路由的cost可以用area area-id default-cost cost来修改
当我们在ABR上加no-summary参数的时候末节区域就变成完全末节区域了,完全末节区域是cisco专有的,在完全末节区域里不接受OSPF外部路由和其他area 的路由,而这些路由都会被ABR上自动生成的一条默认路由取代。
有一种特殊的情况是:该区域有1个以上的ABR,但是我们还是想把该区域设置成末节区域,问题出现了,因为每个ABR都会产生默认路由并注入到区域内,默认情况下这样区域内的路由器在去往外部网络时可能会选择到非最优的ABR作为出口,这种情况,我们可以根据实际网路拓扑来手动改变默认路由的metric来控制。
查看ospf 两个常用show 就是show ip ospf 和 show ip ospf int
实验场景1:
<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" />
![](https://i-blog.csdnimg.cn/blog_migrate/81b59d6c6200e30ec9bd034e53be5efa.jpeg)
实验目的:
学会配置OSPF的stub区域,并掌握stub 区域的特点
要把一个区域设置成stub区域,要在区域内所有的路由器上都要配置
area area-id stub,因为若一边配置一边不配置的话OSPF邻居关系无法建立起来。
配置成末节区域之后,ABR也既R2会往stub区域里注入一条默认路由,我们可以通过如下方式查看
R2#sh ip ospf
Routing Process "ospf 1" with ID <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />2.2.2.2
Supports only single TOS(TOS0) routes
Supports opaque LSA
Supports Link-local Signaling (LLS)
It is an area border router
Initial SPF schedule delay 5000 msecs
Minimum hold time between two consecutive SPFs 10000 msecs
Maximum wait time between two consecutive SPFs 10000 msecs
Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs
LSA group pacing timer 240 secs
Interface flood pacing timer 33 msecs
Retransmission pacing timer 66 msecs
Number of external LSA 1. Checksum Sum 0x00A5F3
Number of opaque AS LSA 0. Checksum Sum 0x000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 2. 1 normal 1 stub 0 nssa
External flood list length 0
Area BACKBONE(0)
Number of interfaces in this area is 1
Area has no authentication
SPF algorithm last executed 00:10:38.328 ago
SPF algorithm executed 5 times
Area ranges are
Number of LSA 4. Checksum Sum 0x014970
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
Area 1
Number of interfaces in this area is 2
It is a stub area
generates stub default route with cost 1 //可以看到有一条默认路由,默认cost为1
Area has no authentication
SPF algorithm last executed 00:05:25.400 ago
SPF algorithm executed 12 times
Area ranges are
Number of LSA 6. Checksum Sum 0x02832A
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
R3#sh 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 192.168.2.1 to network 0.0.0.0
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/65] via 192.168.3.2, 00:00:06, Serial1/1
O 192.168.4.0/24 [110/65] via 192.168.3.2, 00:00:06, Serial1/1
[110/65] via 192.168.2.1, 00:00:06, Serial1/0
O IA 192.168.1.0/24 [110/128] via 192.168.2.1, 00:00:06, Serial1/0
C 192.168.2.0/24 is directly connected, Serial1/0
C 192.168.3.0/24 is directly connected, Serial1/1
O*IA 0.0.0.0/0 [110/65] via 192.168.2.1, 00:00:06, Serial1/0
接下来我们的目的是改变R2(ABR)向stub区域注入的默认路由的初始cost(默认是1)
方法是在OSPF进程下启用area area-id default-cost cost
R2上
R2(config)#router ospf 1
R2(config-router)#area 1 default-cost 20
R2(config-router)#end
R2#sh ip ospf
Routing Process "ospf 1" with ID 2.2.2.2
Supports only single TOS(TOS0) routes
Supports opaque LSA
Supports Link-local Signaling (LLS)
It is an area border router
Initial SPF schedule delay 5000 msecs
Minimum hold time between two consecutive SPFs 10000 msecs
Maximum wait time between two consecutive SPFs 10000 msecs
Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs
LSA group pacing timer 240 secs
Interface flood pacing timer 33 msecs
Retransmission pacing timer 66 msecs
Number of external LSA 1. Checksum Sum 0x00A5F3
Number of opaque AS LSA 0. Checksum Sum 0x000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 2. 1 normal 1 stub 0 nssa
External flood list length 0
Area BACKBONE(0)
Number of interfaces in this area is 1
Area has no authentication
SPF algorithm last executed 00:18:15.296 ago
SPF algorithm executed 5 times
Area ranges are
Number of LSA 7. Checksum Sum 0x024504
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
Area 1
Number of interfaces in this area is 2
It is a stub area
generates stub default route with cost 20
Area has no authentication
SPF algorithm last executed 00:06:41.832 ago
SPF algorithm executed 14 times
Area ranges are
Number of LSA 6. Checksum Sum 0x020E81
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
R3#sh 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 192.168.2.1 to network 0.0.0.0
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/65] via 192.168.3.2, 00:06:58, Serial1/1
O 192.168.4.0/24 [110/65] via 192.168.3.2, 00:06:58, Serial1/1
[110/65] via 192.168.2.1, 00:06:58, Serial1/0
O IA 192.168.1.0/24 [110/128] via 192.168.2.1, 00:06:58, Serial1/0
C 192.168.2.0/24 is directly connected, Serial1/0
C 192.168.3.0/24 is directly connected, Serial1/1
O*IA 0.0.0.0/0 [110/84] via 192.168.2.1, 00:01:52, Serial1/0
转载于:https://blog.51cto.com/diamonder/284799