It may be desirable to change the OSPF timers so that routers detect network failures in less time. Doing this increases traffic, but sometimes the need for quick convergence is more important than the extra traffic it creates.
Note: The default Hello and Dead intervals are based on best practices and should only be altered in rare situations.
OSPF Hello and Dead intervals can be modified manually using the following interface configuration mode commands:
- ip ospf hello-interval seconds
- ip ospf dead-interval seconds
Use the no ip ospf hello-interval and no ip ospf dead-interval commands to reset the intervals to their default.
The example in Figure 1 modifies the Hello interval to 5 seconds. Immediately after changing the Hello interval, the Cisco IOS automatically modifies the Dead interval to four times the Hello interval. However, it is always good practice to explicitly modify the timer instead of relying on an automatic IOS feature so that modifications are documented in the configuration. Therefore, the Dead interval is also manually set to 20 seconds on the R1 Serial 0/0/0 interface.
As displayed by the highlighted OSPFv2 adjacency message in Figure 1, when the Dead Timer on R1 expires, R1 and R2 lose adjacency. The reason is because the values have only been altered on one side of the serial link between R1 and R2. Recall that the OSPF Hello and Dead intervals must match between neighbors.
Use the show ip ospf neighbor command on R1 to verify the neighbor adjacencies, as shown in Figure 2. Notice that the only neighbor listed is the 22.214.171.124 (R3) router and that R1 is no longer adjacent with the 126.96.36.199 (R2) neighbor. The timers set on Serial 0/0/0 do not affect the neighbor adjacency with R3.
To restore adjacency between R1 and R2, the R2 Serial 0/0/0 interface Hello interval is set to 5 seconds, as shown in Figure 3. Almost immediately, the IOS displays a message that adjacency has been established with a state of FULL.
Verify the interface intervals using the show ip ospf interface command, as shown in Figure 4. Notice that the Hello time is 5 seconds and that the Dead Time was automatically set to 20 seconds instead of the default 40 seconds. Remember that the OSPF automatically sets the Dead interval to four times the Hello interval.