Overview
The routing table is the same for every packet. PBR breaks that assumption โ it intercepts packets before the routing table lookup and routes them based on source IP, destination IP, DSCP marking, packet length, or protocol. IP SLA adds the intelligence: it continuously probes the next-hops and only steers traffic there if the path is actually up.
PBR vs Routing Table
Topology: PBR for Dual-ISP Traffic Steering
Part 1 โ Traffic Classification with Extended ACLs
! Classify VoIP traffic (RTP UDP + SIP)ip access-list extended ACL-VOIP permit udp 10.0.0.0 0.255.255.255 any range 16384 32767 ! RTP audio streams permit udp 10.0.0.0 0.255.255.255 any eq 5060 ! SIP signaling! Classify DSCP-marked real-time traffic (EF = DSCP 46)ip access-list extended ACL-DSCP-PRIORITY permit ip 10.0.0.0 0.255.255.255 any dscp ef permit ip 10.0.0.0 0.255.255.255 any dscp cs5! Classify specific user subnet (e.g., executive VLAN)ip access-list extended ACL-EXEC-VLAN permit ip 10.10.50.0 0.0.0.255 anyPart 2 โ IP SLA Probes
! Probe ISP-A gateway every 5 secondsip sla 1 icmp-echo 203.0.113.1 source-interface GigabitEthernet0/0 frequency 5 threshold 500 timeout 2000ip sla schedule 1 life forever start-time now! Probe ISP-B gatewayip sla 2 icmp-echo 198.51.100.1 source-interface GigabitEthernet0/1 frequency 5 threshold 500 timeout 2000ip sla schedule 2 life forever start-time now! Track objects โ add delay to prevent flappingtrack 1 ip sla 1 reachability delay down 10 up 20track 2 ip sla 2 reachability delay down 10 up 20Part 3 โ PBR Route-Map with verify-availability
route-map RM-PBR-DUAL-ISP permit 10 description VoIP and real-time traffic -> ISP-A match ip address ACL-VOIP ACL-DSCP-PRIORITY set ip next-hop verify-availability 203.0.113.1 1 track 1 ! "verify-availability 203.0.113.1 1 track 1" ! Sequence 1, use this next-hop only if track 1 is Up set ip next-hop verify-availability 198.51.100.1 2 track 2 ! Fallback to ISP-B if ISP-A track is Downroute-map RM-PBR-DUAL-ISP permit 20 description Executive VLAN -> ISP-B primary match ip address ACL-EXEC-VLAN set ip next-hop verify-availability 198.51.100.1 1 track 2 set ip next-hop verify-availability 203.0.113.1 2 track 1route-map RM-PBR-DUAL-ISP permit 30 description Everything else -> follow routing table ! No set statement = falls through to normal routing table! Apply to LAN-facing interface (where traffic enters the router)interface GigabitEthernet0/2 description TO-LAN ip policy route-map RM-PBR-DUAL-ISPWarning: PBR applies to incoming packets on the interface. Apply it to the LAN-facing interface, not the WAN interfaces. Applying to WAN interfaces affects return traffic incorrectly.
Part 4 โ PBR for Local Traffic (Router-Originated)
By default, ip policy on an interface doesn't affect traffic the router itself generates (BGP updates, SNMP, NTP). Use ip local policy for that.
! Make the router's own management traffic use ISP-B (out-of-band)ip access-list extended ACL-ROUTER-MGMT permit tcp host 10.0.0.1 any eq 22 ! SSH from router permit udp host 10.0.0.1 any eq 161 ! SNMProute-map RM-LOCAL-PBR permit 10 match ip address ACL-ROUTER-MGMT set ip next-hop 198.51.100.1ip local policy route-map RM-LOCAL-PBRPart 5 โ Verify PBR is Working
! Show PBR hit counters per route-map clauseR1# show route-map RM-PBR-DUAL-ISP! "Policy routing matches: X packets, Y bytes" per permit statement! If counter is 0, the ACL isn't matching any traffic โ check ACL! Debug PBR in real time (use sparingly โ can be verbose)R1# debug ip policy! Shows each packet being evaluated, which clause matched, which next-hop set! Show track state (IP SLA result)R1# show track! "Track 1 ... State: Up" = ISP-A reachable, PBR will use it! "Track 1 ... State: Down" = ISP-A unreachable, PBR falls to sequence 2! Show IP SLA statisticsR1# show ip sla statistics 1! "Latest operation return code: OK" = probe succeeding! "Number of successes: NNN, failures: NNN"Real-World Scenario
The situation: A branch office has two ISP links. VoIP calls through ISP-B (secondary) have 30ms jitter and drop every 10 minutes. ISP-A (primary) has 2ms jitter and no drops. The routing table shows all traffic going via ISP-A, but VoIP is still going via ISP-B.
Root cause investigation:
R1# show route-map RM-PBR-DUAL-ISP! Policy routing matches: 0 packets โ PBR not matching anything!R1# show ip policy! Interface GigabitEthernet0/2 (LAN): route-map RM-PBR-DUAL-ISP! Looks correct... check the ACLR1# show ip access-lists ACL-VOIP! "permit udp 10.0.0.0 0.255.255.255 any range 16384 32767 (0 matches)"! Zero matches โ the VoIP source IPs are 192.168.10.x not 10.0.0.x! Fix: correct the source subnet in the ACLip access-list extended ACL-VOIP no permit udp 10.0.0.0 0.255.255.255 any range 16384 32767 permit udp 192.168.10.0 0.0.0.255 any range 16384 32767R1# show route-map RM-PBR-DUAL-ISP! Policy routing matches: 847 packets โ VoIP now being steered to ISP-ATroubleshooting
PBR configured but traffic still using routing table
Symptom: show route-map shows 0 matches. Traffic using default route, not PBR next-hop.
Cause: ACL not matching โ wrong source IP, interface applied to wrong direction, or ip policy on wrong interface.
Fix:
! Verify ACL matches with a test packetR1# show ip access-lists ACL-VOIP! Check the "matches" counter after sending some VoIP traffic! Verify policy applied to correct interfaceR1# show ip policy! Must show the LAN-facing interface, not the WANverify-availability: PBR sending to down next-hop
Symptom: ISP link is physically up but SLA probe fails. Traffic still being sent to that next-hop.
Cause: IP SLA probe sending from wrong source interface, or probe target is firewalled.
Fix:
ip sla 1 icmp-echo 203.0.113.1 source-interface GigabitEthernet0/0 ! Source must be the interface that faces ISP-A ! Without source-interface, probe may go out a different path! Test manuallyR1# ping 203.0.113.1 source GigabitEthernet0/0! If this succeeds but SLA fails: check timeout/threshold valuesPBR causes asymmetric routing โ return traffic takes different path
Symptom: Sessions established via PBR to ISP-A, but replies arrive via ISP-B. TCP sessions drop.
Cause: Routing table for source IP lookup uses default route via ISP-B. Return traffic bypasses PBR (PBR only applies inbound).
Fix:
! Apply PBR on both LAN-side interfaces! Or use NAT on each ISP interface so return traffic follows the same path! Per-source NAT (overload) on each ISP interface:interface GigabitEthernet0/0 ip nat outsideinterface GigabitEthernet0/1 ip nat outsideinterface GigabitEthernet0/2 ip nat inside! NAT policy: VoIP (PBR to ISP-A Gi0/0) uses ISP-A public IPip nat inside source route-map NAT-ISP-A interface GigabitEthernet0/0 overloadroute-map NAT-ISP-A permit 10 match ip address ACL-VOIP match interface GigabitEthernet0/0PBR + IP SLA Deployment Checklist
verify-availabilityused on every PBRset ip next-hopโ without it, PBR forwards to a dead next-hop- IP SLA source interface explicitly set โ probe must use the actual WAN interface, not a management path
delay down 10 up 20on track objects โ prevents flapping on momentary packet loss- Route-map permit 30 with no match/set โ catch-all to fall through to routing table for unmatched traffic
ip policyapplied to LAN-facing interface (inbound direction) โ NOT the WAN interfaceip local policyfor router-originated traffic if it also needs steering (NTP, BGP updates, SNMP)- PBR counters checked after deployment:
show route-mapโ every clause matching traffic should have non-zero counters - Return traffic symmetry verified โ if using multiple ISPs, ensure NAT pins return packets to the correct ISP
- Packet capture at ISP interfaces to verify VoIP actually using correct ISP before sign-off