7.3 Static Routes and Gateways of Last Resort
7.3.5 Policy Routing
Policy routing is a means of controlling routes that relies on the source, or source and destination, of traffic rather than destination alone. Policy routing can be used to control traffic inside an AS as well as between ASs. Policy routing is a glorified form of static routing. It is used when you want to force a routing behavior different from what the dynamic routing protocols dictate.

Static routing enables you to direct traffic based on the traffic destination. Traffic toward destination 1 can go via point A, whereas traffic toward destination 2 can go via point B.

Policy routing, on the other hand, enables you to direct traffic based on traffic source or a combination of source and destination. Traffic coming from network 1 can go via point A, or traffic coming from network 1 and going toward network 2 can go via point B.

Consider the example illustrated in Figure . Assume that AS1 was assigned network numbers from two different providers. The 10.10.10.0/24 range was taken from AS3, and the 11.11.11.0/24 range was taken from AS4. AS1 wants to have any traffic originated from its 10.10.10.0/24 networks to be directed toward AS3 and traffic from its 11.11.11.0/24 networks to be directed to AS4, irrespective of the destination of the traffic. AS1 could use policy routing to achieve this requirement by forcing all traffic with a source IP address belonging to 10.10.10.0/24 to have a next hop of 1.1.1.1, and traffic with source IP belonging to 11.11.11.0/24 to have a next hop of 2.2.2.2.

Policy routing can also be based on a source/destination combination. This is illustrated in Figure . Assume that RTA wants to use the San Francisco link for any traffic originating from network 10.10.10.0/24 and reaching network 12.12.12.0/24 in New York. Also, RTA wants to use the San Jose link for any traffic originating from network 10.10.10.0/24 and reaching network 13.13.13.0/24 in New York. Policy routing can be used to set the next hop for the traffic combination (Source =10.10.10.0/24, Destination = 12.12.12.0/24) to be 1.1.1.1. The traffic combination (Source = 10.10.10.0/24, Destination = 13.13.13.0/24) will be set with next hop 2.2.2.2.

Whenever static behavior is enforced, backup becomes an issue. It is important to ensure that if policy routed traffic cannot be delivered because the next hop is down, some other alternative is available. Cisco offers a creative way of doing policy routing by offering multiple next hops for policy routed traffic. If the first next hop is down or not available, the second next hop will be tried, and so on. If none of the statically defined next hops are available, the router can be configured to send the traffic according to the normal dynamic routing (that is, based on destination). (See Figure .)

Lab Activity
  In this lab, you will learn how to configure a simple route-map to control traffic flow.