Adjusting OSPF Timers

Problem

You want to change the default OSPF timers to improve stability or convergence behavior.

Solution

You can improve the convergence time of OSPF on a particular interface by reducing the hello and dead timers:

Router1#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#interface Serial0/1
Router1(config-if)#ip ospf hello-interval 5
Router1(config-if)#ip ospf dead-interval 20
Router1(config-if)#exit
Router1(config)#end
Router1#

If you make this change on one router, you must make it on all of the other routers sharing the same network segment:

Router2#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router2(config)#interface Serial0/0
Router2(config-if)#ip ospf hello-interval 5
Router2(config-if)#ip ospf dead-interval 20
Router2(config-if)#exit
Router2(config)#end
Router2#

Discussion

OSPF uses two timers. The hello timer controls how often the router sends routine messages to its neighbors simply by indicating that it is still up. If the neighbors don’t hear any hello messages for a length of time defined by the dead-interval, they assume that the router is no longer reachable and drop it from the adjacency table.

The default values are 10 seconds for the hello time, and 40 seconds for the dead time. The usual rule of thumb with OSPF is to keep the dead time value four times the hello interval. However, this is not a strict rule. EIGRP, for example, uses a dead time that is only three ...

Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.