Normal routing uses destination IP address, Policy-Based Routing (PBR) - the source. By default, PBR overwrites normal routing; another words, it intercepts the packets before the normal routing kicks in. The “default” keyword placed before the “next-hop” or “interface” keywords in “set” command in route-map, changes the default order and tries normal routing first and if it fails, then uses PBR routing. PBR uses route-maps, which defines the match criteria and the forwarding action via “set” command: either the outgoing interface for p2p links or the next-hop IP address. For route-map matching, there are two choices: ACL or the length of the packet (IP telephony is a good example of packet length matching). The final step in PBR is to apply the route-map to the ingress interface (hence, packets generated by the router itself are not processed):
config-if# ip policy route-map <name> # show route-map # show ip policy # debug ip policy # traceroute x.x.x.x
To process locally generated packets use:
In addition to destination, it is possible to set IP precedence or ToS bits in IP packets, processed by the route-map created for PBR.