Command:

set community


Mode:

Router(config-route-map)#


Syntax:

set community {community-number [additive]} | none
no set community {community-number [additive]} | none

 

Syntax Description:

community-number Specifies that community number. Valid values are from 1 to 4294967200, no-export, or no-advertise.
additive (Optional) Adds the community to the already existing communities.
none (Optional) Removes the community attribute from the prefixes that pass the route map.

 

Command Description:

To set the BGP communities attribute, use the set community route map configuration command. To delete the entry, use the no form of this command.

You must have a match clause (even if it points to a "permit everything" list) if you want to set tags.

Use the route-map global configuration command, and the match and set route-map configuration commands, to define the conditions for redistributing routes from one routing protocol into another. Each route-map command has a list of match and set commands associated with it. The match commands specify the match criteria--the conditions under which redistribution is allowed for the current route-map command. The set commands specify the set actions--the particular redistribution actions to perform if the criteria enforced by the match commands are met. The no route-map command deletes the route map.

The set route-map configuration commands specify the redistribution set actions to be performed when all the match criteria of a route map are met. When all match criteria are met, all set actions are performed.


Example:

In the following example, routes that pass the autonomous system path access list 1 have the community set to 109. Routes that pass the autonomous system path access list 2 have the community set to no-export (these routes will not be advertised to any external BGP [eBGP] peers).

Router(config)#route-map set_community 10 permit
Router(config-route-map)#match as-path 1
Router(config-route-map)#set community 109
Router(config)#route-map set_community 20 permit
Router(config-route-map)#match as-path 2
Router(config-route-map)#set community no-export

In the following similar example, routes that pass the autonomous system path access list 1 have the community set to 109. Routes that pass the autonomous system path access list 2 have the community set to local-as (the router will not advertise this route to peers outside the local autonomous system.

Router(config)#route-map set_community 10 permit
Router(config-route-map)#match as-path 1
Router(config-route-map)#set community 109
Router(config)#route-map set_community 20 permit
Router(config-route-map)#match as-path 2
Router(config-route-map)#set community local-as


Misconceptions:

None


Related Commands:

ip community-list
match community
route-map

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

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