42-8
Catalyst 4500 Series Switch, Cisco IOS Software Configuration Guide - Cisco IOS XE 3.9.xE and IOS 15.2(5)Ex
 
Chapter 42      Configuring Policy-Based Routing
Policy-Based Routing Configuration Tasks
To enable IPv4 PBR on an interface, perform this task:
Command Purpose
Step 1
Switch(config)# route-map map-tag [permit | 
deny] [sequence-number]
Defines a route map to control where packets are sent. This 
command puts the switch into route-map configuration mode.
Step 2
Switch(config-route-map)# match ip address 
{access-list-number | name} 
[...access-list-number | name] 
Specifies the match criteria. The match criteria take the form 
of one or more Standard or Extended IP access-lists. The 
access-lists can specify the source and destination IP 
addresses, protocol types, and port numbers.
Step 3
Switch(config-route-map)# set ip next-hop 
ip-address [... ip-address]
Specifies the next-hop IP address to which matching packets 
are sent. The next-hop IP address specified here must belong 
to a subnet that is directly connected to this switch.
If more than one next-hop IP address is specified, the first 
usable next-hop is chosen for routing matching packets. If the 
next-hop is (or becomes) unavailable for some reason, the 
next one in the list is chosen.
Step 4
Switch(config-route-map)# set ip next-hop 
verify-availability [next-hop-address-sequence 
track object]
(Optional) Configures the route map to verify the reachability 
of the tracked object.
Note This option is not supported for IPv6 traffic.
For information about defining new tracked object, see 
Verifying Next-Hop IP using Object Tracking , page 42-14
Step 5
Switch(config-route-map)# set ip next-hop 
recursive ip-address
Specifies a recursive next-hop IP address. 
Note The recursive next-hop can be a subnet that is not 
directly connected.
The set ip next-hop recursive command does not ensure that 
packets are routed through the recursive-next-hop if there is 
an intermediate node with a shorter route to the destination 
such that the route does not pass through the 
recursive-next-hop.
Step 6
Switch(config-route-map)# set interface 
interface-type interface-number
[... type number]
Specifies the output interface from which the packet will be 
sent. This action specifies that the packet is forwarded out of 
the local interface. The interface must be a Layer 3 interface 
(not a switchport).
Packets are forwarded on the specified interface only if one of 
the following conditions is met:
• The destination IP address in the packet lies within the IP 
subnet to which the specified interface belongs.
• The destination IP address in the packet is reachable 
through the specified interface (as per the IP routing 
table).
If the destination IP address on the packet does not meet 
either of these conditions, the packet is dropped. This action 
forces matching packets to be switched in software.k