配置OSPF快速收敛示例
介绍OSPF快速收敛的配置过程,比如调整定时器参数和配置BFD功能。
配置注意事项
在配置过程中,需注意以下事项:
减小OSPF邻居间发送Hello报文的时间间隔、Dead、Poll和Wait定时器的值可以达到网络快速收敛的目的,但频繁的报文会增加设备负荷。另一方面,如果这些定时器的取值过大,会减慢路由的收敛速度。所以,需要根据网络的稳定性才设置合理取值,不能仅为了追求快速收敛或者提高设备性能而盲目设置定时器参数。
- 本路由器接口发送Hello报文的时间间隔、Dead、Poll定时器的时间间隔要和邻接路由器的参数保持一致,否则双方不能建立邻居。
配置思路
采用如下思路配置OSPF快速收敛特性:
在各路由器上配置OSPF基本功能,实现互连。
在各路由器上配置BFD功能。
在各路由器上调整相邻邻居的失效时间。
在各路由器上配置Smart-discover功能。
在各路由器上调整通过智能定时器控制配置更新、接收LSA,和SPF计算的时间间隔。
操作步骤
- 配置各路由器接口的IP地址(略)
- 配置OSPF基本功能(请参见配置OSPF基本功能示例)
- 在各路由器上调整相邻邻居的失效时间
# 配置DeviceA。
[~DeviceA] interface gigabitethernet 0/1/0
[*DeviceA-GigabitEthernet0/1/0] ospf timer dead 30
[*DeviceA-GigabitEthernet0/1/0] commit
运行OSPF接口上的邻居失效时间必须大于发送Hello报文的时间间隔,且同一网段上的路由器的dead interval值也必须相同。
本配置举例中,其他路由器的如下配置都与DeviceA相同,因此不再赘述。
在路由器上调整相邻邻居的失效时间。
在路由器上配置Smart-discover功能。
在路由器上调整通过智能定时器控制配置更新、接收LSA,和SPF计算的时间间隔。
- 在各路由器上配置Smart-discover功能
# 配置DeviceA。
[~DeviceA-GigabitEthernet0/1/0] ospf smart-discover
[*DeviceA-GigabitEthernet0/1/0] commit
[~DeviceA-GigabitEthernet0/1/0] quit
- 在各路由器上配置BFD功能
# 配置DeviceA。
[*DeviceA] bfd
[*DeviceA-bfd] quit
[*DeviceA] ospf
[*DeviceA-ospf-1] bfd all-interfaces enable
[*DeviceA-ospf-1] commit
[~DeviceA-ospf-1] quit
- 在各路由器上配置通过智能定时器控制配置更新、接收LSA,和SPF计算的时间间隔
# 配置DeviceA。
[~DeviceA] ospf 1
[~DeviceA-ospf-1] lsa-arrival-interval intelligent-timer 3000 200 500
[*DeviceA-ospf-1] lsa-originate-interval intelligent-timer 3000 200 500
[*DeviceA-ospf-1] spf-schedule-interval intelligent-timer 3000 200 500
[*DeviceA-ospf-1] commit
- 检查配置结果
# 在各路由器上执行display ospf brief命令,查看OSPF概要信息。以RouterA的显示为例,可以查看到各定时器的值。
[~DeviceA] display ospf brief
OSPF Process 1 with Router ID 9.9.9.9 OSPF Protocol Information RouterID: 9.9.9.9 Border Router: AREA Multi-VPN-Instance is not enabled Global DS-TE Mode: Non-Standard IETF Mode Graceful-restart capability: disabled Helper support capability : not configured OSPF Stub Router State Reason: Startup Synchronize Router LSA stub links with cost 65535 Summary LSA with cost 16777214 External LSA with cost 16777214 Applications Supported: MPLS Traffic-Engineering Spf-schedule-interval: max 10000ms, start 500ms, hold 1000ms Default ASE parameters: Metric: 1 Tag: 1 Type: 2 Route Preference: 10 ASE Route Preference: 150 Intra Route Preference: 50 Inter Route Preference: 50 SPF Computation Count: 56 RFC 1583 Compatible Retransmission limitation is disabled bfd enabled BFD Timers: Tx-Interval 10 , Rx-Interval 10 , Multiplier 3 Area Count: 2 Nssa Area Count: 0 ExChange/Loading Neighbors: 0 Area: 0.0.0.0 MPLS TE not enabled Authtype: None Area flag: Normal SPF scheduled count: 2 Exchange/Loading neighbors: 0 Router ID conflict state: Normal Interface: 1.1.1.1 (GE0/3/1) Cost: 1 State: DR Type: Broadcast MTU: 1500 Priority: 1 Designated Router: 1.1.1.1 Backup Designated Router: 0.0.0.0 Timers: Hello 10, Dead 40, Wait 40, Poll 120, Retransmit 5, Transmit Delay 1
配置文件
DeviceA的配置文件
#
sysname DeviceA
#
router id 1.1.1.1
#
bfd
#
interface GigabitEthernet0/1/0
undo shutdown
ip address 192.168.1.1 255.255.255.0
ospf timer dead 30
ospf smart-discover
#
ospf 1
bfd all-interfaces enable
spf-schedule-interval intelligent-timer 3000 200 500
lsa-arrival-interval intelligent-timer 3000 200 500
lsa-originate-interval intelligent-timer 3000 200 500
area 0.0.0.0
network 192.168.1.0 0.0.0.255
#
return
DeviceB的配置文件
#
sysname DeviceB
#
router id 2.2.2.2
#
bfd
#
interface GigabitEthernet0/1/0
undo shutdown
ip address 192.168.1.2 255.255.255.0
ospf timer dead 30
ospf smart-discover
#
ospf 1
bfd all-interfaces enable
spf-schedule-interval intelligent-timer 3000 200 500
lsa-arrival-interval intelligent-timer 3000 200 500
lsa-originate-interval intelligent-timer 3000 200 500
area 0.0.0.0
network 192.168.1.0 0.0.0.255
#
return
DeviceC的配置文件
#
sysname DeviceC
#
router id 3.3.3.3
#
bfd
#
interface GigabitEthernet0/1/0
undo shutdown
ip address 192.168.1.3 255.255.255.0
ospf timer dead 30
ospf smart-discover
#
ospf 1
bfd all-interfaces enable
spf-schedule-interval intelligent-timer 3000 200 500
lsa-arrival-interval intelligent-timer 3000 200 500
lsa-originate-interval intelligent-timer 3000 200 500
area 0.0.0.0
network 192.168.1.0 0.0.0.255
#
return
DeviceD的配置文件
#
sysname DeviceD
#
router id 4.4.4.4
#
bfd
#
interface GigabitEthernet0/1/0
undo shutdown
ip address 192.168.1.4 255.255.255.0
ospf timer dead 30
ospf smart-discover
#
ospf 1
bfd all-interfaces enable
spf-schedule-interval intelligent-timer 3000 200 500
lsa-arrival-interval intelligent-timer 3000 200 500
lsa-originate-interval intelligent-timer 3000 200 500
area 0.0.0.0
network 192.168.1.0 0.0.0.255
#
return