The ip extcommunity-filter command adds an extended community filter.
The undo ip extcommunity-filter command deletes the filter.
By default, no extended community filter is configured.
ip extcommunity-filter { basic-extcomm-filter-num | basic basic-extcomm-filter-name } { deny | permit } { rt { as-number:nn | 4as-number:nn | ipv4-address:nn } } &<1-16>
ip extcommunity-filter { advanced-extcomm-filter-num | advanced advanced-extcomm-filter-name } { deny | permit } regular-expression
undo ip extcommunity-filter { basic-extcomm-filter-num | basic basic-extcomm-filter-name } [ { deny | permit } { rt { as-number:nn | 4as-number:nn | ipv4-address:nn } } &<1-16> ]
undo ip extcommunity-filter { advanced-extcomm-filter-num | advanced advanced-extcomm-filter-name } [ regular-expression ]
| Parameter | Description | Value |
|---|---|---|
| basic-extcomm-filter-num | Specifies the number of the basic extended community filter. | It is an integer that ranges from 1 to 199. |
| basic basic-extcomm-filter-name | Specifies the name of the basic extended community filter. | The name is a string of 1 to 51 case-sensitive characters
without any spaces. The string cannot be all numbers. NOTE:
When double quotation marks are used around the string, spaces are
allowed in the string. |
| deny | Indicates the matching mode of the extended community filter is "deny". | - |
| permit | Indicates the matching mode of the extended community filter is "permit". | - |
| rt | Specifies the Route Target (RT). | - |
| 4as-number | Indicates a 4-byte AS number. | A 4-byte AS number is divided into the following
types:
|
| ipv4-address | Indicates the IPv4 address. | It is in dotted decimal notation. |
| nn | Indicates an integer. | For as-number, the value ranges from 0 to 4294967295. For 4as-number, the value ranges from 0 to 65535. For ipv4-address, the value ranges from 0 to 65535. |
| advanced-extcomm-filter-num | Specifies the number of the advanced extended community filter. | It is an integer that ranges from 200 to 399. |
| advanced advanced-extcomm-filter-name | Specifies the name of the advanced extended community filter. | The name is a string of 1 to 51 case-sensitive characters
without any spaces. The string cannot be all numbers. NOTE:
When double quotation marks are used around the string, spaces are
allowed in the string. |
| regular-expression | Specifies the regular expression matched the extended community. | It is a string of 1 to 255 space-tolerant characters. |
Usage Scenario
An extended community filter can be used as a matching condition of a route-policy by using a command such as if-match extcommunity-filter zz.
Only the extended community number can be specified for a basic extended community filter. The regular expression can be used as a matching rule in an advanced extended community filter.
The ip extcommunity-filter basic extcomm-filter-name command or the ip extcommunity-filter basic-extcomm-filter-num command can be used to configure a basic extended community filter. basic extcomm-filter-name specifies the name of a basic extended community filter, and the name cannot be all digits. basic-extcomm-filter-num specifies only the basic extended community filter with the number ranging from 1 to 199. A maximum of 16 extended community numbers can be configured using one command.
The ip extcommunity-filter advanced extcomm-filter-name command or the ip extcommunity-filter adv-extcomm-filter-num command can be used to configure an advanced extended community filter. advanced extcomm-filter-name specifies the name of an advanced extended community filter, and the name cannot be all digits. adv-extcomm-filter-num specifies only the advanced extended community filter with the number ranging from 200 to 399.
The relationship between the rules of the extended community filter is "OR".
For example, the extended community filtersin the following formats have the same matching results:
Format 1:
ip extcommunity-filter 1 permit rt 100:1 200:1 300:1
Format 2:
ip extcommunity-filter 1 permit rt 100:1
ip extcommunity-filter 1 permit rt 200:1 300:1
The undo ip extcommunity-filter command is used to delete a specified extended community filter.
The display ip extcommunity-filter command is used to display the detailed configurations of the extended community filter.
Follow-up Procedure
After the extended community filter is configured, if the policy application delay is set by using the route-policy-change notify-delay command, the Route Management (RM) module will instruct each protocol to apply this filter after the delay expires. By default, the RM module instructs each protocol to immediately apply this filter.
The undo ip extcommunity-filter command is used to delete a specified extended community filter.
The display ip extcommunity-filter command is used to display the detailed configurations of the extended community filter.
Configuration Impact
The ip extcommunity-filter command is used to filter routes based on the RT attributes of the routes. The routes that pass the filtering are permitted to pass through and the routes that fail to pass the filtering are denied.
Precautions
The extended community attributes of a route include VPN-target and Source of Origin (SoO). Only VPN-target, however, is supported by the policy.