ip community-list

Use ip community-list to configure a community list entry.

Use undo ip community-list to remove a community list or entry.

Syntax

ip community-list { basic-comm-list-num | basic basic-comm-list-name } { deny | permit } [ community-number&<1-32> | aa:nn&<1-32> ] [ internet | no-advertise | no-export | no-export-subconfed ] *

undo ip community-list { basic-comm-list-num | basic basic-comm-list-name } [ deny | permit ] [ community-number&<1-32> | aa:nn&<1-32> ] [ internet | no-advertise | no-export | no-export-subconfed ] *

ip community-list { adv-comm-list-num | advanced adv-comm-list-name } { deny | permit } regular-expression

undo ip community-list { adv-comm-list-num | advanced adv-comm-list-name } [ deny | permit ] [ regular-expression ]

Default

No community list is configured.

Views

System view

Predefined user roles

network-admin

mdc-admin

Parameters

basic-comm-list-num: Specifies a number for the basic community list, in the range of 1 to 99.

basic: Specifies a name for the basic communist list.

advanced: Specifies a name for the advanced communist list.

basic-comm-list-name: Specifies the basic community list name, a case-sensitive string of 1 to 63 characters that cannot comprise only letters.

adv-comm-list-name: Specifies the advanced community list name, a case-sensitive string of 1 to 63 characters that cannot comprise only letters.

adv-comm-list-num: Specifies the advanced community list number in the range of 100 to 199.

regular-expression: Specifies a regular expression for the advanced community list, a string of 1 to 63 characters. For more information about regular expressions, see Fundamentals Configuration Guide.

deny: Specifies the match mode for the community list as deny.

permit: Specifies the match mode for the community list as permit.

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: Specifies the INTERNET community attribute. Routes with this attribute can be advertised to all BGP peers. By default, all routes have this attribute.

no-advertise: Specifies the NO_ADVERTISE community attribute. Routes with this attribute cannot be advertised to other BGP peers.

no-export: Specifies the NO_EXPORT community attribute. Routes with this attribute cannot be advertised out of the local AS or the local confederation but can be advertised to other ASs in the confederation.

no-export-subconfed: Specifies the NO_EXPORT_SUBCONFED community attribute. Routes with this attribute cannot be advertised out of the local AS, or to other sub-ASs in the local confederation.

Examples

# Configure basic community list 1 to permit routing information with the INTERNET community attribute.

<Sysname> system-view
[Sysname] ip community-list 1 permit internet

# Configure advanced community list 100 to permit routing information with the COMMUNITY attribute starting with 10.

<Sysname> system-view
[Sysname] ip community-list 100 permit ^10

Related commands

apply comm-list delete

apply community

display ip community-list

if-match community