Configuring an AS_Path Filter

Context

An AS_Path filter is used to filter BGP routes by matching against AS_Path attributes. The AS_Path attribute records the numbers of all ASs through which a BGP route passes from the local end to the destination in the distance-vector (DV) order. In this case, AS_Path attribute-based filtering rules can be defined to filter BGP routes.

The matching condition of an AS_Path filter is specified using a regular expression. For example, ^30 indicates that only the AS_Path attribute starting with 30 is matched. Using a regular expression can simplify configurations. For details on how to use regular expressions, see the command line description in the Configuration Guide > Basic Configuration.

The AS_Path filter takes effect only on BGP routes because the AS_Path attribute is a private attribute of BGP.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run ip as-path-filter { as-path-filter-number | as-path-filter-name } [ index index-number ] { permit | deny } regular-expression

    An AS_Path filter is configured.

    regular-expression defines a matching rule for the AS_Path filter.

  3. Run commit

    The configuration is committed.

Verifying the Configuration

Run the display ip as-path-filter [ as-path-filter-number | as-path-filter-name ] command to check information about the configured AS_Path filter.

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