All normal IP Forwarding decisions are usually made as a result of the Destination Address in the IP Headers of a packet. Wherever the packet is trying to go, the next hop is determined based on the Destination Address. Policy routing allows a router to make next hop routing decisions based on other information besides the destination IP Address.
Policy routing is configured on an interface that’s expected to receive specific kinds of traffic. The interface command instructs the IOS to process incoming packets with different logic BEFORE normal forwarding logic takes place.
Incoming traffic is matched against a route-map policy referenced on the interface. Traffic is matched according to the matching criteria in the route-map. Actions defining specific routing instructions are applied to traffic using the set command.
Use of the default keyword essentially means that policy routing tries the normal destination routing first, THEN resorts to set commands in the route-map only when the router finds no matching routes in its routing table for the destination address. To clarify this…if the only route in the routing table that matches the destination using the default route, that packet is treated as if no route match occurred, proceeding to use the set statements to define next hop in the route-map as configured.
A single route-map sequence can hold multiple set statements, if there are multiple set statements they are processed in the following order:
- set ip next-hop
- set interface
- set ip default next-hop
- set default interface
Use of the set interface and set default interface commands is strongly recommended only with point to point interfaces. It doesn’t mean it won’t work on multi-access interfaces, but its known that it can cause problems if used on those interface types.