apply community
Use apply community to set a specified COMMUNITY attribute for BGP routes.
Use undo apply community to remove the configuration.
Syntax
apply community { none | additive | { community-number&<1-32> | aa:nn&<1-32> | internet | no-advertise | no-export | no-export-subconfed } * [ additive ] }
undo apply community [ none | additive | { community-number&<1-32> | aa:nn&<1-32> | internet | no-advertise | no-export | no-export-subconfed } * [ additive ] ]
Default
No COMMUNITY attribute is set for BGP routes.
Views
Routing policy node view
Predefined user roles
network-admin
mdc-admin
Parameters
none: Removes the COMMUNITY attributes of BGP routes.
community-number&<1-32>: Specifies a community sequence number in the range of 1 to 4294967295. &<1-32> indicates that the argument before it can be entered up to 32 times.
aa:nn&<1-32>: Specifies a community number; both aa and nn are in the range of 0 to 65535. &<1-32> indicates that the argument before it can be entered up to 32 times.
internet: Sets the INTERNET community attribute for BGP routes. Routes with this attribute can be advertised to all BGP peers. By default, all routes have this attribute.
no-advertise: Sets the NO_ADVERTISE community attribute for BGP routes. Routes with this attribute cannot be advertised to any peers.
no-export: Sets the NO_EXPORT community attribute for BGP routes. Routes with this attribute cannot be advertised out of the AS or confederation, but can be advertised to other sub-ASs in the confederation.
no-export-subconfed: Sets the NO_EXPORT_SUBCONFED community attribute for BGP routes. Routes with this attribute cannot be advertised out of the local AS or to other sub-ASs in the confederation.
additive: Adds the specified COMMUNITY attribute to the original COMMUNITY attribute of BGP routes.
Examples
# Configure node 16 in permit mode for routing policy setcommunity to set the NO_EXPORT community attribute for BGP routes.
<Sysname> system-view [Sysname] route-policy setcommunity permit node 16 [Sysname-route-policy-setcommunity-16] apply community no-export
Related commands
if-match community
ip community-list