Cisco IOS IP Switching Command Reference, Release 12.3 T
IP Switching Commands: ip cef accounting through ip route-cache

Table Of Contents

ip cef accounting

ip cef linecard ipc memory

ip cef load-sharing algorithm

ip cef table adjacency-prefix override

ip cef table consistency-check

ip cef table event-log

ip cef table resolution-timer

ip cef

ip load-sharing

ip route-cache


ip cef accounting

To enable Cisco Express Forwarding (CEF) network accounting, use the ip cef accounting command in global configuration mode or interface configuration mode. To disable network accounting of CEF, use the no form of this command.

ip cef accounting {[non-recursive] [per-prefix] [prefix-length]}

no ip cef accounting {[non-recursive] [per-prefix] [prefix-length]}

Specific CEF Accounting Information Through Interface Configuration Mode

ip cef accounting non-recursive {external | internal}

no ip cef accounting non-recursive {external | internal}

Syntax Description

non-recursive

Enables accounting through nonrecursive prefixes.

This keyword is optional when used in global configuration mode.

per-prefix

(Optional) Enables the collection of the number of packets and bytes express forwarded to a destination (or prefix).

prefix-length

(Optional) Enables accounting through prefix length.

external

Counts input traffic in the nonrecursive external bin.

internal

Counts input traffic in the nonrecursive internal bin.


Defaults

Accounting is disabled by default.

Command Modes

Global configuration

Interface configuration

Command History

Release
Modification

11.2 GS

This command was introduced.

11.1 CC

Multiple platform support was added.

11.1 CC

The prefix-length keyword was added.

12.2(2)T

The ip cef accounting non-recursive command in interface configuration mode was added.


Usage Guidelines

You might want to collect statistics to better understand CEF patterns in your network.

When you enable network accounting for CEF from global configuration mode, accounting information is collected at the Route Processor (RP) when CEF mode is enabled and at the line cards when distributed CEF (dCEF) mode is enabled. You can then display the collected accounting information using the show ip cef privileged EXEC command.

For prefixes with directly connected next hops, the non-recursive keyword enables the collection of packets and bytes to be express forwarded through a prefix. This keyword is optional when this command is used in global configuration mode.

This command in interface configuration mode must be used in conjunction with the global configuration command. The interface configuration command allows a user to specify two different bins (internal or external) for the accumulation of statistics. The internal bin is used by default. The statistics are displayed through the show ip cef detail command.

Examples

The following example shows how to enable the collection of CEF accounting information:

Router(config)# ip cef accounting

Related Commands

Command
Description

show ip cef

Displays entries or a summary of the FIB table.


ip cef linecard ipc memory

To configure the line card memory pool for the Cisco Express Forwarding (CEF) queuing messages, use the ip cef linecard ipc memory command in global configuration mode. To return to the default Inter-process Communications (IPC) memory allocation, use the no form of this command.

ip cef linecard ipc memory kbps

no ip cef linecard ipc memory kbps

Syntax Description

kbps

Kilobytes of line card memory allocated. Range is 0 to 12800.


Defaults

Default IPC memory allocation is 25 messages. However, this value is dependant on the switching platform.

Command Modes

Global configuration

Command History

Release
Modification

12.2(2)T

This command was introduced.


Usage Guidelines

This command is available only on distributed switching platforms.

If you are expecting large routing updates to the Route Processor (RP), use this command to allocate a larger memory pool on the line cards for queuing CEF routing update messages. The memory pool reduces the transient memory requirements on the RP.

To display and monitor the current size of the CEF message queues, use the show cef linecard command. Also, the peak size is recorded and displayed when you use the detail keyword.

Examples

The following example shows how to configure the CEF line card memory queue to 128000 kilobytes per second:

Router(config)# ip cef linecard ipc memory 128000

Related Commands

Command
Description

show cef linecard

Displays detailed CEF information for the specified line card.


ip cef load-sharing algorithm

To select a Cisco Express Forwarding (CEF) load balancing algorithm, use the ip cef load-sharing algorithm command in global configuration mode. To return to the default universal load balancing algorithm, use the no form of this command.

ip cef load-sharing algorithm {original | tunnel [id] | universal [id]}

no ip cef load-sharing algorithm {original | tunnel [id] | universal [id]}

Syntax Description

original

Sets the load balancing algorithm to the original based on a source and destination hash.

tunnel

