The apply comm-filter delete command sets the action for deleting community attributes of a specified community filter in a routing policy.
The undo apply comm-filter command restores the default setting.
By default, the action for deleting community attributes of a specified community filter is not set in a routing policy.
Product |
Support |
---|---|
S5720-EI, S5720-HI, S5720I-SI, S5720S-SI, S5720-SI, S5735-S, S5735S-S, S5735-S-I, S5730-HI, S5730S-EI, S5730-SI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6720S-SI, S6720-SI, S6730-H, S6730S-H, S6730-S, and S6730S-S |
Supported. |
S2720-EI, S5720-LI, S5735-L, S5735S-L, S5735S-L-M, S5720S-LI, S6720-LI, and S6720S-LI |
Not supported. |
apply comm-filter { basic-comm-filter-number | adv-comm-filter-number | comm-filter-name } delete
undo apply comm-filter
Parameter | Description | Value |
---|---|---|
basic-comm-filter-number |
Specifies the number of a basic community filter. |
The value is an integer ranging from 1 to 99. |
adv-comm-filter-number |
Specifies the number of an advanced community filter. |
The value is an integer ranging from 100 to 199. |
comm-filter-name |
Specifies the name of a community filter. |
The name is a string of 1 to 51 case-sensitive characters without spaces. The string cannot be all numerals. When double quotation marks are used around the string, spaces are allowed in the string. |
Usage Scenario
To delete the community attributes, you can run the ip community-filter command several times to configure community attributes one by one, and apply the routing policy containing the apply comm-filter delete command to delete these community attributes.
The community attribute is a private attribute of BGP. The apply comm-filter delete command takes effect only for BGP routes.
Prerequisites
The apply comm-filter delete command can be used only after the route-policy command is used.
Precautions
After routes meet the filtering conditions, the specified community attributes of these routes are deleted.
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 carried in a route, you need to perform the following configurations on community attribute list 1:
[HUAWEI] ip community-filter 1 permit 100:100
[HUAWEI] ip community-filter 1 permit 200:200
[HUAWEI] display ip community-filter
Community filter Number: 1 permit 100:100 permit 200:200
[HUAWEI] route-policy RP1 permit node 10
[HUAWEI-route-policy] apply comm-filter 1 delete
If multiple community attributes are configured in the same community filter, the apply comm-filter delete command cannot delete these community attributes. To delete the community attributes, you can run the ip community-filter command several times to configure community attributes one by one, and apply the routing policy containing the apply comm-filter delete command to delete these community attributes. For example, the following command cannot delete the community attribute 100:100 200:200 of the route:
[HUAWEI] ip community-filter 1 permit 100:100 200:200
[HUAWEI] display ip community-filter
Community filter Number: 1 permit 100:100 200:200
[HUAWEI] route-policy RP1 permit node 10
[HUAWEI-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 routing policy, the system performs the delete operation before the set operation regardless of the sequence in which the two commands are run.
[HUAWEI] display route-policy
Route-policy : 123a
permit : 10
Match clauses:
Apply clauses: a
apply community 999:9 additive
apply comm-filter 1 delete
The following command output shows that community attribute 111:1 of the corresponding BGP route is deleted and community attribute 999:9 is added.
[HUAWEI] display ip community-filter
Community filter Number: 1
permit 111:1
permit 999:9
# Delete the specified BGP route community attributes 1:200, 2:200, and 3:200 from the community filter.
<HUAWEI> system-view
[HUAWEI] ip community-filter 1 permit 1:200
[HUAWEI] ip community-filter 1 permit 2:200
[HUAWEI] ip community-filter 1 permit 3:200
[HUAWEI] route-policy test permit node 10
[HUAWEI-route-policy] apply comm-filter 1 delete