Logging OSPF Adjacency Changes
Problem
You want to monitor OSPF adjacency state changes to ensure network stability.
Solution
The log-adjacency-changes configuration command instructs the router to create a log message whenever two OSPF routers establish or break their adjacency relationship:
Router2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Router2(config)#router ospf
Router2(config-router)#
12
log-adjacency-changes
Router2(config-router)#exit
Router2(config)#end
Router2#
Discussion
No routes are exchanged between routers if they lose their adjacency relationship. Every time this relationship is lost, the corresponding routes are removed, and every router in the area must be updated with the new network topology. This can be quite disruptive to a network. So it can be extremely useful to log these changes for troubleshooting, as well as for reconstructing serious problems that occurred in the past. We recommend using this option.
Here are some example log messages. The first message shows that the adjacency has been lost due to an expired timer. This means that this router has not heard its neighbor’s regularly scheduled “hello” messages recently, so it needs to delete its routes. A few minutes later, the neighbor has come back and reestablished its adjacency:
Oct 14 09:54:13: %OSPF-5-ADJCHG: Process 12, Nbr 172.25.25.1 on Serial0/0 from FULL to DOWN, Neighbor Down: Dead timer expired
Oct 14 09:57:43: %OSPF-5-ADJCHG: Process 12, Nbr 172.25.25.1 on ...
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.