Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Too many static routes

I have routers with very many static routes, many of which I suspect are no longer needed. Is there some command that will show the number of matches for each "ip route" statement? cf. show access-list for matches of ACLs. Does anybody know any other trick to remove unnecessary static route statements? Thank you.

Hall of Fame Super Silver

Re: Too many static routes


It would be convenient if there were some variation on show ip route which would include a hit count similar to the hit count in show access-list, but I do not believe that this exists.

There are are couple of alternatives which may help you achieve your objective. Probably the most simple is to configure ip accounting on the interfaces and to look in the accounting statistics for matches to the destinations configured in the static routes. A similar approach is to configure netflow on the interfaces and to look in the netflow records for destinations that match the netflow records.

Depending on the static routes and how many different next hops are specified, an approach that is a bit more complex but with results more similar to what you describe would be to configure Policy Based Routing. You would configure PBR and in the route map there would be an instance for each next hop specified in the static routes. Each instance in PBR would have an access list which would permit any to the destinations specified in static routes and the set clause would specify the same next hop as specified in the static route. This PBR would not change any routing logic, but the matches to the access lists would give you counters that show what static routes are getting hits.



New Member

Re: Too many static routes

You could try using either IP Accounting or Netflow, but the results could vary depending on your network design.

New Member

Re: Too many static routes

What version of code are you running and are you also running CEF?

It may be possible to get that information using "show ip cef detail"

hope any of those work out for you.

New Member

Re: Too many static routes


Please try the command SH IP ROUTE STATIC, to see the Static Routes.



CreatePlease login to create content