Table Of Contents
BGP Route-Map Policy List Support
Prerequisites for Route-Map Policy List Support
Restrictions for Route-Map Policy List Support
Information About Route-Map Policy List Support
Policy Lists in a Route-Map Configuration
How Route-Map Policy Lists Work
How to Configure Route-Map Policy Lists
Policy Lists Simplify the Configuration of BGP Policy Routing
Creating a BGP Policy List that Matches the AS-path and MED
Creating a BGP Policy List that Matches a Community Using Regular Expression Filtering
Creating a BGP Policy List That Filters External Routes
Configuring a Route-Map to Reference a Policy List
Configuring Policy Lists in Route-Maps
Configuring a Route-Map with AND Semantics
Configuring a Route-Map with OR
Verifying the Configuration of Policy Lists Within Route-Maps
Configuration Examples for Route-Map Policy Lists
Configuring Policy List Examples
Configuring Route-Maps to Reference Policy Lists Examples
Verifying BGP Route-Map Policy List Support
BGP Route-Map Policy List Support
The BGP Route-Map Policy List Support feature introduces new functionality to Border Gateway Protocol (BGP) route maps. This feature adds the capability for a network operator to group route map match clauses into named lists called policy lists. A policy list functions like a macro. When a policy list is referenced in a route map, all of the match clauses are evaluated and processed as if they had been configured directly in the route map. This enhancement simplifies the configuration of BGP routing policy in medium-size and large networks because a network operator can preconfigure policy lists with groups of match clauses and then reference these policy lists within different route maps. The network operator no longer needs to manually reconfigure each recurring group of match clauses that occur in multiple route map entries.
Feature History for the BGP Route-Map Policy List Support Feature
Finding Support Information for Platforms and Cisco IOS Software Images
Use Cisco Feature Navigator to find information about platform support and Cisco IOS software image support. Access Cisco Feature Navigator at http://www.cisco.com/go/fn. You must have an account on Cisco.com. If you do not have an account or have forgotten your username or password, click Cancel at the login dialog box and follow the instructions that appear.
Contents
•
Prerequisites for Route-Map Policy List Support
•
Restrictions for Route-Map Policy List Support
•
Information About Route-Map Policy List Support
•
How to Configure Route-Map Policy Lists
•
Configuration Examples for Route-Map Policy Lists
Prerequisites for Route-Map Policy List Support
This document assumes that BGP is configured in your network and that neighbors have been established.
Restrictions for Route-Map Policy List Support
The following restrictions apply to the BGP Route-Map Policy List Support feature for this release:
IPv6 Not Supported
This feature does not support the configuration of IP version 6 (IPv6) match clauses in policy-lists.
Not Supported by Older Releases
Policy lists are not supported in versions of Cisco IOS Software prior to Cisco IOS Release 12.0(22)S and 12.2(15)T. Reloading a router that is running an older version of Cisco IOS software may cause some routing policy configurations to be lost.
Set Clauses Not Supported
Policy lists support only match clauses and do not support set clauses. However, policy lists can coexist, within the same route map entry, with match and set clauses that are configured separately from the policy lists.
Not Supported by General IP Policy Routing
Policy lists are supported only by BGP. They are not supported by other IP routing protocols. This limitation does not interfere with normal operations of a route map, including redistribution, because policy list functions operate transparently within BGP and are not visible to other IP routing protocols.
Information About Route-Map Policy List Support
To configure this feature, you must understand the following concepts:
•
Policy Lists in a Route-Map Configuration
•
How Route-Map Policy Lists Work
Policy Lists in a Route-Map Configuration
This feature introduces policy-list configuration mode and the ip policy-list command that is used to configure policy lists. A policy list is like a route map that contains only match clauses. The policy list is created and then referenced within a route map. There are no changes to match clause semantics and route map functions. Match clauses are configured in policy lists with permit and deny statements. The route map evaluates and processes each match clause and permits or denies routes based on the configuration. AND and OR semantics in the route map function the same way for policy-lists as they do for match and set clauses. This feature also introduces the match policy-list command to route-map configuration mode. The match policy-list command is used to reference a policy list within a route map for evaluation.
How Route-Map Policy Lists Work
A policy lists functions like a macro when it is configured in a route map and has the following capabilities and characteristics:
•
When a policy list is referenced within a route map, all the match statements within the policy list are evaluated and processed.
•
Two or more policy lists can be configured with a route map. Policy- lists can be configured within a route map to be evaluated with AND or OR semantics.
•
Policy lists can also coexist with any other preexisting match and set statements that are configured within the same route map but outside of the policy lists.
•
When multiple policy lists perform matching within a route map entry, all policy lists match on the incoming attribute only.
Policy lists support only match clauses and do not support set clauses. Policy lists can be configured for all applications of route maps, including redistribution, and can also coexist, within the same route map entry, with match and set clauses that are configured separately from the policy lists.
Note
Policy lists are supported only by BGP and not supported by other IP routing protocols.
How to Configure Route-Map Policy Lists
This section contains the following procedures:
•
Configuring a Route-Map to Reference a Policy List
•
Verifying the Configuration of Policy Lists Within Route-Maps
Creating a BGP Policy List
To configure a route-map policy list, perform the steps in this section.
Policy Lists Simplify the Configuration of BGP Policy Routing
Policy lists simplify the configuration of BGP routing policy in medium-size and large networks. The network operator can reference preconfigured policy lists with groups of match clauses in route maps and easily apply general changes to BGP routing policy. The network operator no longer needs to manually reconfigure each recurring group of match clauses that occur in multiple route map entries.
Prerequisites
This document assumes that BGP is configured in your network and that neighbors have been established.
Restrictions
The following restrictions apply to the BGP Route-Map Policy List Support feature:
•
This feature does not support the configuration of IP version 6 (IPv6) match clauses in policy-lists.
•
Policy lists are not supported in versions of Cisco IOS Software prior to Cisco IOS Release 12.0(22)S and 12.2(15)T. Reloading a router that is running an older version of Cisco IOS software may cause some routing policy configurations to be lost.
•
Policy lists support only match clauses and do not support set clauses. However, policy lists can coexist, within the same route map entry, with match and set clauses that are configured separately from the policy lists.
•
Policy lists are supported only by BGP. They are not supported by other IP routing protocols. This limitation does not interfere with normal operations of a route map, including redistribution, because policy list functions operate transparently within BGP and are not visible to other IP routing protocols.
Creating a BGP Policy List that Matches the AS-path and MED
To create a BGP policy list that matches the autonomous system path and Multi Exit Discriminator (MED) of a router, use the following steps:
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
ip policy-list policy-list-name {permit | deny}
4.
match as-path as-number
5.
match metric metric
6.
end
DETAILED STEPS
Creating a BGP Policy List that Matches a Community Using Regular Expression Filtering
To create a BGP policy list that matches the specified BGP community using a regular expression and the next hop of a router, use the following steps:
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
ip policy-list policy-list-name {permit | deny}
4.
match community regular-expression
5.
match ip next-hop ip-address
6.
end
DETAILED STEPS
Creating a BGP Policy List That Filters External Routes
To create a BGP policy list to deny external routes and routes with the specified tag, use the following steps:
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
ip policy-list policy-list-name {permit | deny}
4.
match route-type external
5.
match tag tag-value
6.
end
DETAILED STEPS
What to Do Next
The next step is to create a route-map to reference the policy lists. For more information, refer to the next section "Configuring a Route-Map to Reference a Policy List."
Configuring a Route-Map to Reference a Policy List
To configure a route-map to reference a policy list, perform the steps in this section.
Configuring Policy Lists in Route-Maps
Policy lists support only match clauses and do not support set clauses. However, policy lists can coexist, within the same route map entry, with match and set clauses that are configured separately from the policy lists. The first route-map example configures AND semantics, and the second route-map configuration example configures semantics. Both examples in this section show sample route map configurations that reference policy lists and separate match and set clauses in the same configuration.
Prerequisites
The steps in this section assume that policy lists have already been created.
Configuring a Route-Map with AND Semantics
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
route-map route-map-name [permit I deny] [sequence-number]
4.
match ip-address access-list-number
5.
match policy-list policy-list-name
6.
set community {community-number [additive] | none}
7.
set local-preference preference-value
8.
end
DETAILED STEPS
Configuring a Route-Map with OR
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
route-map route-map-name [permit | deny] [sequence-number]
4.
match policy-list policy-list-name
5.
set community {community-number [additive] | none}
6.
set local-preference preference-value
7.
end
DETAILED STEPS
Verifying the Configuration of Policy Lists Within Route-Maps
To verify the configuration of policy lists, and verify the configuration of route-map to reference a policy list, perform the steps in this section.
Verifying With Show Commands
The ouyput from both of the show commands in this section can be filtered to display information about a single policy-list or route-map by entering the name of a route-map or policy at the end of each show command.
SUMMARY STEPS
1.
enable
2.
show ip policy-list [policy-list-name]
3.
show route-map [route-map-name]
DETAILED STEPS
Configuration Examples for Route-Map Policy Lists
The following examples illustrate the configuration and verification of this feature:
•
Configuring Policy List Examples
•
Configuring Route-Maps to Reference Policy Lists Examples
•
Verifying BGP Route-Map Policy List Support
Configuring Policy List Examples
The following configuration example creates a BGP policy list that permits matches on the autonomous system path and MED of a router:
Router(config)# ip policy-list POLICY-LIST-NAME-1 permitRouter(config-policy-list)# match as-path 1Router(config-policy-list)# match metric 10Router(config-policy-list)# endThe following configuration example creates a BGP policy list that permits matches on the specified BGP community and the next hop of a router:
Router(config)# ip policy-list POLICY-LIST-NAME-2 permitRouter(config-policy-list)# match community 20Router(config-policy-list)# match metric 10Router(config-policy-list)# ip community-list 20 permit 20:1Router(config-policy-list)# endThe following configuration example creates a BGP policy list that denies matches on the specified BGP community and the next hop of a router:
Router(config)# ip policy-list POLICY-LIST-NAME-3 denyRouter(config-policy-list)# match community 20Router(config-policy-list)# match metric 10Router(config-policy-list)# endConfiguring Route-Maps to Reference Policy Lists Examples
The configuration examples in this section create BGP route maps that reference BGP policy lists with the route-map route-map configuration command.
The following configuration example creates a route map that references policy lists and separate match and set clauses in the same configuration. This example uses AND semantics between POLICY-LIST-NAME-1 and POLICY-LIST-NAME-2.
Router(config)# route-map MAP-NAME-1 10Router(config-route-map)# match ip-address 1Router(config-route-map)# match policy-list POLICY-LIST-NAME-1Router(config-route-map)# match policy-list POLICY-LIST-NAME-2Router(config-route-map)# set community 10:1Router(config-route-map)# set local-preference 140Router(config-route-map)# endThe following configuration example creates a route map that references policy lists and separate match and set clauses in the same configuration. This example uses OR semantics between POLICY-LIST-NAME-3 and POLICY-LIST-NAME-4.
Router(config)# route-map MAP-NAME-2 10Router(config-route-map)# match policy-list POLICY-LIST-NAME-3 POLICY-LIST-NAME-4Router(config-route-map)# set community 10:1Router(config-route-map)# set local-preference 140Router(config-route-map)# endVerifying BGP Route-Map Policy List Support
To verify that a policy list has been created, use the show ip policy-list command. The output of this command will display the policy-list name and configured match clauses. The following sample output is similar to the output that will be displayed:
Router# show ip policy-listpolicy-list POLICY-LIST-NAME-1 permitMatch clauses:metric 20policy-list POLICY-LIST-NAME-2 permitMatch clauses:as-path (as-path filter): 1
Note
A policy list name can be specified when the show ip policy-list command is entered. This option can be useful for filtering the output of this command and verifying a single policy list.
To verify that a route map has been created and a policy list is referenced, use the show route-map command. The output of this command will display the route map name and policy lists that are referenced by the configured route maps. The following sample output is similar to the output that will be displayed:
Router# show route-maproute-map ROUTE-MAP-NAME-1, deny, sequence 10Match clauses:Set clauses:Policy routing matches: 0 packets, 0 bytesroute-map ROUTE-MAP-NAME-1, permit, sequence 10Match clauses:IP Policy lists:POLICY-LIST-NAME-1Set clauses:Policy routing matches: 0 packets, 0 bytesRelated Documents
Related Topic Document TitleBGP commands
Cisco IOS Release 12.0 Network Protocols Command Reference, Part 1
Cisco IOS IP Command Reference, Volume 2 of 3: Routing Protocols, Release 12.2
Cisco IOS IP Command Reference, Volume 2 of 4: Routing Protocols, Release 12.3
BGP configuration tasks
Cisco IOS Release 12.0 Network Protocols Configuration Guide, Part 1
Cisco IOS IP Configuration Guide, Release 12.2
Cisco IOS IP Configuration Guide, Release 12.3
Standards
Standards TitleNo new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature.
—
MIBs
RFCs
Technical Assistance
Description LinkTechnical Assistance Center (TAC) home page, containing 30,000 pages of searchable technical content, including links to products, technologies, solutions, technical tips, and tools. Registered Cisco.com users can log in from this page to access even more content.
TAC Home Page:
http://www.cisco.com/public/support/tac/home.shtml
BGP Support Page:
http://www.cisco.com/cgi-bin/Support/browse/psp_view.pl?p=Internetworking:BGP
Command Reference
This section documents new and modified commands. All other commands used with this feature are documented in the Cisco IOS command reference publications.
New Commands
•
show ip policy-list
Modified Commands
•
show route-map
match policy-list
To configure a route map to evaluate and process a Border Gateway Protocol (BGP) policy list in a route map, use the match policy-list command in route-map configuration mode. To remove a path list entry, use the no form of this command.
match policy-list policy-list-name
no match policy-list policy-list-name
Syntax Description
Defaults
This command is not enabled by default.
Command Modes
Route-map configuration
Command History
Release Modification12.0(22)S
This command was introduced.
12.2(15)T
This command was integrated into 12.2(15)T.
12.2(27)SBC
This command was integrated into Cisco IOS Release 12.2(27)SBC.
Usage Guidelines
When a policy list is referenced within a route map, all the match statements within the policy list are evaluated and processed.
Two or more policy lists can be configured with a route map. Policy lists can be configured within a route map to be evaluated with AND semantics or OR semantics.
Policy lists can also coexist with any other preexisting match and set statements that are configured within the same route map but outside of the policy lists.
When multiple policy lists perform matching within a route map entry, all policy lists match on the incoming attribute only.
Examples
The following configuration example creates a route map that references policy lists and separate match and set clauses in the same configuration:
Router(config)# route-map MAP-NAME-1 10Router(config-route-map)# match ip-address 1Router(config-route-map)# match policy-list POLICY-LIST-NAME-1Router(config-route-map)# set community 10:1Router(config-route-map)# set local-preference 140Router(config-route-map)# endThe following configuration example creates a route map that references policy lists and separate match and set clauses in the same configuration. This example processes the policy lists named POLICY-LIST-NAME-2 and POLICY-LIST-NAME-3 with OR semantics. A match is required from only one of the policy lists.
Router(config)# route-map MAP-NAME-2 10Router(config-route-map)# match policy-list POLICY-LIST-NAME-2 POLICY-LIST-NAME-3Router(config-route-map)# set community 10:1Router(config-route-map)# set local-preference 140Router(config-route-map)# endRelated Commands
show route-map
To display static and dynamic route maps, use the show route-map command in privileged EXEC mode.
show route-map [map-name | dynamic [dynamic-map-name | application [application-name]] | all] [detailed]
Syntax Description
Command Modes
Privileged EXEC
Command History
Usage Guidelines
For Cisco IOS Release 12.3(14)T and later 12.4 and 12.4T releases, you can display the ACL-specific information that pertains to the route map in the same display without having to execute a show route-map command to display each ACL that is associated with the route map.
Examples
The show route-map command will display configured route-maps, match, set, and continue clauses. The output will vary depending on which keywords are included with the command, and which software image is running in your router.
show route-map Command with No Keywords Specified Example
The following is sample output from the show route-map command:
Router# show route-maproute-map ROUTE-MAP-NAME, permit, sequence 10Match clauses:ip address (access-lists): 1metric 10Continue: sequence 40Set clauses:as-path prepend 10Policy routing matches: 0 packets, 0 bytesroute-map ROUTE-MAP-NAME, permit, sequence 20Match clauses:ip address (access-lists): 2metric 20Set clauses:as-path prepend 10 10Policy routing matches: 0 packets, 0 bytesroute-map ROUTE-MAP-NAME, permit, sequence 30Match clauses:Continue: to next entry 40Set clauses:as-path prepend 10 10 10Policy routing matches: 0 packets, 0 bytesroute-map ROUTE-MAP-NAME, deny, sequence 40Match clauses:community (community-list filter): 20:2Set clauses:local-preference 100Policy routing matches: 0 packets, 0 bytesroute-map LOCAL-POLICY-MAP, permit, sequence 10Match clauses:Set clauses:community 655370Policy routing matches: 0 packets, 0 bytesThe following example shows Multiprotocol Label Switching (MPLS)-related route map information:
Router# show route-maproute-map OUT, permit, sequence 10Match clauses:ip address (access-lists): 1Set clauses:mpls labelPolicy routing matches: 0 packets, 0 bytesroute-map IN, permit, sequence 10Match clauses:ip address (access-lists): 2mpls labelSet clauses:Policy routing matches: 0 packets, 0 bytesTable 1 describes the significant fields shown in the display.
show route-map Command with Dynamic Route Map Specified Example
The following is sample output from the show route-map command when entered with the dynamic keyword:
Router# show route-map dynamicroute-map AAA-02/06/04-14:01:26.619-1-AppSpec, permit, sequence 0, identifier 1137954548Match clauses:ip address (access-lists): PBR#1 PBR#2Set clauses:Policy routing matches: 0 packets, 0 bytesroute-map AAA-02/06/04-14:01:26.619-1-AppSpec, permit, sequence 1, identifier 1137956424Match clauses:ip address (access-lists): PBR#3 PBR#4Set clauses:Policy routing matches: 0 packets, 0 bytesroute-map AAA-02/06/04-14:01:26.619-1-AppSpec, permit, sequence 2, identifier 1124436704Match clauses:ip address (access-lists): PBR#5 PBR#6length 10 100Set clauses:ip next-hop 172.16.1.1ip gateway 172.16.1.1Policy routing matches: 0 packets, 0 bytesCurrent active dynamic routemaps = 1The following is sample output from the show route-map command when entered with the dynamic and application keywords:
Router# show route-map dynamic applicationApplication - AAANumber of active routemaps = 1When you specify an application name, only dynamic routes for that application are shown. The following is sample output from the show route-map command when entered with the dynamic and application keywords and the AAA application name:
Router# show route-map dynamic application AAAAAANumber of active rmaps = 2AAA-02/06/04-14:01:26.619-1-AppSpecAAA-02/06/04-14:34:09.735-2-AppSpecRouter# show route-map dynamic AAA-02/06/04-14:34:09.735-2-AppSpecroute-map AAA-02/06/04-14:34:09.735-2-AppSpec, permit, sequence 0, identifier 1128046100Match clauses:ip address (access-lists): PBR#7 PBR#8Set clauses:Policy routing matches: 0 packets, 0 bytesroute-map AAA-02/06/04-14:34:09.735-2-AppSpec, permit, sequence 1, identifier 1141277624Match clauses:ip address (access-lists): PBR#9 PBR#10Set clauses:Policy routing matches: 0 packets, 0 bytesroute-map AAA-02/06/04-14:34:09.735-2-AppSpec, permit, sequence 2, identifier 1141279420Match clauses:ip address (access-lists): PBR#11 PBR#12length 10 100Set clauses:ip next-hop 172.16.1.12ip gateway 172.16.1.12Policy routing matches: 0 packets, 0 bytesCurrent active dynamic routemaps = 2show route-map Command with Detailed ACL Information for Route Maps Specified Example
The following is sample output from the show route-map command with the dynamic and detailed keywords entered:
Router# show route-map dynamic detailedroute-map AAA-01/20/04-22:03:10.799-1-AppSpec, permit, sequence 1, identifier 29675368Match clauses:ip address (access-lists):Extended IP access list PBR#31 permit icmp 0.0.16.12 1.204.167.240 8.1.1.0 0.0.0.255 syn dscp af12 log-input fragmentsExtended IP access list PBR#41 permit icmp 0.0.16.12 1.204.167.240 8.1.1.0 0.0.0.255 syn dscp af12 log-input fragmentsSet clauses:ip next-hop 172.16.1.14ip gateway 172.16.1.14Policy routing matches: 0 packets, 0 bytesRelated Commands
Copyright © 2005 Cisco Systems, Inc. All rights reserved.

