Configuring an AS_Path Set

AS_Path sets apply only to BGP and are used to match the AS_Path attribute of BGP routes. This section describes how to configure AS_Path sets.

Procedure

  • Configure an AS_Path set using the paragraph editing mode.
    1. Run the edit xpl as-path-list as-path-list-name command to enter the AS_Path set paragraph editing interface view.
    2. Press i to enter the text editing mode.

      Sets or route-filters can be configured only in the text editing mode. If you exit from the text editing mode, you can perform shortcut key operations only.

    3. Configure a start clause (xpl as-path-list as-path-list-name) for an AS_Path set.
    4. Configure elements in the format of regular+AS_Path regular expression for the set and separate every two neighboring elements with a comma (,). For example, regular 1_2_3_4 represents an AS_Path that contains AS numbers 1, 2, 3, and 4.

      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.

    5. Configure an end clause (end-list) for the AS_Path set.
    6. Press Esc to exit from the text editing mode.
    7. Press :wq and Enter to save the configurations and exit from the global variable set paragraph editing interface view.

      A message is displayed for you to confirm whether to commit the configurations when you attempt to exit from the global variable set paragraph editing interface view. To commit the configurations, press Y.

      To exit from the global variable set paragraph editing interface view without saving the configurations, press :q! and Enter.

  • Configure an AS_Path set using the line editing mode.
    1. Run the system-view command to enter the system view.
    2. Run the xpl as-path-list as-path-list-name command to enter the AS_Path set view.
    3. Configure elements in the format of regular+AS_Path regular expression for the set and separate every two neighboring elements with a comma (,). For example, regular 1_2_3_4 represents an AS_Path that contains AS numbers 1, 2, 3, and 4.

      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.

    4. Run the end-list command to conclude the configuration of the AS_Path set, exit the AS_Path set view, and return to the system view.
    5. Run the commit command to commit the configuration.

Example

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 an AS_Path set to match the routes received from AS 100, the routes that pass through AS 200, and the routes that originate from AS 300.

Configuration Example

<HUAWEI> edit xpl as-path-list aaa

xpl as-path-list aaa
regular ^100_,
regular _200_,
regular _300$
end-list

The AS_Path set aaa includes three elements and matches the routes received from AS 100, the routes that pass through AS 200, and the routes that originate from AS 300.

Objective

Configure a route-filter to deny the routes received from AS 100, the routes that pass through AS 200, and the routes that originate from AS 300.

Reference Example

<HUAWEI> edit xpl route-filter r1
xpl route-filter r1
if as-path in aaa then
refuse
else
approve
endif
end-filter

The route-filter r1 references AS_Path set aaa, denies the routes that match aaa, and permits all other routes.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >