Community sets apply only to BGP and are used to match the community attribute of BGP routes. This section describes how to configure community sets.
If only paragraph editing is used as an example, the corresponding line editing is similar. To use the line editing mode, perform the operations described in paragraph editing.
For detailed set and route-filter configuration steps, see Configuration Procedures of Sets and Route-Filters Using the Paragraph Editing Mode. For details about XPL clauses, see XPL Paragraph Editing Clauses.
Objective |
Configure a community set to match the routes carrying community set 100:1, 200:1, 300:1, or no-export. |
Configuration Example 1 |
<HUAWEI> edit xpl community-list aaa
xpl community-list aaa
100:1,
200:1,
300:1,
no-export
end-list
The community set aaa includes four elements and matches the routes carrying community set 100:1, 200:1, 300:1, or no-export. |
Objective |
Configure a community set to match the routes carrying community set 100:*, 200:*, or 300:1. |
Configuration Example 2 |
<HUAWEI> edit xpl community-list bbb
xpl community-list bbb
regular 100:*,
regular 200:*,
300:1
end-list
The community set bbb includes three elements and matches the routes carrying community set 100:*, 200:*, or 300:1. |
Objective |
Configure a route-filter to add communities 100:1, 200:1, 300:1, and no-export to the routes with the Local_Pref value less than or equal to 100. |
Reference Example 1 |
<HUAWEI> edit xpl route-filter r1
xpl route-filter r1
if local-preference le 100 then
apply community aaa additive
endif
end-filter
The route-filter r1 references community set aaa and adds communities 100:1, 200:1, 300:1, and no-export to the routes with the Local_Pref value less than or equal to 100. |
Objective |
Configure a route-filter to set the next hop addresses of the routes carrying all the communities listed in community set bbb or carrying only some of the listed communities to 1.1.1.1. |
Reference Example 2 |
<HUAWEI> edit xpl route-filter r2
xpl route-filter r2
if community matches-within bbb then
apply ip next-hop 1.1.1.1
endif
end-filter
The route-filter r2 references community set bbb and sets the next hop addresses of the routes carrying all the communities listed in community set bbb or carrying only some of the listed communities to 1.1.1.1. |