Usage Scenario
An AS_Path set is a group of AS_Path data used by a route-filter to filter BGP routes. To enter the AS_Path set paragraph editing interface view, run the edit xpl as-path-list command.
To configure an AS_Path set in the AS_Path set paragraph editing interface view, perform the following steps:
- Configure a start clause (xpl as-path-list as-path-list-name) for an AS_Path set.
- Configure elements for the set and separate every two neighboring elements with a comma (,). The elements can be configured in any of the following formats:
- length { eq | ge | le } as-length: matches BGP routes with AS_Path length equal to (eq), greater than or equal to (ge), or less than or equal to (le) as-length. The value of as-length is an integer ranging from 0 to 2047.
- unique-length { eq | ge | le } as-length: matches BGP routes with AS_Path length equal to (eq), greater than or equal to (ge), or less than or equal to (le) as-length (duplicate AS numbers are counted as one). The value of as-length is an integer ranging from 0 to 2047.
- origin as-path [ whole-match ]: matches BGP routes with AS_Path whose rightmost AS numbers are the same as as-path. The as-path parameter is enclosed in single quotation marks, with every two neighboring AS numbers separated with a space. Duplicate AS numbers are counted as one unless whole-match is configured.
- peer-is as-path [ whole-match ]: matches BGP routes with AS_Path whose leftmost AS numbers are the same as as-path. The as-path parameter is enclosed in single quotation marks, with every two neighboring AS numbers separated with a space. Duplicate AS numbers are counted as one unless whole-match is configured.
- pass as-path [ whole-match ]: matches BGP routes with AS_Path whose contiguous AS numbers match as-path. The as-path parameter is enclosed in single quotation marks, with every two neighboring AS numbers separated with a space. Duplicate AS numbers are counted as one unless whole-match is configured.
- regular regular-expression: matches BGP routes with AS_Path in the specified regular expression. 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.
- Configure an end clause (end-list) for the AS_Path set.
Precautions
An AS_Path set is only a group of data used as matching rules and does not have the permit or deny function. Therefore, an AS_Path set can be used to filter routes only after it is referenced by a route-filter.