Section 8.3: Configuring Cisco Express Forwarding
To configure CEF you simply need to enable CEF or dCEF on a router. There are, however, a number of other optional configuration tasks that you can perform. These include configuring load balancing; and configuring network accounting. You need not configure distributed tunnel switching, such as GRE tunnels, for CEF as it is enabled automatically when you enable CEF or dCEF.
You must enable dCEF when you want the line cards to perform express forwarding so that the route processor can handle routing protocols or switch packets from legacy interface processors. To do this, use ip cef command in global configuration mode.
To enable dCEF, use one of the ip cef distributed commands in global configuration mode. You can disable dCEF by using the no ip cef distributed command.
When you enable CEF or dCEF globally, all interfaces that support CEF are enabled by default. If you want to turn off CEF or dCEF on a particular interface you must disable it for that interface. You can use the no ip route-cache cef command in interface configuration mode to disable CEF or dCEF on an interface.
If at a later you want to re-enable CEF or dCEF on that interface, use the ip route-cache cef command in interface configuration mode.
8.3.1: Configuring Load Balancing for CEF
You can configure load balancing on a per-destination or per-packet basis. Load-balancing decisions are made on the outbound interface therefore you must configure load balancing on outbound interfaces.
126.96.36.199: Per-Destination Load Balancing
Per-destination load balancing is enabled by default when you enable CEF. Per-destination load balancing allows the router to use multiple paths to achieve load sharing. Packets for a given source-destination host pair are guaranteed to take the same path, even if multiple paths are available. Traffic destined for different pairs tend to take different paths. Because per-destination load balancing depends on the statistical distribution of traffic, load sharing becomes more effective as the number of source-destination pairs increase.
You should disable per-destination load balancing when you want to enable per-packet load balancing. To do this, use the no ip load-sharing per-destination command in interface configuration mode.
188.8.131.52: Per-Packet Load Balancing
Per-packet load balancing allows the router to send successive data packets over paths without regard to individual hosts or user sessions. It uses a round-robin method to determine which path each packet takes to the destination. Per-packet load balancing ensures balancing over multiple links. However, per-packet load balancing via CEF is not supported on Engine 2 Gigabit Switch Router (GSR) line cards (LCs).
You can use the ip load-sharing per-packet command in interface configuration mode to enable per-packet load balancing.
8.3.2: Configuring Network Accounting for CEF
Network accounting is the process of collect statistics and information about patterns of network use.
To collect network accounting information for CEF, you can use either the ip cef accounting per-prefix command or the ip cef accounting non-recursive command in global configuration mode.
When you enable network accounting for CEF from global configuration mode, accounting information is collected at the route processor when CEF mode is enabled. When network accounting is enabled for dCEF, information is collected at the line cards.
The information collected through network accounting can be viewed by using the show ip cef command in exec mode.