Configure Policy-Based Routing (PBR) to control where packets are output based on defined criteria and actions.
Configure PBR to enable policy-based routing on the switch. This feature allows you to control packet forwarding based on specific match criteria and routing policies.
By default, PBR is disabled on the switch. To enable PBR, you must create a route map that specifies the match criteria and the resulting action. Then, enable PBR for that route map on an interface. Packets that arrive on the specified interface and match the match clauses are subject to PBR.
Procedure
| 1. | Use the configure terminal command to enter global configuration mode. Example:
|
|
| 2. | Use the route-map map-tag [permit] [sequence number] command to define route maps that are used to control where packets are output, and enters route-map configuration mode. Example:
|
|
| 3. | Use the match IP address {access-list-number | access-list-name} [ access-list-number | ...access-list-name] command to match the source and destination IP addresses that are permitted by one or more standard or extended access lists. ACLs can match multiple source and destination IP addresses. Example:
If you do not specify a match command, the route map is applicable to all packets. |
|
| 4. | Configure the actions within the policy route map to define next-hop routing, VRF interfaces, or IP header precedence values for matching traffic. Use the exit command to return to global configuration mode. |
|
| 5. | Use the interfaceinterface-id command to enter interface configuration mode, and specify the interface to be configured. Example:
|
|
| 6. | Use the ip policy route-mapmap-tag command to enable PBR on a Layer 3 interface, and identify the route map to use. Example:
You can configure only one route map on an interface. However, you can have multiple route map entries with different sequence numbers. These entries are evaluated in the order of sequence number until the first match. If there is no match, packets are routed as usual. Use the exit command to return to global configuration mode. |
|
| 7. | (Optional) Use the ip local policy route-map map-tag command to enable local PBR to perform policy-based routing on packets originating at the switch. Example:
This applies only to packets generated by the switch, not incoming packets. Use the end command to return to privileged EXEC mode. |
|
| 8. | (Optional) Use the show commands to verify the configuration. |