This command will define that the router will use PBR and that the PBR will use route-map named TEST.
Defines a route map with name TEST. You don’t need to put sequence number 10 after permit. If you do not put it, router will generate it starting from 10 and give every next route map a sequence number increased by 10. It’s just saying in which order sequences with match criteria will be processed. Remember : One interface can have only one route map. In this case TEST. You can have multiple route map entries, each with its own sequence number. Entries are processed in order until the first match.
Please remember: If you do not specify a match command, the route map applies to all packets.
The next thing to define is what will PBR do with the packets that match the criteria in access list.
Sets precedence value in the IP header. You can specify either the precedence number or name.
Sets the `Don’t Fragment’ (DF) bit in the ip header.
Sets the VPN Routing and Forwarding (VRF) instance.
Sets next hop to which to route the packet.
Sets next hop to which to route the packet if the hop is to a router which is not adjacent.
Sets output interface for the packet.
Sets next hop to which to route the packet if there is no explicit route for this destination.
Sets output interface for the packet if there is no explicit route for this destination.
Next we need to define the interface where will the PBR wait for packets to enter in the process of policy based routing. By attaching PBR for that route map on selected interface the router knows which packets arriving on what interface will be subject to PBR rule that we created above.
Fast switching PBR will be applied only to PRB policies that are set prior to enabling it. It you define some other PBR policies later you will need to enable fast switching PBR again.
…will show you which route map is used for local PBR, if any.
PBR is supported in the Cisco Express Forwarding – CEF. CEF-switched PBR is faster than fast-switched PBR. The ip route-cache policy is command used for fast-switched PBR and you don’t need it for CEF-switched PBR.
We want that for example packet that is sourced from host A to server is crossing router R2 on its way, and that packets from host B are going to the same server but across router R3. We are also defining precedence in the packet header with set ip precedence command.
One important thing to mention here is the usage of the match statement. If you use more than one match inside one map sequence number (10 in our example in tab 2) every match must be matched if set statements will be processed.