cc/td/doc/product/software/ios122/122newft/122t
hometocprevnextglossaryfeedbacksearchhelp
PDF

Table of Contents

BGP Route-Map Policy List Support
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
Command Reference
ip policy-list
match policy-list
show ip policy-list
show route-map

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

Release Modification

12.0(22)S

This feature was introduced.

12.2(15)T

This feature was integrated.

12.2(18)S

This feature was integrated.

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

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:

Configuring Policy Lists in a Route-Map

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:

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:

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:

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

  Command or Action  Purpose 
Step 1 
enable

Example:

Router> enable

Enables privileged EXEC mode.

  • Enter your password if prompted.
Step 2 
configure terminal

Example:

Router# configure terminal

Enters global configuration mode.

Step 3 
ip policy-list policy-list-name {permit | deny}

Example:

Router(config)# ip policy-list policy-list-name permit

Enters policy-list configuration mode and creates a BGP policy list that will permit routes that are allowed by the match clauses that follow.

Step 4 
match as-path as-number

Example:

Router(config-policy-list)# match as-path as-number

Creates a match clause to permit routes from the specified autonomous system path.

Step 5 
match metric metric

Example:

Router(config-policy-list)# match metric metric

Creates a match clause to permit routes with the specified metric.

Step 6 
end

Example:

Router(config-policy-list)# end

Exits policy-list configuration mode and enters privileged EXEC mode.

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 Example

SUMMARY STEPS

1. enable

2. configure terminal

3. route-map route-map-name permit sequence-number

4. match ip-address access-list-number

5. match policy-list policy-list-name

6. set community community-number

7. end

DETAILED STEPS

Configuring a Route-Map with OR Semantics Example

SUMMARY STEPS

1. enable

2. configure terminal

3. route-map route-map-name permit sequence-number

4. match policy-list policy-list-name

5. set community community-number

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 ouput from both of the show commands in the 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

3. show route-map

DETAILED STEPS

Configuration Examples for Route-Map Policy Lists

The following examples illustrate the configuration and verification of this feature:

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 permit 
Router(config-policy-list)# match as-path 1
Router(config-policy-list)# match metric 10
Router(config-policy-list)# end

The 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 permit 
Router(config-policy-list)# match community 20
Router(config-policy-list)# match metric 10
Router(config-policy-list)# ip community-list 20 permit 20:1
Router(config-policy-list)# end

The 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 deny 
Router(config-policy-list)# match community 20
Router(config-policy-list)# match metric 10
Router(config-policy-list)# end

Configuring 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 10
Router(config-route-map)# match ip-address 1
Router(config-route-map)# match policy-list POLICY-LIST-NAME-1 
Router(config-route-map)# match policy-list POLICY-LIST-NAME-2 
Router(config-route-map)# set community 10:1
Router(config-route-map)# set local-preference 140
Router(config-route-map)# end

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 OR semantics between POLICY-LIST-NAME-3 and POLICY-LIST-NAME-4.

Router(config)# route-map MAP-NAME-2 10
Router(config-route-map)# match policy-list POLICY-LIST-NAME-3 POLICY-LIST-NAME-4
Router(config-route-map)# set community 10:1
Router(config-route-map)# set local-preference 140
Router(config-route-map)# end

Verifying 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-list 
policy-list POLICY-LIST-NAME-1 permit
  Match clauses:
    metric 20 
policy-list POLICY-LIST-NAME-2 permit
  Match 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-map
route-map ROUTE-MAP-NAME-1, deny, sequence 10
  Match clauses:
  Set clauses:
  Policy routing matches: 0 packets, 0 bytes
route-map ROUTE-MAP-NAME-1, permit, sequence 10
  Match clauses:
    IP Policy lists:
        POLICY-LIST-NAME-1
  Set clauses:
  Policy routing matches: 0 packets, 0 bytes

Related Documents

Related Topic  Document Title 

BGP commands

BGP configuration tasks

Standards

MIBs

RFCs

Technical Assistance

Command Reference

This section documents new commands. All other commands used with this feature are documented in the Cisco IOS command reference publications.

New Commands
Modified Commands

ip policy-list

To create a Border Gateway Protocol (BGP) policy list, use the ip policy-list command in policy-map configuration mode. To remove a policy list, use the no form of this command.

ip policy-list policy-list-name {permit | deny}
no ip policy-list policy-list-name

Syntax Description

policy-list-name

Name of the configured policy list.

permit

Permits access for matching conditions.

deny

Denies access to matching conditions.

Defaults

This command is not enabled by default.

Command Modes

Policy-map configuration mode

Command History

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 BGP policy list that permits matches on the autonomous system path and Multi Exit Discriminator (MED) of a router:

Router(config)# ip policy-list POLICY-LIST-NAME-1 permit 
Router(config-policy-list)# match as-path 1
Router(config-policy-list)# match metric 10
Router(config-policy-list)# end

The following configuration example creates a BGP policy list that permits matches on the specified BGP community using a regular expression and the next hop of a router:

Router(config)# ip policy-list POLICY-LIST-NAME-2 permit 
Router(config-policy-list)# match community 20
Router(config-policy-list)# match metric 10
Router(config-policy-list)# ip community-list 20 permit 20:1
Router(config-policy-list)# end

The following configuration example creates a BGP policy list that denies matches on the specified BGP community using a regular expression and the next hop of a router:

Router(config)# ip policy-list POLICY-LIST-NAME-3 deny 
Router(config-policy-list)# match community 20
Router(config-policy-list)# match metric 10
Router(config-policy-list)# end

Related Commands

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

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 10
Router(config-route-map)# match ip-address 1
Router(config-route-map)# match policy-list POLICY-LIST-NAME-1 
Router(config-route-map)# set community 10:1
Router(config-route-map)# set local-preference 140
Router(config-route-map)# end

The 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 10
Router(config-route-map)# match policy-list POLICY-LIST-NAME-2 POLICY-LIST-NAME-3
Router(config-route-map)# set community 10:1
Router(config-route-map)# set local-preference 140
Router(config-route-map)# end

Related Commands

show ip policy-list

To display information about a configured policy list and policy list entries, use the show ip policy-list command in user EXEC mode.

show ip policy-list policy-list-name

Syntax Description

Command Modes

EXEC

Command History

Examples

The following is sample output from the show ip policy-list command in EXEC mode. 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-list 
policy-list POLICY-LIST-NAME-1 permit
  Match clauses:
    metric 20 
policy-list POLICY-LIST-NAME-2 permit
  Match clauses:

as-path (as-path filter): 1

Related Commands

show route-map

To display configured route maps, use the show route-map command in EXEC mode.

show route-map [map-name]

Syntax Description

Command Modes

EXEC

Command History

Examples

The following is sample output from the show route-map command:

Router# show route-map

route-map ROUTE-MAP-NAME-1, permit, sequence 10
  Match clauses:
    tag 1 2
  Set clauses:
    metric 5
route-map ROUTE-MAP-NAME-2, permit, sequence 20
  Match clauses:
    tag 3 4
  Set clauses:
    metric 6
Policy routing matches: 0 packets, 0 bytes

Table 1 describes the significant fields shown in the display.

Related Commands

Related Commands



hometocprevnextglossaryfeedbacksearchhelp
Posted: Thu Aug 21 13:59:20 PDT 2003
All contents are Copyright © 1992--2003 Cisco Systems, Inc. All rights reserved.
Important Notices and Privacy Statement.