Unable to delete Stale/Obsolete statc routes in Cisco IOS

Today, I had to troubleshoot a very peculiar problem on my Cisco Catalyst 3750 switches in two different sites. To cut a long story short, both the sites originally had IPSec VPNs over ADSL internet andtherefore static routes added to pass through their VPN firewalls. However, with a recent WAN migration with leased lines, all traffic moved to the WAN routers.

However, the Static Routes became stale (obsolete) and we were unable to delete the static routes. The routes are not in the running config (no “ip route command in config”) and a reboot wouldn’t help.

When you do

ciscoswitch# show ip route
Default gateway is 10.10.10.1

Host Gateway Last Use Total Uses Interface
192.168.1.1 10.10.10.4 0:00 460318 Vlan1
192.168.1.2 10.10.10.4 0:00 25586 Vlan1
192.168.1.3 10.10.10.4 0:00 25570 Vlan1

The static routes cannot be deleted using

ciscoswitch(config)# no ip route 192.168.1.1 255.255.255.255 10.10.10.4

or

ciscoswitch# clear ip route *

or

ciscoswitch# clear ip cache *

How to resolve?

Finally, the resolution was to disable and enable the “ip routing” service.

Disable IP Routing

ciscoswitch(config)#no ip routing

Enable IP Routing

ciscoswitch(config)#ip routing

This fixed the problem and we are back in business. The stale routing table entries are gone.

I’m sure someone out there is looking for this and might help!!!

Comments

4 responses to “Unable to delete Stale/Obsolete statc routes in Cisco IOS”

  1. Mike Avatar
    Mike

    Rock! thanks dude 🙂

  2. gaborheja Avatar
    gaborheja

    That is exactly what I was looking for. Thanks!

  3. Jonathan Avatar
    Jonathan

    Perfect, thank you!

    A word of warning to others about to try ‘no ip routing’ and ‘ip routing’. Your router will remove any routing-related config lines when you turn off IP routing! So, back up your configuration first – in my case it was a couple of static route definitions, and my OSPF configuration…

  4. sala Avatar
    sala

    It’s all due to ip redirects some where in the network.

    Check for ip redirect entries.

    ciscoswitch#sh ip redirects

    and if you can see entries, clear redirect

    ciscoswitch#clear ip redirects

    both your routing enties and redirect entries will go.

Leave a Reply

Your email address will not be published. Required fields are marked *