Sets the load balancing algorithm for use in tunnel environments or in environments where there are only a few IP source and destination address pairs.

universal

Sets the load balancing algorithm to the universal algorithm that uses a source and destination, and ID hash.

id

(Optional) Fixed identifier.


Defaults

The universal load sharing algorithm is selected.

Command Modes

Global configuration

Command History

Release
Modification

12.0(12)S

This command was introduced.

12.1(5)T

This command was integrated into Cisco IOS Release 12.1(5)T.


Usage Guidelines

The original CEF load sharing algorithm produced distortions in load sharing across multiple routers due to the use of the same algorithm on every router. When the load sharing algorithm is set to universal mode, each router on the network can make a different load sharing decision for each source-destination address pair which resolves load sharing distortions.

The tunnel algorithm is designed to more fairly share load when only a few source-destination pairs are involved.

Examples

The following example shows how to enable the CEF load sharing algorithm for universal environments:

Router(config)# ip cef load-sharing algorithm universal 1

Related Commands

Command
Description

debug ip cef hash

Records CEF load sharing hash algorithm events

ip load-sharing

Enables load balancing.


ip cef table adjacency-prefix override

To enable Cisco Express Forwarding (CEF) adjacency prefixes to override static host glean routes, use the ip cef table adjacency-prefix override command in global configuration mode. To disable CEF adjacency prefix override, use the no form of this command.

ip cef table adjacency-prefix override

no ip cef table adjacency-prefix override

Syntax Description

This command has no arguments or keywords.

Defaults

Adjacency prefix override is enabled by default.

Command Modes

Global configuration

Command History

Release
Modification

12.0(16)S

This command was introduced.

12.2(2)T

This command was integrated into Cisco IOS Release 12.2(2)T.


Usage Guidelines

When CEF is configured, the forwarding information base (FIB) table may conflict with static host routes that are specified in terms of an output interface and Layer 2 address resolution protocols (Address Resolution Protocol [ARP], map lists, and so on). The Layer 2 address resolution protocol adds adjacencies to CEF, which in turn creates a corresponding host route entry in the FIB table. This entry is called an adjacency prefix. If these adjacency prefix entries are also configured by a static host route, a conflict occurs.

This command ensures that adjacency prefixes can override static host glean routes, and correctly restore routes when the adjacency prefix is deleted.

Examples

The following example shows how to enable CEF table adjacency prefix override:

Router(config)# ip cef table adjacency-prefix override

ip cef table consistency-check

To enable Cisco Express Forwarding (CEF) table consistency checker types and parameters, use the ip cef table consistency-check command in global configuration mode. To disable consistency checkers, use the no form of this command.

ip cef table consistency-check [type {lc-detect | scan-lc | scan-rib | scan-rp}] [count count-number] [period seconds]

no ip cef table consistency-check [type {lc-detect | scan-lc | scan-rib | scan-rp}] [count count-number] [period seconds]

Specific to Suppress Errors During Route Updates

ip cef table consistency-check [settle-time seconds]

no ip cef table consistency-check [settle-time seconds]

Syntax Description

type

(Optional) Type of consistency check to configure.

lc-detect

(Optional) Line card detects missing prefix. Confirmed by Route Processor (RP).

scan-lc

(Optional) Passive scan check of tables on line card.

scan-rib

(Optional) Passive scan check of tables on RP against Routing Information Base (RIB).

scan-rp

(Optional) Passive scan check of tables on RP.

count count-number

(Optional) Maximum number of prefixes to check per scan. Range is from 1 to 225.

period seconds

(Optional) Period between scans. Range is from 30 to 3600 seconds.

settle-time seconds

(Optional) Time elapsed during which updates for a candidate prefix are ignored as inconsistencies. Range is from 1 to 3600 seconds.


Defaults

All consistency checkers are disabled by default.

Command Modes

Global configuration

Command History

Release
Modification

12.0(15)S

This command was introduced.

12.2(2)T

This command was integrated into Cisco IOS Release 12.2(2)T.


Usage Guidelines

This command configures CEF consistency checkers and parameters for the following detection mechanism types:

Detection Mechanism
Operates On
Description

Lc-detect

Line Card

Operates on the line card by retrieving IP prefixes found missing from its forwarding information base (FIB) table. If IP prefixes are missing, the line card can not forward packets for these addresses. Lc-detect will then send IP prefixes to the RP for confirmation. If the RP detects that it has the relevant entry, an inconsistency is detected and an error message will be displayed. Also, the RP will send a signal back to the line card confirming that the IP prefix is an inconsistency.

