Configuring IP Routing Protocol-Independent Features
Enabling Policy Routing (PBR)
IPC-374
Cisco IOS IP Configuration Guide
To define the criteria by which packets are examined to learn if they will be policy-routed, use either one
or both of the following commands in route-map configuration mode. No match clause in the route map
indicates all packets.
To set the precedence and specify where the packets that pass the match criteria are output, use the
following commands in route-map configuration mode:
Note The set ip next-hop and set ip default next-hop are similar commands but have a different order of
operations. Configuring the set ip next-hop command causes the system to use policy routing first and
then use the routing table. Configuring the set ip default next-hop causes the system to use the routing
table first and then policy route the specified next hop.
The precedence setting in the IP header determines whether, during times of high traffic, the packets will
be treated with more or less precedence than other packets. By default, the Cisco IOS software leaves
this value untouched; the header remains with the precedence value it had.
The precedence bits in the IP header can be set in the router when policy routing is enabled. When the
packets containing those headers arrive at another router, the packets are ordered for transmission
according to the precedence set, if the queueing feature is enabled. The router does not honor the
precedence bits if queueing is not enabled; the packets are sent in FIFO order.
You can change the precedence setting, using either a number or name. The names came from RFC791,
but are evolving. You can enable other features that use the values in the set ip precedence route-map
configuration command to determine precedence. Table 1 0 lists the possible numbers and their
corresponding name, from least important to most important.
Command Purpose
Router(config-route-map)# match length minimum-length
maximum-length
Matches the Level 3 length of the packet.
Router(config-route-map)# match ip address
{access-list-number | access-list-name}
[access-list-number | access-list-name]
Matches the destination IP address that is permitted by
one or more standard or extended access lists.
Command Purpose
Step1 Router(config-route-map)# set ip precedence number | name Sets the precedence value in the IP header.
Step2 Router(config-route-map)# set ip next-hop ip-address
[ip-address]
Specifies the next hop to which to route the
packet.
(It must be an adjacent router).
Step3 Router(config-route-map)# set interface interface-type
interface-number [... interface-type interface-number]
Specifies the output interface for the packet.
Step4 Router(config-route-map)# set ip default next-hop
ip-address [ip-address]
Specifies the next hop to which to route the
packet, if there is no explicit route for this
destination.
Note Like the set ip next-hop command, the
set ip default next-hop command needs
to specify an adjacent router.
Step5 Router(config-route-map)# set default interface
interface-type interface-number [... interface-type
interface-number]
Specifies the output interface for the packet, if
there is no explicit route for this destination.