The peer as-path-filter import command configures a policy based on an AS_Path list for filtering BGP routes received from a peer group.
The undo peer as-path-filter import command cancels this configuration.
By default, no policy based on an AS_Path list is configured for filtering BGP routes received from a peer group, and all the BGP routes will be received from the peer group.
Parameter | Description | Value |
---|---|---|
group-name |
Specifies the name of a peer group. |
The name is a string of 1 to 47 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. |
number |
Specifies the number of an AS_Path filter. |
The value is an integer ranging from 1 to 256. |
name |
Specifies the name of an AS_Path filter. |
The value is a string of 1 to 51 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. |
Usage Scenario
After the peer as-path-filter import command is used to apply a route filtering policy based on an AS_Path list to BGP routes to be received from a specified peer group, the routers that do not match the policy are filtered out.
Prerequisites
The ip as-path-filter command has been run to define an AS-Path filter.
Precautions
Only one AS_Path filter can be used to filter routes to be received from the same peer.
The peer as-path-filter import command is mutually exclusive with the peer route-filter import commands.<HUAWEI> system-view [~HUAWEI] ip as-path-filter 2 permit 20 [~HUAWEI] ip vpn-instance vpna [*HUAWEI-vpn-instance-vpna] ipv4-family [*HUAWEI-vpn-instance-vpna-af-ipv4] route-distinguisher 100:1 [*HUAWEI-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both [*HUAWEI-vpn-instance-vpna-af-ipv4] quit [*HUAWEI-instance-vpna] quit [*HUAWEI] bgp 100 instance a [*HUAWEI-bgp-instance-a] ipv4-family vpn-instance vpna [*HUAWEI-bgp-instance-a-vpna] group test [*HUAWEI-bgp-instance-a-vpna] peer test as-path-filter 2 import