set community

Use this command to set the community when all match clauses match for this route map.

Syntax

set community {as:community | defined-community} {remove-all | remove-specific | set-specific | remove-all-and-set}
no set community {as:community | defined-community} {remove-all | remove-specific | set-specific | remove-all-and-set}

Parameters

as:community Specifies the AS number, followed by a colon (:), followed by the community number to set if all match clauses match for this route map.
defined-community There are predefined community values defined in RFC 1997 and RFC 3765 that are supported by the community field such as:
  • NO_EXPORT - Routes must not be advertised outside a BGP confederation boundary
  • NO_ADVERTISE - Routes must not be advertised to other BGP peers
  • NO_EXPORT_SUBCONFED - Routes must not be advertised to external BGP peers
  • NO_PEER - Routes must not be advertised across bilateral peer connections
remove-all Specifies that the action is to remove all communities from the route.
remove-specific Specifies that the action is to remove all matching communities from the route.
set-specific Specifies that the action is to append the specified community to the route.
remove-all-and-set Specifies that the action is to replace any existing communities in the route with the specified community

Defaults

None.

Mode

BGP route map configuration.

Usage

The default value for the set community command is no community is set.

The no set community command resets the community to no community is set when all match clauses match for this route map.

Examples

This example shows how to append the community value 100:100 to BGP routes matching prefix list named permit100:

System(su)->configure
System(su-config)->route-map bgp bgprm1 permit
System(su-config-route-map-bgp)->match prefix-list permit100
System(su-config-route-map-bgp)->set community 100:100 set-specific
System(su-config-route-map-bgp)->

This example shows how to append the well-known NO_PEER community (RFC-3765) to BGP routes matching prefix list named permit200:

System(su)->configure
System(su-config)->route-map bgp bgprm1 permit
System(su-config-route-map-bgp)->match prefix-list permit200
System(su-config-route-map-bgp)->set community NO_PEER set-specific
System(su-config-route-map-bgp)->