- Information About Route Policy Manager
- Licensing Requirements for Route Policy Manager
- Prerequisites for Route Policy Manager
- Guidelines and Limitations
- Default Settings
- Configuring Route Policy Manager
- Verifying the Route Policy Manager Configuration
- Configuration Examples for Route Policy Manager
- Related Topics
- Additional References
- Feature History for Route Policy Manager
Configuring Route Policy Manager
This chapter describes how to configure the Route Policy Manager on the Cisco NX-OS device.
This chapter includes the following sections:
- Information About Route Policy Manager
- Licensing Requirements for Route Policy Manager
- Prerequisites for Route Policy Manager
- Guidelines and Limitations
- Default Settings
- Configuring Route Policy Manager
- Verifying the Route Policy Manager Configuration
- Configuration Examples for Route Policy Manager
- Related Topics
- Additional References
- Feature History for Route Policy Manager
Information About Route Policy Manager
Route Policy Manager supports route maps and IP prefix lists. These features are used for route redistribution and policy-based routing. 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 while policy based routing passes IP packets through a route map.
This section includes the following topics:
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.
MAC Lists
You can use MAC lists to permit or deny a MAC address or range of addresses. A MAC list consists of a list of MAC addresses and optional MAC masks. A MAC mask is a wild-card mask that is logically AND-ed with the MAC address when the route map matches on the MAC list entry. Filtering by a MAC list involves matching the MAC address of packets with the MAC addresses listed in the MAC list. An implicit deny is assumed if a given MAC address does not match any entries in a MAC list.
You can configure multiple entries in a MAC list and permit or deny the MAC addresses 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 MAC lists starting with the lowest sequence number. Cisco NX-OS processes the first successful match for a given MAC address. Once a match occurs, Cisco NX-OS processes the permit or deny statement and does not evaluate the rest of the MAC list.
Route Maps
You can use route maps for route redistribution or policy-based routing. 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:
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.
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:
- IP access lists—(For policy-based routing only). Match based on source or destination IP address, protocol, or QoS parameters.
- 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, the route-tag, or the route-type.
- Policy-based routing only—Change the interface or the default next-hop address.
- 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:
You can use ACLs in a route map for policy-based routing only. See the Cisco Nexus 7000 Series NX-OS Security Configuration Guide, Release 5.x, for more information on ACLs.
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, 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.
See the Cisco Nexus 7000 Series NX-OS Unicast Routing Command Reference, Release 5.x, for more information on regular expressions.
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 a user-defined network number.
- A regular expression.
See the Cisco Nexus 7000 Series NX-OS Unicast Routing Command Reference, Release 5.x, for more information on regular expressions.
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:
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 entry. If there are multiple match statements, the route must pass all of the match criteria. If a route passes the match criteria defined in a route map entry, the actions defined in the entry are executed. If the route does not match the criteria, the router compares the route against subsequent route map entries. Route processing continues until a match is made or the route is processed by all entries in the route map with no match. If the router processes the route against all entries in a route map with no match, the router accepts the route (inbound route maps) or forwards the route (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.
Policy-Based Routing
You can use policy-based routing to forward a packet to a specified next-hop address based on the source of the packet or other fields in the packet header. For more information, see Chapter17, “Configuring Policy-Based Routing”
Licensing Requirements for Route Policy Manager
The following table shows the licensing requirements for this feature:
Prerequisites for Route Policy Manager
Guidelines and Limitations
Route Policy Manager has the following configuration guidelines and limitations:
- An empty route map denies all the routes.
- An empty prefix list permits all the routes.
- Without any match statement in a route-map entry, the permission (permit or deny) of the route-map entry decides the result for all the routes or packets.
- If referred policies (for example, prefix lists) within a match statement of a route-map entry return either a no-match or a deny-match, Cisco NX-OS fails the match statement and processes the next route-map entry.
- When you change a route map, Cisco NX-OS holds all the changes until you exit from the route-map configuration submode. Cisco NX-OS then sends all the changes to the protocol clients to take effect.
- Because you can use a route map before you define it, verify that all your route maps exist when you finish a configuration change.
- You can view the route-map usage for redistribution and filtering. Each individual routing protocol provides a way to display these statistics.
- 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.
Default Settings
Table 16-1 lists the default settings for Route Policy Manager.
|
|
---|---|
Configuring Route Policy Manager
This section includes the following topics:
- Configuring IP Prefix Lists
- Configuring AS-path Lists
- Configuring Community Lists
- Configuring Extended Community Lists
- Configuring Route Maps
Note If you are familiar with the Cisco IOS CLI, be aware that the Cisco NX-OS commands for this feature might differ from the Cisco IOS commands that you would use.
Configuring IP Prefix Lists
IP prefix lists match the IP packet or route against a list of prefixes and prefix lengths. You can create an IP prefix list for IPv4 and create an IPv6 prefix list for IPv6.
You can configure the prefix list entry to match the prefix length exactly or to match any prefix with a length that matches the configured range of prefix lengths.
Use the ge and lt keywords to create a range of possible prefix lengths. The incoming packet or route matches the prefix list if the prefix matches and if the prefix length is greater than or equal to the ge keyword value (if configured) and less than or equal to the lt keyword value (if configured).
SUMMARY STEPS
2. { ip | ipv6 } prefix-list name description string
3. ip prefix-list name [ seq number ] [{ permit | deny } prefix {[ eq prefix-length ] | [ ge prefix-length ] [ le prefix-length ]}]
ipv6 prefix-list name [ seq number ] [{ permit | deny } prefix {[ eq prefix-length ] | [ ge prefix-length ] [ le prefix-length ]}]
DETAILED STEPS
The following example shows how to create an IPv4 prefix list with two entries and apply the prefix list to a BGP neighbor:
switch(config)# ip prefix-list allowprefix seq 10 permit 192.0.2.0/24 eq 24
switch(config)# ip prefix-list allowprefix seq 20 permit 209.165.201.0/27 eq 27
switch(config)# router bgp 65536:20
switch(config-router)# neighbor 192.0.2.1/16 remote-as 65535:20
switch(config-router-neighbor)# address-family ipv4 unicast
switch(config-router-neighbor-af)# prefix-list allowprefix in
Configuring MAC Lists
You can configure a MAC list to permit or deny a range of MAC addresses.
SUMMARY STEPS
2. mac-list name [ seq number ] { permit | deny } mac-address [ mac-mask ]
DETAILED STEPS
Configuring AS-path Lists
You can specify an AS-path list filter on both inbound and outbound BGP routes. Each filter is an access list based on regular expressions. If the regular expression matches the representation of the AS-path attribute of the route as an ASCII string, the permit or deny condition applies.
SUMMARY STEPS
2. ip as-path access-list name { deny | permit } expression
DETAILED STEPS
|
|
|
---|---|---|
The following example shows how to create an AS-path list with two entries and apply the AS path list to a BGP neighbor:
switch(config)# ip as-path access-list AllowAS permit 64510
switch(config)# ip as-path access-list AllowAS permit 64496
switch(config)# copy running-config startup-config
Configuring Community Lists
You can use community lists to filter BGP routes based on the community attribute. The community number consists of a 4-byte value in the aa:nn format. The first two bytes represent the autonomous system number, and the last two bytes represent a user-defined network number.
When you configure multiple values in the same community list statement, all community values must match to satisfy the community list filter. When you configure multiple values in separate community list statements, the first list that matches a condition is processed.
Use community lists in a match statement to filter BGP routes based on the community attribute.
SUMMARY STEPS
2. ip community-list standard list-name { deny | permit } [community-list] [ internet ] [ local-AS ] [ no-advertise ] [ no-export ]
ip community-list expanded list-name { deny | permit } expression
DETAILED STEPS
The following example shows how to create a community list with two entries:
switch(config)# ip community-list standard BGPCommunity permit no-advertise 65536:20
switch(config)# ip community-list standard BGPCommunity permit local-AS no-export
Configuring Extended Community Lists
You can use extended community lists to filter BGP routes based on the community attribute. The community number consists of a 6-byte value in the aa4:nn format. The first four bytes represent the autonomous system number, and the last two bytes represent a user-defined network number.
When you configure multiple values in the same extended community list statement, all extended community values must match to satisfy the extended community list filter. When you configure multiple values in separate extended community list statements, the first list that matches a condition is processed.
Use extended community lists in a match statement to filter BGP routes based on the extended community attribute.
SUMMARY STEPS
2. ip extcommunity-list standard list-name { deny | permit } 4bytegeneric { transitive | non-transitive } aa4:nn
ip extcommunity-list expanded list-name { deny | permit } expression
DETAILED STEPS
The following example shows how to create a generic specific extended community list:
Configuring Route Maps
You can use route maps for route redistribution or route filtering. Route maps can contain multiple match criteria and multiple set criteria.
Configuring a route map for BGP triggers an automatic soft clear or refresh of BGP neighbor sessions.
SUMMARY STEPS
DETAILED STEPS
You can configure the following optional match parameters for route maps in route-map configuration mode:
Note The default-information originate command ignores match statements in the optional route map.
You can configure the following optional set parameters for route maps in route-map configuration mode:
The set metric-type internal command affects an outgoing policy and an eBGP neighbor only. If you configure both the metric and metric-type internal commands in the same BGP peer outgoing policy, Cisco NX-OS ignores the metric-type internal command.
Verifying the Route Policy Manager Configuration
To display route policy manager configuration information, perform one of the following tasks:
|
|
---|---|
Configuration Examples for Route Policy Manager
This example shows how to use an address family to configure Route Policy Manager so that any unicast and multicast routes from neighbor 209.0.2.1 are accepted if they match prefix-list AllowPrefix:
match ip address prefix-list AllowPrefix
Related Topics
The following topics can give more information on Route Policy Manager:
Additional References
For additional information related to implementing IP, see the following sections:
Related Documents
|
|
---|---|
Cisco Nexus 7000 Series NX-OS Unicast Routing Command Reference, Release 5.x |
|
Cisco Nexus 7000 Series NX-OS Virtual Device Context Configuration Guide, Release 5.x |
Standards
|
|
---|---|
No new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature. |
Feature History for Route Policy Manager
Table 16-2 lists the release history for this feature.