Scan-lc

Line Card

Operates on the line card by looking through the FIB table for a configurable time period and sending the next n prefixes to the RP. The RP does an exact lookup. If it finds the prefix missing, the RP reports an inconsistency. Finally, the RP sends a signal back to the line card for confirmation.

Scan-rp

Route Processor

Operates on the RP (opposite of the scan-lc) by looking through the FIB table for a configurable time period and sending the next n prefixes to the line card. The line card does an exact lookup. If it finds the prefix missing, the line card reports an inconsistency and finally signals the RP for confirmation.

Scan-rib

Route Processor

Operates on all RPs (even nondistributed), and scans the RIB to ensure that prefix entries are present in the RP FIB table.


Examples

The following example shows how to enable the CEF consistency checkers:

Router(config)# ip cef table consistency-check

Related Commands,

Command
Description

clear ip cef inconsistency

Clears CEF inconsistency statistics and records found by the CEF consistency checkers.

debug ip cef

Displays various CEF table query and check events.

show ip cef inconsistency

Displays CEF IP prefix inconsistencies.


ip cef table event-log

To control Cisco Express Forwarding (CEF) table event-log characteristics, use the ip cef table event-log command in global configuration mode.

ip cef table event-log [size event-number] [match ip-prefix mask]

no ip cef table event-log [size event-number] [match ip-prefix mask]

Specific to Virtual Private Network (VPN) Event Log

ip cef table event-log [size event-number] [vrf vrf-name] [match ip-prefix mask]

no ip cef table event-log [size event-number] [vrf vrf-name] [match ip-prefix mask]

Syntax Description

size event-number

(Optional) Number of event entries. The range is from 1 to 4294967295.

match

(Optional) Log events matching specified prefix and mask.

ip-prefix

(Optional) IP prefixes matched, in dotted decimal format (A.B.C.D).

mask

(Optional) Network mask written as A.B.C.D.

vrf vrf-name

(Optional) Virtual Private Network (VPN) routing/forwarding instance (VRF) CEF table and VRF name.


Defaults

Default size for event log is 10000 entries.

Command Modes

Global configuration

Command History

Release
Modification

12.0(15)S

This command was introduced.

12.2(2)T

This command was integrated into Cisco IOS Release 12.2(2)T.


Usage Guidelines

This command is used to troubleshoot inconsistencies that occur in the CEF event log between the routes in the Routing Information Base (RIB), Route Processor (RP) CEF tables, and line card CEF tables.

The CEF event log collects CEF events as they occur without debugging enabled. This process allows the tracing of an event immediately after it occurs. Cisco technical personnel may ask for information from this event log to aid in resolving problems with the CEF feature.

When the CEF table event log has reached its capacity, the oldest event is written over by the newest event until the event log size is reset using this command or cleared using the clear ip cef event-log command.

Examples

The following example shows how to set the CEF table event log size to 5000 entries:

Router(config)# ip cef table event-log size 5000

Related Commands

Command
Description

clear ip cef event-log

Clears the CEF event-log buffer.

ip cef table consistency-check

Enables CEF table consistency checker types and parameters.

show ip cef events

Displays all recorded CEF FIB and adjacency events.


ip cef table resolution-timer

To change the Cisco Express Forwarding (CEF) background resolution timer, use the ip cef table resolution-timer command in global configuration mode.

ip cef table resolution-timer seconds

no ip cef table resolution-timer seconds

Syntax Description

seconds

Timer value in seconds. Range is from 0 to 30 seconds; 0 is for the automatic exponential backoff scheme.


Defaults

The default configuration value is 0 seconds for automatic exponential backoff.

Command Modes

Global configuration

Command History

Release
Modification

12.2(2)T

This command was introduced.


Usage Guidelines

The CEF background resolution timer can use either a fixed time interval or an exponential backoff timer that reacts to the amount of resolution work required. The exponential backoff timer starts at 1 second, increasing to 16 seconds when a network flap is in progress. When the network recovers, the timer returns to 1 second.

The default is used for the exponential backoff timer. During normal operation, the default configuration value set to 0 results in re-resolution occurring much sooner than when the timer is set at a higher fixed interval.

Examples

The following example show how to set the CEF background resolution timer to 3 seconds:

Router(config)# ip cef table resolution-timer 3

