Route maps

Route maps enable you to define routing policy for the traffic causing a packet to be forwarded to a predetermined next-hop interface, bypassing the path determined by normal routing.

Each entry in a route map statement contains a combination of match and set statements. A route map specifies the match criteria that correspond to ACLs, followed by a set statement that specifies the resulting action if all of the match clauses are met. You can define multiple match and next-hop specifications (set statement) on the same interface. When a PBR policy has multiple next-hops to a destination, PBR selects the first live next-hop specified in the policy that is up. If none of the policy's direct routes or next-hops is available, the packets are forwarded as per the routing table.

Match statement

You can use standard or extended ACLs to establish the match criteria. Using standard ACLs with route maps in PBR, an IP packet is routed based on their source IP address. Using extended ACLs, you can route IP packets based on all of the clauses in the extended ACL.

Set statement

Traffic that matches a match statement in the route map is forwarded as defined by set commands. Multiple set commands can be configured and when a match condition is met, the device works sequentially through the list of set commands until it finds the first next-hop that is operational and uses it. If that next-hop goes down, the next-hop as defined in a set command is chosen and if all next-hop interfaces in the list are down, the packet is routed as determined in the IP Route Table. If a next-hop interface that was down comes back up, the next-hop selection process begins again and restarts its selection process from the top of the list.

The set clauses are evaluated in the following order:
  1. Set clauses where the next-hop is specified.
  2. Set interface NULL0.

The order in which you enter the set ip next-hop commands determines the order preference. If no next-hops are reachable, the egress interface is selected based on the order of interface configuration. The set interface NULL0 clause — regardless of which position it was entered — is always placed as the last selection in the list.

Note

Note

The "match" and "set" statements described in this chapter are the only route-map statements supported for PBR. Other route-map statements described in the documentation apply only to the protocols with which they are described.
Note

Note

If none of the clauses of a PBR routemap definition contains both 'match' and 'set' statements together, PBR does not work and the packets are forwarded as per the routing table.

The following are the PBR next-hops that can be specified in a route map for a matched traffic: