The apply comm-filter delete command deletes a BGP route community according to the specified value in the community filter. The community filter can be either a basic or advanced community filter.
The undo apply comm-filter command cancels the configuration.
By default, the community attributes of BGP routes are not deleted.
| Parameter | Description | Value |
|---|---|---|
| comm-filter-number | Specifies the number of the community filter. The number is an integer. | The number of the basic community filter ranges from 1 to 99, and the number of the advanced community filter ranges from 100 to 199. |
| comm-filter-name | Specifies the name of the 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. |
Usage Scenario
The community attribute is the private attribute of BGP, and the apply comm-filter delete command is valid only for BGP routes.
When the apply comm-filter delete command is run in the Route-Policy view to delete the values in the community filter, only one community attribute can be specified in an ip community-filter command. If multiple community attributes are configured in the same community filter, running the apply comm-filter delete command cannot delete these community attributes. To delete the community attributes, you need to run the ip community-filter command several times to configure community attributes one by one, and then run the apply comm-filter delete command to delete these community attributes.
Prerequisites
Before running the apply comm-filter delete command, you need to configure a route-policy.
Configuration Impact
After routes meet the filtering conditions, the specified community attributes of these routes are deleted.
Precautions
When the delete operation is configured on a specified community attribute list, only one community attribute can be configured for the specified community attribute list. To delete multiple community attributes, you need to configure multiple community attribute lists. For example, if community attribute list 1 is used to delete 100:100 200:200 from the community attribute 100:100 200:200 300:300 carried in a route, you need to perform the following configurations on community attribute list 1:
[sysname] ip community-filter 1 permit 100:100
[sysname] ip community-filter 1 permit 200:200
[sysname] display ip community-filter
Community filter Number: 1
permit 100:100
permit 200:200
[sysname] route-policy RP1 permit node 10
[sysname-route-policy] apply comm-filter 1 delete
While in the following case, you cannot delete the community attribute 100:100 200:200 of the route.
[sysname] ip community-filter 1 permit 100:100 200:200
[sysname] display ip community-filter
Community filter Number: 1
permit 100:100 200:200
[sysname] route-policy RP1 permit node 10
[sysname-route-policy] apply comm-filter 1 delete
When the apply community and apply comm-filter delete commands are run on the same node in a route-policy, the system performs the delete operation before the set operation regardless of the sequence in which the two commands are run.
# The following shows the Route-Policy named 123a.
[sysname] display route-policy
Route-policy : 123a
permit : 10 (matched counts: 1)
Match clauses:
Apply clauses: a
apply community 999:9 additive
apply comm-filter 1 delete
# The following shows the community-filter 1.
[sysname] display ip community-filter
Community filter Number: 1
permit 111:1
permit 999:9
In this case, When you use the Route-Policy named 123a to filter BGP routes, the community attribute 111:1 of the corresponding BGP routes is deleted and the community attribute 999:9 is added.
# Delete the specified BGP route community attributes 1:200, 2:200, and 3:200 from the community filter.
<sysname> system-view
[sysname] ip community-filter 1 permit 1:200
[sysname] ip community-filter 1 permit 2:200
[sysname] ip community-filter 1 permit 3:200
[sysname] route-policy test permit node 10
[sysname-route-policy] apply comm-filter 1 delete