3.2.d Describe policy-based routing

ENCOR 350-401 v1.2 · 3.0 Infrastructure

Normal routing looks only at the destination. Policy-based routing (PBR) lets a router forward selected traffic by other rules, such as the source subnet, the application or the packet size, overriding the routing table for that traffic only. ENCOR expects you to describe how it is built and where it is used.

What you must know

How PBR works

A route map is applied inbound on the interface where the traffic arrives. Each sequence matches traffic (usually with an ACL) and sets where it goes. Traffic that matches no permit sequence, or is denied, is routed normally. ip local policy route-map applies PBR to traffic the router itself generates.

ip access-list extended GUESTS
 permit ip 10.50.0.0 0.0.255.255 any
!
route-map PBR-GUESTS permit 10
 match ip address GUESTS
 set ip next-hop 198.51.100.1
!
interface GigabitEthernet0/1
 ip policy route-map PBR-GUESTS

Guests are steered to ISP B (1); staff traffic is routed normally (2).

Variants and cautions

CommandBehaviour
set ip next-hopUse this next hop first, even if the routing table has a route
set ip default next-hopUse it only if the routing table has no explicit route (other than the default)
set interfaceSend out this interface (point-to-point links)
set ip next-hop verify-availabilitySkip the next hop if a tracked object or CDP says it is down

PBR is invisible in the routing table, which makes troubleshooting harder, and return traffic may take another path (asymmetric routing through stateful firewalls). Document it and add tracking so a dead next hop does not black-hole traffic.

Commands

show route-mapEach sequence with its match and set clauses and packet counts.
show ip policyInterfaces with PBR applied.
debug ip policyEach packet's policy decision (use carefully).

Exam traps

Check yourself

On which interface do you apply PBR for guest traffic leaving to the internet?
Inbound on the interface where guest traffic enters the router.
set ip default next-hop versus set ip next-hop?
Default next-hop only applies when the routing table has no explicit route; next-hop overrides the table.

More topics in 3.0 Infrastructure