SDN/SDDC Retreat in Miami, Florida (November 4th-6th)
Separate SDN hype from real life!

Fast static route convergence

A few days ago I’ve received a cryptic e-mail with exactly this content: “I am having a issue "static routes not flushed when next hop is unreachable" please advice.” I suspected that the sender actually wanted to ask me what to do if a static route pointing to an IP next-hop does not disappear when the next hop becomes unreachable and told him to adjust the ip route static adjust-time parameter while monitoring the CPU usage.

The reason for this suggestion is simple: while various events (including changes in interface state and tracked objects) cause immediate change in the state of the static routes, the changes to next-hop reachability are not evaluated immediately; the next-hop check is done periodically and the default interval is 60 seconds.

A very low value of the scanning interval increases CPU utilization on a device with many static routes.

To illustrate this behavior, I’ve configured a simple static route using a loopback IP address of a remote OSPF router as its next hop:

S1#show ip route 
Routing entry for
  Known via "static", distance 1, metric 0
  Routing Descriptor Blocks:
      Route metric is 0, traffic share count is 1

S1#show ip route
Routing entry for
  Known via "ospf 1", distance 110, metric 65, type intra area
  Last update from on Serial1/0.100, 00:00:26 ago
  Routing Descriptor Blocks:
  *, from, 00:00:26 ago, via Serial1/0.100
      Route metric is 65, traffic share count is 1

When the remote loopback interface was shut down, the OSPF route disappeared within a few seconds (as dictated by the SPF delay timer), but it took almost a minute for the static route to be removed from the IP routing table (the printout was generated by the debug ip routing command).

00:04:23.953: RT: del via, ospf metric [110/65]
00:04:23.953: RT: delete subnet route to
00:05:10.766: RT: del via, static metric [1/0]
00:05:10.766: RT: delete subnet route to

After changing the scanning interval to one second, the static route disappeared almost immediately after the OSPF route:

S1(config)#ip route static adjust-time 1 
00:07:08.994: RT: del via, ospf metric [110/65]
00:07:08.994: RT: delete subnet route to
00:07:09.882: RT: del via, static metric [1/0]
00:07:09.886: RT: delete subnet route to


  1. Mmm. Could be a good case to use an IP SLA tracking object to automatically remove the static route. A simple "ip route <next> track 1" will do that nicely. This assume "1" is your ip sla tracking.</next>

  2. Ivan, Creating SLA tracking will also work, right?

  3. Ivan Pepelnjak12 May, 2010 09:42

    SLA tracking will obviously work, but the idea of static routes based on dynamic next-hop is to simplify configuration, not to make it more complex ;)

  4. How can I confgure on Cisco Router a no permanent and periodic Static Route?
    I need forward trafic for a Path from 11 PM to 6:00 AM and clear the route. All days doing the same procedure automatically.

  5. Use cron events in EEM (or kron) to modify router configuration.

  6. Can you explain more that, please. I did not understand the acronims cron, EEM, kron



You don't have to log in to post a comment, but please do provide your real name/URL. Anonymous comments might get deleted.