Thursday, June 26, 2014

OSPF Graceful Shutdown

Background Information

  1. Shutting down an OSPF router will black hole routes for a while until the network converges.
    1. Neighbor routers have to determine that the router is dead.  This could take as long as whatever the hold-time is set to.
    2. Then, the routers have to flood LSAs to the entire OSPF network.
    3. Then, the routers have to run SPF again and install the routes.
    4. While all this is going on, traffic may still be routed towards the dead router.

Summary

  1. On the router that is going to be shut down, issue max-metric router-lsa.
  2. The router will immediately flood LSAs with a maximum metric, causing all the other routers to rerun SPF and find a better route to the destination.
  3. Give it a minute to complete.
  4. You can verify the max metrics on the other routers with show ip ospf database router adv.
  5. You can now shut down the router without blackholing OSPF routes.
  6. Issuing a no max-metric router-lsa will cause the router to immediately flood LSAs with its normal metrics.
router ospf 1
  max-metric router-lsa