peer as-path-filter
Function
The peer as-path-filter command configures a BGP route filtering policy based on an AS_Path list for a peer or peer group.
The undo peer as-path-filter command cancels the existing configuration.
By default, no route filtering policy based on an AS_Path list is configured for a peer or peer group.
Format
peer { group-name | ipv4-address | ipv6-address } as-path-filter { as-path-filter-number | as-path-filter-name } { import | export }
undo peer { group-name | ipv4-address | ipv6-address } as-path-filter { as-path-filter-number | as-path-filter-name } { import | export }
Parameters
Parameter | Description | Value |
---|---|---|
group-name | Specifies the name of a peer group. | The name is a string of 1 to 47 characters without any spaces. It is case-sensitive. |
ipv4-address | Specifies the IPv4 address of a peer. | It is in dotted decimal notation. |
ipv6-address | Specifies the IPv6 address of a peer. | The value is a 32-digit hexadecimal number, in the format of X:X:X:X:X:X:X:X. |
as-path-filter-number | Specifies the number of an AS_Path filter. | The value is an integer ranging from 1 to 256. |
as-path-filter-name | Specifies the name of an AS_Path filter. | The name is a string of 1 to 51 case-sensitive characters. It cannot be all numbers. |
import | Applies a route filtering policy to received routes. | - |
export | Applies a route filtering policy to routes to be advertised. | - |
ipv4-address is valid only in the BGP view, BPG-IPv4 unicast address family view and BGP-IPv4 multicast address family view.
ipv6-address is valid only in the BGP-IPv6 unicast address family view.
Views
BGP view, BGP-IPv4 unicast address family view, BGP-IPv4 multicast address family view, BGP-IPv6 unicast address family view
Usage Guidelines
Usage Scenario
After the peer as-path-filter command is used to apply a route filtering policy based on an AS_Path list to BGP routes, the routers that do not match the policy are filtered out.
Prerequisites
Peer relationships have been established using the peer as-number command.
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 the routes received from the same peer. Similarly, only one AS_Path filter can be used to filter routes to be advertised to the same peer.