Usage Scenario
A community set is a group of community data used by a route-filter to filter BGP routes. To enter the community set paragraph editing interface view, run the edit xpl community-list command.
To configure a community set in the community set paragraph editing interface view, perform the following steps:
- Configure a start clause (xpl community-list community-list-name) for a community set.
- Configure elements in the format of aa:nn (100:1 for example), a community number, or a known community (internet, no-export-subconfed, no-advertise, or no-export) for the community set and separate every two neighboring elements with a comma (,). Alternatively, configure elements in the format of regular regular-expression, which matches routes with community attributes in the specified regular expression. An asterisk () can be used to match any character. If an asterisk () is used in an element, such as 100:*, the element matches all communities with the AS number 100. For detailed description about regular expressions, see Configuration Guide – Basic Configuration.
Regular expression processing is computing-intensive. When a large number of regular expressions are configured in an XPL policy to match a BGP route attribute and the length of the route attribute is long, the processing performance of the XPL policy deteriorates. To improve the processing performance of the routing policy, decrease the number of regular expressions or use a non-regular expression matching command.
It is recommended that a maximum of 100 regular expressions be configured for each policy.
The community-based regular expression can be set to a character string in either the aa:nn format or integer format. The following are two examples:
The regular ^1:1$ configuration matches routes that carry the community value of 65537 or 1:1.
The regular ^65537$ configuration also matches routes that carry the community value of 65537 or 1:1.
- Configure an end clause (end-list) for the community set.
Precautions
A community set is only a group of data used as matching rules and does not have the permit or deny function. Therefore, a community set can be used to filter routes only after it is referenced by a route-filter.