The AS_Path attribute records the autonomous systems through which a BGP route has passed. Huawei documentation describes it as a “private attribute of BGP,” meaning a BGP-specific route attribute. It is used for loop prevention, route selection and policy-based filtering.
The if-match as-path-filter command creates a route-policy matching condition based on an AS_Path filter. Because non-BGP routes do not carry the BGP AS_Path attribute, this matching clause applies only to BGP routes. Before configuring the matching clause, an AS_Path filter should be defined with the ip as-path-filter command. For example:
ip as-path-filter 2 permit _200_300
route-policy test permit node 10
if-match as-path-filter 2
This policy node matches BGP routes whose AS_Path satisfies the configured regular expression. Huawei’s “private attribute” wording should be understood as protocol-specific, not as saying that AS_PATH is an optional proprietary attribute; in standard BGP classification, AS_PATH is a well-known mandatory path attribute.
Huawei’s command reference explicitly states that if-match as-path-filter is applicable only to BGP routes. Huawei if-match as-path-filter reference
Submit