ip community-list

Use ip community-list to configure a community list.

Use undo ip community-list to remove a community list or an item from a community list.

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 lists exist.

Views

System view

Predefined user roles

network-admin

Parameters

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

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

advanced adv-comm-list-name: Specifies an advanced community list name, a case-sensitive string of 1 to 63 characters that cannot contain only numbers.

adv-comm-list-num: Specifies an 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 you can specify a maximum of 32 community sequence numbers.

aa:nn&<1-32>: Specifies a community number. Both aa and nn are in the range of 0 to 65535. &<1-32> indicates that you can specify a maximum of 32 community numbers.

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 routes with the INTERNET community attribute.

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

# Configure advanced community list 100 to permit routes 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