cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1252
Views
8
Helpful
4
Replies

Too many static routes

ctongow
Level 1
Level 1

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.

4 Replies 4

Richard Burts
Hall of Fame
Hall of Fame

Clement

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.

HTH

Rick

HTH

Rick

mameiers
Level 1
Level 1

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

mameiers
Level 1
Level 1

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.

Hi,

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

Regards

Danny

Review Cisco Networking for a $25 gift card