About Policy-Based Routing
With policy-based routing, you can configure a defined policy for IPv4 and IPv6 traffic flows that lessens the reliance on routes derived from routing protocols. All packets received on an interface with policy-based routing enabled are passed through enhanced packet filters or route maps. The route maps dictate the policy that determines where to forward packets.
Policy-based routing includes the following features:
-
Source-based routing—Routes traffic that originates from different sets of users through different connections across the policy routers.
-
Quality of Service (QoS)—Differentiates traffic by setting the precedence or type of service (ToS) values in the IP packet headers at the periphery of the network and leveraging queuing mechanisms to prioritize traffic in the core or backbone of the network (see the Cisco Nexus 3600 NX-OS Quality of Service Configuration Guide).
-
Load sharing—Distributes traffic among multiple paths based on the traffic characteristics.
Policy Route Maps
Each entry in a route map contains a combination of match and set statements. The match statements define the criteria for whether appropriate packets meet the particular policy (that is, the conditions to be met). The set clauses explain how the packets should be routed once they have met the match criteria.
You can mark the route-map statements as permit or deny. You can interpret the statements as follows:
-
If the statement is marked as permit and the packets meet the match criteria, the set clause is applied. One of these actions involves choosing the next hop.
-
If a statement is marked as deny, the packets that meet the match criteria are sent back through the normal forwarding channels, and destination-based routing is performed.
-
If the statement is marked as permit and the packets do not match any route-map statements, the packets are sent back through the normal forwarding channels, and destination-based routing is performed.
Note |
Policy routing is specified on the interface that receives the packets, not on the interface from which the packets are sent. |
Set Criteria for Policy-Based Routing
The Cisco Nexus 3600 platform switches support the following set commands for route maps used in policy-based routing:
-
set {ip | ipv6} next-hop address1 [address2...] [load-share]
-
set interface null0
These set commands are mutually exclusive within the route-map sequence.
In the first command, the IP address specifies the adjacent next-hop router in the path toward the destination to which the packets should be forwarded. The first IP address associated with a currently up connected interface is used to route the packets.
Note |
You can optionally configure this command for next-hop addresses to load balance traffic for up to 32 IP addresses. In this case, Cisco NX-OS sends all traffic for each IP flow to a particular IP next-hop address. |
If the packets do not meet any of the defined match criteria, those packets are routed through the normal destination-based routing process.
Route-Map Processing Logic
When a packet is received on an interface that is configured with a route map, the forwarding logic processes each route-map statement according to the sequence number.
If the route-map statement encountered is a route-map...permit statement, the packet is matched against the criteria in the match command. This command may refer to an ACL that has one or more access control entries (ACEs). If the packet matches the permit ACEs in the ACL, the policy-based routing logic executes the action specified by the set command on the packet.
If the route-map statement encountered is a route-map... deny statement, the packet is matched against the criteria in the match command. This command may refer to an ACL that has one or more ACEs. If the packet matches the permit ACEs in the ACL, policy-based routing processing terminates, and the packet is routed using the default IP routing table.
Note |
The set command has no effect inside a route-map... deny statement. |
-
If the route-map configuration does not contain a match statement, the policy-based routing logic executes the action specified by the set command on the packet. All packets are routed using policy-based routing.
-
If the route-map configuration references a match statement but the match statement references a non-existing ACL or an existing ACL without any access control entries (ACEs), the packet is routed using the default routing table.
-
If the next-hop specified in the set {ip | ipv6} next-hop command is down, is not reachable, or is removed, the packet is routed using the default routing table.
Policy-Based Routing Filtering Options
You can identify traffic by using additional options. The following list includes most but not all additional filtering options.
Policy-based routing ACLs support the following additional filtering options:
-
Layer 3 source and/or destination address
-
TCP and UDP ports