About Route Policy Manager
Route Policy Manager supports route maps and IP prefix lists. These features are used for route redistribution. A prefix list contains one or more IPv4 or IPv6 network prefixes and the associated prefix length values. You can use a prefix list by itself in features such as Border Gateway Protocol (BGP) templates, route filtering, or redistribution of routes that are exchanged between routing domains.
Route maps can apply to both routes and IP packets. Route filtering and redistribution pass a route through a route map.
Prefix Lists
You can use prefix lists to permit or deny an address or range of addresses. Filtering by a prefix list involves matching the prefixes of routes or packets with the prefixes listed in the prefix list. An implicit deny is assumed if a given prefix does not match any entries in a prefix list.
You can configure multiple entries in a prefix list and permit or deny the prefixes that match the entry. Each entry has an associated sequence number that you can configure. If you do not configure a sequence number, Cisco NX-OS assigns a sequence number automatically. Cisco NX-OS evaluates prefix lists starting with the lowest sequence number. Cisco NX-OS processes the first successful match for a given prefix. Once a match occurs, Cisco NX-OS processes the permit or deny statement and does not evaluate the rest of the prefix list.
Note |
An empty prefix list permits all routes. |
Prefix List Masks
Cisco NX-OS supports masks for IPv4 and IPv6 prefix lists. Masking uses the number 1 and the number 0 to specify how the software treats the corresponding IP address bits.
-
A mask bit 0 means ignore the corresponding bit value.
-
A mask bit 1 means check the corresponding bit value for an exact match.
You can use a prefix list to match the IP address in a route map, which in turn is used in routing protocols during redistribution. The IP address is matched against the prefix list, where the bits corresponding to the mask bit 1 are the same as the subnet provided in the prefix list.
By carefully setting masks, you can select a single or several IP addresses for permit or deny tests.
The prefix list mask allows noncontiguous bits in the mask. You can thus define a range of even- or odd-numbered IP addresses.
Route Maps
You can use route maps for route redistribution. Route map entries consist of a list of match and set criteria. The match criteria specify match conditions for incoming routes or packets, and the set criteria specify the action taken if the match criteria are met.
You can configure multiple entries in the same route map. These entries contain the same route map name and are differentiated by a sequence number.
You create a route map with one or more route map entries arranged by the sequence number under a unique route map name. The route map entry has the following parameters:
-
Sequence number
-
Permission—permit or deny
-
Match criteria
-
Set changes
By default, a route map processes routes or IP packets in a linear fashion (that is, starting from the lowest sequence number). You can configure the route map to process in a different order using the continue statement, which allows you to determine which route map entry to process next.
Default Action for Sequences in a Route Map
The default action for any sequence in a route map is permit. The permit action is applied under the following situations:
-
When you configure a new sequence in a route map without explicitly specifying either permit or deny.
-
When you edit a configured sequence in a route map and do not specify an action. In this situation, the permit action is applied even if the edited route map was configured originally with deny. For example, assume sequence 10 was configured with deny. If you later edit sequence 10 without specifying deny again, the action for that sequence is set to permit.
When configuring or editing a sequence of a route map, always set the correct action. Failure to do so causes the default action, permit , to be applied.
Match Criteria
You can use a variety of criteria to match a route or IP packet in a route map. Some criteria, such as BGP community lists, are applicable only to a specific routing protocol while other criteria, such as the IP source or the destination address, can be used for any route or IP packet.
When Cisco NX-OS processes a route or packet through a route map, it compares the route or packet to each of the match statements configured. If the route or packet matches the configured criteria, Cisco NX-OS processes it based on the permit or deny configuration for that match entry in the route map and any set criteria configured.
The match categories and parameters are as follows:
-
BGP parameters—Match based on AS numbers, AS-path, community attributes, or extended community attributes.
-
Prefix lists—Match based on an address or range of addresses.
-
Multicast parameters—Match based on rendezvous point, groups, or sources.
-
Other parameters—Match based on IP next-hop address or packet length.
Set Changes
Once a route or packet matches an entry in a route map, the route or packet can be changed based on one or more configured set statements.
The set changes are as follows:
-
BGP parameters—Change the AS-path, tag, community, extended community, dampening, local preference, origin, or weight attributes.
-
Metrics—Change the route-metric or the route-type.
-
Other parameters—Change the forwarding address or the IP next-hop address.
Access Lists
IP access lists can match the packet to a number of IP packet fields such as the following:
-
Source or destination IPv4 or IPv6 address
-
Protocol
-
Precedence
-
ToS
-
You can use ACLs in a route map for policy-based routing only.
AS Numbers for BGP
You can configure a list of AS numbers to match against BGP peers. If a BGP peer matches an AS number in the list and matches the other BGP peer configuration, BGP creates a session. If the BGP peer does not match an AS number in the list, BGP ignores the peer. You can configure the AS numbers as a list or a range of AS numbers, or you can use an AS-path list to compare the AS numbers against a regular expression.
AS-Path Lists for BGP
You can configure an AS-path list to filter inbound or outbound BGP route updates. If the route update contains an AS-path attribute that matches an entry in the AS-path list, the router processes the route based on the permit or deny condition configured. You can configure AS-path lists within a route map.
You can configure multiple AS-path entries in an AS-path list by using the same AS-path list name. The router processes the first entry that matches.
Community Lists for BGP
You can filter BGP route updates based on the BGP community attribute by using community lists in a route map. You can match the community attribute based on a community list, and you can set the community attribute using a route map.
A community list contains one or more community attributes. If you configure more than one community attribute in the same community list entry, the BGP route must match all community attributes listed to be considered a match.
You can also configure multiple community attributes as individual entries in the community list by using the same community list name. In this case, the router processes the first community attribute that matches the BGP route, using the permit or deny configuration for that entry.
You can configure community attributes in the community list in one of the following formats:
-
A named community attribute, such as internet or no-export .
-
In aa:nn format, where the first two bytes represent the two-byte AS number and the last two bytes represent a user-defined network number.
-
A regular expression.
Extended Community Lists for BGP
Extended community lists support 4-byte AS numbers. You can configure community attributes in the extended community list in one of the following formats:
-
In aa4:nn format, where the first four bytes represent the four-byte AS number and the last two bytes represent a user-defined network number.
-
A regular expression.
Cisco NX-OS supports generic specific extended community lists, which provide similar functionality to regular community lists for four-byte AS numbers. You can configure generic specific extended community lists with the following properties:
-
Transitive—BGP propagates the community attributes across autonomous systems.
-
Nontransitive—BGP removes community attributes before propagating the route to another autonomous system.
Route Redistribution and Route Maps
You can use route maps to control the redistribution of routes between routing domains. Route maps match on the attributes of the routes to redistribute only those routes that pass the match criteria. The route map can also modify the route attributes during this redistribution using the set changes.
The router matches redistributed routes against each route map sequences. If there are multiple match statements under a route-map sequence, then the route must pass all the match criteria under that route-map sequence. If a route passes the match criteria defined in a route map sequence, then the set-actions defined in that sequences are executed. If the route does not match the criteria in a route-map sequence, then the router compares the route against subsequent route map sequence. This route evaluation against the route-map continues until a match is made, or the route is evaluated by all the sequences in the route map. Finally, if the route does not match against any of the route-map sequences, then the router denies acceptance of the route (for inbound route maps) or denies forwarding of the route (for outbound route maps).
Note |
When you redistribute BGP to IGP, iBGP is redistributed as well. To override this behavior, you must insert an additional deny statement into the route map. |