The ip route-cache command - Bury the hatchet series

From what I've seen in the practical life, this command puzzles many people, i hope to cover it throughly.

Controlling the packet switching method depends upon which method we are talking about, in the case of CEF Switching its all about the ingress interface and has nothing to do with the egress interface, accordingly despite the configuration under the egress interface, if the ingress interface was CEF enabled then the traffic will be CEF Switched (the packet will be handled via an interrupt routine rather than the IP Input process). While in the case of Fast Switching the IOS builds the Fast Switching cache entry after switching the first packet, and thus it will depend on the egress interface, thus if the ingress interface was Process or Fast Switching enabled, and the egress interface is Fast Switching enabled, thus the packet will be Fast switched - Accordinly as illustrated CEF and Fast Switching are controlled in a different manner.

Router(config-if)#ip route-cache ?
  cef             Enable Cisco Express Forwarding
  distributed     Enable Distributed CEF-switching
  flow            Enable Flow caching
  policy          Enable fast-switching policy cache for outgoing packets
  same-interface  Enable fast-switching on the same interface

Fast Switching

The ip route-cache command with no additional keywords enables fast switching.

Entering the ip route-cache command has no effect on a subinterface, moreover no keywords are available for subinterfaces (except for the same-interface option), but they do accept the no form of the command; however, this disables CEF or dCEF on the physical interface as well as all subinterfaces associated with the physical interface.

NOTE IPv4 fast switching is removed with the implementation of the Cisco Express Forwarding infrastructure enhancements for Cisco IOS 12.2(25)S-based releases and Cisco IOS Release 12.4(20)T. For these and later Cisco IOS releases, switching path are Cisco Express Forwarding switched or process switched. This makes the switching decision easier for future development of software features. Starting with the implementation of the Cisco Express Forwarding infrastructure enhancements and the removal of IPv4 fast switching, components that do not support Cisco Express Forwarding will work only in process switched mode. [Updated, July 2008]

same-interface: Enables fast-switching packets to forward IP packets back out through the interface on which they arrived.

NOTE This configuration normally is not recommended, although it is useful when you have partially meshed media, such as Frame Relay or you are running Web Cache Communication Protocol (WCCP) redirection. You could use this feature on other interfaces, although it is not recommended because it would interfere with redirection of packets to the optimal path.

policy: Enables fast-switching for packets that are forwarded using Policy Based Routing (PBR) - Configured on the ingress interface having the PBR configuration.

NOTE Beginning in Cisco IOS Release 12.0, PBR is supported in the Cisco Express Forwarding (CEF) switching path. CEF-switched PBR has better performance than fast-switched PBR and, therefore, is the optimal way to perform PBR on a router. No special configuration is required to enable CEF-switched PBR. It is on by default as soon as you enable CEF and PBR on the router.

Process Switching

There are no specific commands to enable Process switching just disable fast and CEF switching.


flow: Enables NetFlow accounting (ingress) for packets that are received by the interface - Enable Flow fast-switching cache.

NOTE In the past, ordinary IP accounting can only account the traffic going through the router, while current Netflow also account the traffic destined to the router (marked with "Local" DstIf).

CEF and dCEF

CEF/dCEF can be enabled globally via the ip cef [distributed] command.

When you enable CEF or dCEF globally, all interfaces that support CEF are enabled by default, afterwards you can selectively disable CEF under certain interfaces via the no ip route-cache cef interface command.

distributed: Enables distributed switching on the interface.

cef: Enables Cisco Express Forwarding (CEF) operation on an interface.

NOTE Disabling CEF or dCEF on an interface disables CEF switching for packets forwarded to the interface, but has no effect on packets forwarded out of the interface.

Troubleshooting Router Packet Switching methods

show ip cache verbose - Display fast switching cache.
show interface stat (hidden)
show interface switching (hidden)
show cef events
show cef interfaces
sh cef linecard - To see if all cards are sync'd and have the same table version.

I hope that I've been informative.

Mohammed Mahmoud.

Check Also

Best AI tools list