ip cef

To enable Cisco Express Forwarding (CEF) on the route processor card, use the ip cef command in global configuration mode. To disable CEF, use the no form of this command.

ip cef [distributed]

no ip cef [distributed]

Syntax Description

distributed

(Optional) Enables distributed CEF (dCEF) operation. Distributes CEF information to line cards. Line cards perform express forwarding.


Defaults

CEF is disabled by default, excluding these platforms:

CEF is enabled on the Cisco 7100 series router.
CEF is enabled on the Cisco 7200 series router.
CEF is enabled on the Cisco 7500 series Internet router.
Distributed CEF is enabled on the Cisco 6500 series router
Distributed CEF is enabled on the Cisco 12000 series Internet router.

Command Modes

Global configuration

Command History

Release
Modification

11.1 CC

This command was introduced.

12.2

The default for Cisco 7200 series routers was changed from disabled to enabled.

12.2(11)T

This command was integrated into Cisco IOS Release 12.2(11)T and implemented on the following platforms: Cisco IAD2420 series, Cisco 2600 series, Cisco 3620 routers, Cisco 3640 routers, Cisco 3660 routers, Cisco 3700 series routers, and Cisco MC3810 multiservice access concentrators.


Usage Guidelines

The ip cef command is not available on the Cisco 12000 series because that router series operates only in dCEF mode.

CEF is advanced Layer 3 IP switching technology. CEF optimizes network performance and scalability for networks with dynamic, topologically dispersed traffic patterns, such as those associated with web-based applications and interactive sessions.

If you enable CEF and then create an access list that uses the log keyword, the packets that match the access list are not CEF switched. They are fast switched. Logging disables CEF.

Examples

The following example shows how to enable standard CEF operation:

Router(config)# ip cef

The following example shows hos to enables dCEF operation:

Router(config)# ip cef distributed 

Related Commands

Command
Description

ip cache-route

Controls the use of high-speed switching caches for IP routing.

Enables CEF network accounting.

ip cef load-sharing algorithm

Selects a CEF load balancing algorithm.

ip cef table adjacency-prefix override

Enables CEF adjacency prefixes to override static host glean routes.

ip cef table consistency-check

Enables CEF table consistency checker types and parameters.

ip cef table event-log

Controls CEF table event-log characteristics.

ip cef table resolution-timer

Changes CEF background resolution timer.


ip load-sharing

To enable load balancing for Cisco Express Forwarding (CEF), use the ip load-sharing command in interface configuration mode.

ip load-sharing [per-packet] [per-destination]

Syntax Description

per-packet

(Optional) Enables per-packet load balancing on the interface.

per-destination

(Optional) Enables per-destination load balancing on the interface.


Defaults

Per-destination load balancing is enabled by default when you enable CEF.

Command Modes

Interface configuration

Command History

Release
Modification

11.2 GS

This command was introduced.

11.1 CC

Multiple platform support was added.


Usage Guidelines

Per-packet load balancing allows the router to send data packets over successive equal-cost paths without regard to individual destination hosts or user sessions. Path utilization is good, but packets destined for a given destination host might take different paths and might arrive out of order.


Note Per-packet load balancing via CEF is not supported on Engine 2 Gigabit Switch Router (GSR) line cards (LCs).


Per-destination load balancing allows the router to use multiple, equal-cost paths to achieve load sharing. Packets for a given source-destination host pair are guaranteed to take the same path, even if multiple, equal-cost paths are available. Traffic for different source-destination host pairs tend to take different paths.


Note If you want to enable per-packet load sharing to a particular destination, then all interfaces that can forward traffic to the destination must be enabled for per-packet load sharing.


Examples

The following example shows how to enable per-packet load balancing:

Router(config)# interface E0
Router(config-if)# ip load-sharing per-packet

The following example shows how to enable per-destination load balancing:

Router(config)# interface E0
Router(config-if)# ip load-sharing per-destination

Related Commands

Command
Description

ip cef

Enables CEF on the RP card.


ip route-cache

To control the use of high-speed switching caches for IP routing, use the ip route-cache command in interface configuration mode. To disable any of these switching modes, use the no form of this command.

IP Route-Cache

ip route-cache

no ip route-cache

IP Route-Cache Same-Interface

ip route-cache same-interface

no ip route-cache same-interface

IP Route-Cache Flow

ip route-cache [flow]

no ip route-cache [flow]

IP Route-Cache Distributed

