Command:

match community


Mode:

Router(config-route-map)#


Syntax:

match community standard-list-number | expanded-list-number | community-list-name [exact-match] ...[standard-list-number | expanded-list-number | community-list-name [exact-match]]
no match community standard-list-number | expanded-list-number | community-list-name [exact-match] ...[standard-list-number | expanded-list-number | community-list-name [exact-match]]

 

Syntax Description:

standard-list-number Specifies a standard community list number from 1 to 99 that identifies one or more permit or deny groups of communities.
expanded-list-number Specifies an expanded community list number from 100 to 199 that identifies one or more permit or deny groups of communities.
community-list-name The community list name.
exact-match (Optional) Indicates that an exact match is required. All of the communities and only those communities specified must be present.

 

Command Description:

To match a Border Gateway Protocol (BGP) community, use the match community command in route-map configuration mode. To remove the match community command from the configuration file and restore the system to its default condition where the software removes the BGP community list entry, use the no form of this command.

A route map can have several parts. Any route that does not match at least one match command relating to a route-map command will be ignored; that is, the route will not be advertised for outbound route maps and will not be accepted for inbound route maps. If you want to modify only some data, you must configure a second route-map section with an explicit match specified.

Matching based on community list number or name is one of the types of match commands applicable to BGP.


Example:

The following example shows that the routes matching community list 1 will have the weight set to 100. Any route that has community 109 will have the weight set to 100.

Router(config)# ip community-list 1 permit 109
Router(config)# route-map set_weight
Router(config-route-map)# match community 1 
Router(config-route-map)# set weight 100

The following example shows that the routes matching community list 1 will have the weight set to 200. Any route that has community 109 alone will have the weight set to 200.

Router(config)# ip community-list 1 permit 109
Router(config)# route-map set_weight
Router(config-route-map)# match community  1 exact 
Router(config-route-map)# set weight 200

In the following example, the routes that match community list LIST_NAME will have the weight set to 100. Any route that has community 101 alone will have the weight set to 100.

Router(config)# ip community-list 1 permit 101
Router(config)# route-map set_weight
Router(config-route-map)# match community  LIST_NAME 
Router(config-route-map)# set weight 100


Misconceptions:

None


Related Commands:

ip community-list
route-map
set weight

� Cisco Systems, Inc. 2001, 2002, 2003
World Wide Education

Converted from CHM to HTML with chm2web Pro 2.85 (unicode)