peer as-path-acl
Use peer as-path-acl to specify an AS path list to filter routes incoming from or outgoing to a peer or peer group.
Use undo peer as-path-acl to delete the AS path list specified to filter routes incoming from or outgoing to a peer or peer group.
Syntax
In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP IPv4 multicast address family view:
peer { group-name | ipv4-address [ mask-length ] } as-path-acl as-path-acl-number { export | import }
undo peer { group-name | ipv4-address [ mask-length ] } as-path-acl [ as-path-acl-number ] { export | import }
In BGP IPv6 unicast address family view:
peer { group-name | ipv6-address [ prefix-length ] } as-path-acl as-path-acl-number { export | import }
undo peer { group-name | ipv6-address [ prefix-length ] } as-path-acl [ as-path-acl-number ] { export | import }
In BGP-VPN IPv6 unicast address family view/BGP IPv6 multicast address family view:
peer { group-name | ipv6-address [ prefix-length ] } as-path-acl as-path-acl-number { export | import }
undo peer { group-name | ipv6-address [ prefix-length ] } as-path-acl [ as-path-acl-number ] { export | import }
Default
No AS path list is specified for filtering.
Views
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast address family view
Predefined user roles
network-admin
Parameters
group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.
ipv4-address: Specifies a peer by its IPv4 address. The peer must have been created.
mask-length: Specifies a mask length in the range of 0 to 32. You can use the ipv4-address and mask-length arguments together to specify a subnet. If you specify a subnet, this command specifies an AS path list to filter routes incoming from or outgoing to all dynamic peers in the subnet.
ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.
prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a subnet. If you specify a subnet, this command specifies an AS path list to filter routes incoming from or outgoing to all dynamic peers in the subnet.
as-path-acl-number: Specifies an AS path list by its number in the range of 1 to 256.
export: Filters outgoing routes.
import: Filters incoming routes.
Usage guidelines
The specified AS path list must have been created with the ip as-path command in system view. If you specify a nonexistent AS path list, all routes can pass the AS path list.
Examples
# In BGP IPv4 unicast address family view, specify AS path list 1 to filter routes outgoing to peer group test.
<Sysname> system-view [Sysname] bgp 100 [Sysname-bgp-default] address-family ipv4 unicast [Sysname-bgp-default-ipv4] peer test as-path-acl 1 export
Related commands
filter-policy export
filter-policy import
ip as-path
peer filter-policy
peer prefix-list
peer route-policy