ip route-cache distributed

no ip route-cache distributed

IP Route-Cache CEF

ip route-cache cef

no ip route-cache cef

Syntax Description

same-interface

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

flow

(Optional) Enables the collection of per-flow accounting in conjunction with Cisco Express Forwarding (CEF), distributed CEF (dCEF) or fast switching.

distributed

Enables IP distributed switching on the interface.

cef

Enables CEF operation on an interface after CEF operation was disabled.


Defaults

Fast switching varies by interface and media.

Distributed switching is disabled.

When CEF or dCEF operation is enabled globally, all interfaces that support CEF or dCEF are enabled by default.

Command Modes

Interface configuration

Command History

Release
Modification

10.0

This command was introduced.

11.2 GS

The cef and distributed keywords were added.

11.1 CC

Multiple platform support was added for cef keyword.


Usage Guidelines

IP Route-Cache

Using the route cache is often called fast switching. The route cache allows outgoing packets to be load-balanced on a per-destination basis rather than on a per-packet basis. The ip route-cache command with no additional keywords enables fast switching.

Entering the ip route-cache command has no effect on a subinterface. Subinterfaces 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.

IP Route-Cache Same-Interface

You can enable IP fast switching when the input and output interfaces are the same interface, using the ip route-cache same-interface command. 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.

IP Route-Cache Flow

The flow caching option can be used in conjunction with CEF switching to allow statistics to be gathered with a finer granularity. The statistics include IP subprotocols, well-known ports, total flows, average number of packets per flow, and average flow lifetime.

IP Route-Cache Distributed

The distributed option is supported on Cisco routers with line cards and Versatile Interface Processors (VIPs) that support both CEF and flow switching.

On Cisco routers with Route Switch Processor (RSP) and VIP controllers, the VIP hardware can be configured to switch packets received by the VIP with no per-packet intervention on the part of the RSP. When VIP distributed switching is enabled, the input VIP interface tries to switch IP packets instead of forwarding them to the RSP for switching. Distributed switching helps decrease the demand on the RSP.

If the ip route-cache distributed, ip cef distributed, and ip route-cache flow commands are configured, the VIP will perform distributed CEF switching and collect a finer granularity of flow statistics.

IP Route-Cache CEF

In some instances, you might want to disable CEF or dCEF on a particular interface because that interface is configured with a feature that CEF or dCEF does not support. Because all interfaces that support CEF or dCEF are enabled by default when you enable CEF operation globally, you must use the no form of the ip route-cache cef command in the interface configuration mode to turn CEF operation off a particular interface. To reenable CEF or dCEF operation, use the ip route-cache cef command.

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

Additionally when you disable CEF or dCEF, Cisco IOS software switches packets using the next-fastest switching path. In the case of dCEF, the next-fastest switching path is CEF on the RSP.


Note On the Cisco 12000 series Internet router, you must not disable dCEF on an interface.



Note Not all switching methods are available on all platforms. Refer to the Cisco Product Catalog for information about features available on the platform you are using.


Examples

The following example shows how to enable fast switching and disable distributed switching:

Router(config-if)# ip route-cache

The following example shows how to disable all switching modes except for processor switching.

Router(config-if)# no ip route-cache

The following example shows how to enable VIP distributed flow switching on the interface:

Router(config)# interface e0
Router(config-if)# ip address 17.252.245.2 255.255.255.0
Router(config-if)# ip route-cache distributed
Router(config-if)# ip route-cache flow

The following example shows how to enable CEF operation on the router (globally), but it turns off CEF operation on Ethernet interface 0:

Router(config)# ip cef 
Router(config)# interface e0
Router(config-if)# no ip route-cache cef

The following example shows how to enable dCEF operation on the router (globally), but it turns off CEF operation on Ethernet interface 0:

Router(config)# ip cef distributed 
Router(config)# interface e0
Router(config-if)# no ip route-cache cef

The following example shows how to reenable dCEF operation on Ethernet interface 0:

Router(config)# ip cef distributed 
Router(config)# interface e0
Router(config-if)# ip route-cache distributed

Related Commands

Command
Description

exit

Leaves aggregation cache mode.

ip cef

Enables CEF on the RP card.

ip cef distributed

Enables distributed CEF (dCEF) operation.

ip route-cache flow

Enables NetFlow switching for IP routing.

show mpoa client

Displays the routing table cache used to fast switch IP traffic.