Policy-Based Routing (PBR)
Policy-Based Routing (PBR) allows a router to make forwarding decisions based on administrator-defined policies instead of relying only on the destination IP address and the normal routing table.
In this lesson, you will learn how PBR uses route maps to match selected traffic and apply forwarding actions such as a specific next-hop address or outgoing interface.
Learning objectives
Explain the difference between destination-based routing and Policy-Based Routing.
Understand route-map sequence processing, permit/deny behavior, and match/set logic.
Apply PBR on the correct ingress Layer 3 interface.
Steer selected traffic to a preferred next hop while unmatched traffic follows the routing table.
Verify PBR with show ip policy, show route-map, ACL counters, routing-table checks, and end-to-end tests.
Troubleshoot common failures such as wrong ACL matching, wrong interface attachment, unavailable next hops, asymmetric paths, and route-map logic errors.
|
Module Goal |
|
Understand how Policy-Based Routing changes the forwarding decision for selected traffic without replacing the normal routing table, then configure, verify, and troubleshoot PBR in an enterprise dual-path design. |
1. Policy-Based Routing Overview
Policy-Based Routing (PBR) is a forwarding policy that allows a router or multilayer switch to make a forwarding decision based on criteria other than only the destination IP address. PBR does not replace the routing table. Instead, it is evaluated for packets entering an interface where a policy is applied. If the packet matches a permitted route-map sequence and that sequence contains a valid set action, the packet can be steered to a different next hop or output interface. Traffic that is not policy-routed continues through normal destination-based forwarding.
|
Core idea: Normal routing asks: “Where is the destination?” PBR can also ask: “Who sent the packet, what kind of packet is it, and which business path should this traffic use?” |
1.1 Why PBR exists
Business policy may require different user groups or applications to use different WAN/Internet paths.
A network may need to steer guest traffic, voice, management traffic, or selected applications through a firewall, proxy, inspection appliance, MPLS link, or secondary ISP.
PBR provides traffic engineering without changing the destination prefixes installed in the routing table.
PBR is especially useful at ingress boundaries where the network can classify traffic as it enters the router.
1.2 Where PBR is applied
Interface PBR is normally attached with ip policy route-map <name> under the Layer 3 interface on which the traffic enters the device. This is an ingress policy. Router-generated traffic is not affected by an interface PBR policy; locally generated traffic requires local PBR using ip local policy route-map <name>.
|
CCNP exam point: Apply the route map on the interface where the packet enters the router, not on the interface where you hope the packet will leave. |
1.3 PBR does not change packet addresses
PBR chooses a forwarding path; it does not perform NAT. The source and destination IP addresses remain unchanged unless another feature, such as NAT, modifies them. This matters because stateful firewalls and return routing must still understand the chosen path.
2. Normal Routing vs Policy-Based Routing
Figure 2 - Policy Based Routing Topology
|
Item |
Normal Routing |
Policy-Based Routing |
|
Primary decision |
Destination IP address |
Policy criteria plus set action |
|
Main information source |
Routing table / FIB |
Route map + match conditions + set action |
|
Typical selection |
Longest-prefix match |
First matching route-map sequence |
|
Can match source? |
No, not for ordinary unicast forwarding |
Yes, usually with ACLs |
|
Can steer selected applications? |
Not directly |
Yes, if traffic can be matched |
|
Where evaluated |
Normal forwarding path |
Ingress interface with ip policy route-map |
|
If no PBR match |
Not applicable |
Packet uses normal routing |
|
Operational risk |
Route convergence/path issues |
Policy errors, black holes, asymmetry, next-hop failure |
2.1 Normal routing example
Assume R1 has a default route through ISP-1. A packet from 192.168.10.10 to 8.8.8.8 enters R1. Without PBR, R1 performs a destination lookup. Because no more-specific route exists, the default route is selected, and the packet exits toward ISP-1.
|
R1# show ip route 0.0.0.0 S* 0.0.0.0/0 [1/0] via 203.0.113.2, GigabitEthernet0/1 |
2.2 PBR example
Now apply a PBR policy to R1 G0/0. The policy matches source subnet 192.168.10.0/24 and sets next hop 198.51.100.2 (ISP-2). The same packet now matches the policy before the normal forwarding decision is used, so it leaves through ISP-2. Unmatched packets still use the routing table.
3. PBR Packet-Processing Sequence
|
Processing order |
|
Ingress packet → PBR policy lookup → route-map sequence evaluation → match result → set action → next-hop/interface resolution → forwarding. If the packet is not policy-routed, normal destination routing is used. |
1. A packet enters a Layer 3 interface that has ip policy route-map configured.
2. The device evaluates the route-map sequences from the lowest sequence number to the highest.
3. Each sequence tests its match clauses. A common match is an IPv4 ACL referenced by match ip address.
4. If a permit sequence matches, the configured set action is attempted, such as set ip next-hop.
5. If the next-hop/action is…
