Configuring BGP route filtering policies
Configuration prerequisites
Before you configure BGP routing filtering policies, configure the following filters used for route filtering as needed:
Configuring BGP route distribution filtering policies
To configure BGP route distribution filtering policies, use the following methods:
Use an ACL or prefix list to filter routing information advertised to all peers.
Use a routing policy, ACL, AS path list, or prefix list to filter routing information advertised to a peer or peer group.
If you configure multiple filtering policies, apply them in the following sequence:
filter-policy export
peer filter-policy export
peer as-path-acl export
peer prefix-list export
peer route-policy export
Only routes passing all the configured policies can be advertised.
To configure BGP route distribution filtering policies (IPv4 unicast/multicast address family):
Step | Command | Remarks |
---|
1. Enter system view. | system-view | N/A |
2. Enter BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, or BGP IPv4 multicast address family view. | Enter BGP IPv4 unicast address family view: bgp as-number [ instance instance-name ] address-family ipv4 [ unicast ]
Enter BGP-VPN IPv4 unicast address family view: bgp as-number [ instance instance-name ] ip vpn-instance vpn-instance-name address-family ipv4 [ unicast ]
Enter BGP IPv4 multicast address family view: bgp as-number [ instance instance-name ] address-family ipv4 multicast
| N/A |
3. Configure BGP route distribution filtering policies. | Reference an ACL or IP prefix list to filter advertised BGP routes:filter-policy { ipv4-acl-number | prefix-list prefix-list-name } export [ direct | isis process-id | ospf process-id | rip process-id | static ] Reference a routing policy to filter BGP routes advertised to a peer or peer group:peer { group-name | ipv4-address [ mask-length ] } route-policy route-policy-name export Reference an ACL to filter BGP routes advertised to a peer or peer group:peer { group-name | ipv4-address [ mask-length ] } filter-policy ipv4-acl-number export Reference an AS path list to filter BGP routes advertised to a peer or peer group:peer { group-name | ipv4-address [ mask-length ] } as-path-acl as-path-acl-number export Reference an IPv4 prefix list to filter BGP routes advertised to a peer or peer group:peer { group-name | ipv4-address [ mask-length ] } prefix-list prefix-list-name export
| Use at least one method. By default, no BGP distribution filtering policy is configured. |
To configure BGP route distribution filtering policies (IPv6 unicast/multicast address family):
Step | Command | Remarks |
---|
1. Enter system view. | system-view | N/A |
2. Enter BGP IPv6 unicast address family view, BGP-VPN IPv6 unicast address family view, or BGP IPv6 multicast address family view. | Enter BGP IPv6 unicast address family view: bgp as-number [ instance instance-name ] address-family ipv6 [ unicast ]
Enter BGP-VPN IPv6 unicast address family view: bgp as-number [ instance instance-name ] ip vpn-instance vpn-instance-name address-family ipv6 [ unicast ]
Enter BGP IPv6 multicast address family view: bgp as-number [ instance instance-name ] address-family ipv6 multicast
| N/A |
3. Configure BGP route distribution filtering policies. | Reference an ACL or IPv6 prefix list to filter advertised BGP routes:filter-policy { ipv6-acl-number | prefix-list ipv6-prefix-name } export [ direct | isisv6 process-id | ospfv3 process-id | ripng process-id | static ] Reference a routing policy to filter BGP routes advertised to a peer or peer group:peer { group-name | ipv6-address [ prefix-length ] } route-policy route-policy-name export Reference an ACL to filter BGP routes advertised to a peer or peer group:peer { group-name | ipv6-address [ prefix-length ] } filter-policy ipv6-acl-number export Reference an AS path list to filter BGP routes advertised to a peer or peer group:peer { group-name | ipv6-address [ prefix-length ] } as-path-acl as-path-acl-number export Reference an IPv6 prefix list to filter BGP routes advertised to a peer or peer group peer { group-name | ipv6-address [ prefix-length ] } prefix-list ipv6-prefix-name export
| Use at least one method. By default, no BGP distribution filtering policy is configured. |
Configuring BGP route reception filtering policies
You can use the following methods to configure BGP route reception filtering policies:
Use an ACL or prefix list to filter routing information received from all peers.
Use a routing policy, ACL, AS path list, or prefix list to filter routing information received from a peer or peer group.
If you configure multiple filtering policies, apply them in the following sequence:
filter-policy import
peer filter-policy import
peer as-path-acl import
peer prefix-list import
peer route-policy import
Only routes passing all the configured policies can be received.
To configure BGP route reception filtering policies (IPv4 unicast/multicast address family):
Step | Command | Remarks |
---|
1. Enter system view. | system-view | N/A |
2. Enter BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, or BGP IPv4 multicast address family view. | Enter BGP IPv4 unicast address family view: bgp as-number [ instance instance-name ] address-family ipv4 [ unicast ]
Enter BGP-VPN IPv4 unicast address family view: bgp as-number [ instance instance-name ] ip vpn-instance vpn-instance-name address-family ipv4 [ unicast ]
Enter BGP IPv4 multicast address family view: bgp as-number [ instance instance-name ] address-family ipv4 multicast
| N/A |
3. Configure BGP route reception filtering policies. | Reference an ACL or IP prefix list to filter BGP routes received from all peers:filter-policy { ipv4-acl-number | prefix-list prefix-list-name } import Reference a routing policy to filter BGP routes received from a peer or peer group:peer { group-name | ipv4-address [ mask-length ] } route-policy route-policy-name import Reference an ACL to filter BGP routes received from a peer or peer group:peer { group-name | ipv4-address [ mask-length ] } filter-policy ipv4-acl-number import Reference an AS path list to filter BGP routes received from a peer or peer group:peer { group-name | ipv4-address [ mask-length ] } as-path-acl as-path-acl-number import Reference an IPv4 prefix list to filter BGP routes received from a peer or peer group:peer { group-name | ipv4-address [ mask-length ] } prefix-list prefix-list-name import
| Use at least one method. By default, no route reception filtering is configured. |
To configure BGP route reception filtering policies (IPv6 unicast/multicast address family):
Step | Command | Remarks |
---|
1. Enter system view. | system-view | N/A |
2. Enter BGP IPv6 unicast address family view, BGP-VPN IPv6 unicast address family view, or BGP IPv6 multicast address family view. | Enter BGP IPv6 unicast address family view: bgp as-number [ instance instance-name ] address-family ipv6 [ unicast ]
Enter BGP-VPN IPv6 unicast address family view: bgp as-number [ instance instance-name ] ip vpn-instance vpn-instance-name address-family ipv6 [ unicast ]
Enter BGP IPv6 multicast address family view: bgp as-number [ instance instance-name ] address-family ipv6 multicast
| N/A |
3. Configure BGP route reception filtering policies. | Reference ACL or IPv6 prefix list to filter BGP routes received from all peers:filter-policy { ipv6-acl-number | prefix-list ipv6-prefix-name } import Reference a routing policy to filter BGP routes received from a peer or peer group:peer { group-name | ipv6-address [ prefix-length ] } route-policy route-policy-name import Reference an ACL to filter BGP routes received from a peer or peer group:peer { group-name | ipv6-address [ prefix-length ] } filter-policy ipv6-acl-number import Reference an AS path list to filter BGP routes received from a peer or peer group:peer { group-name | ipv6-address [ prefix-length ] } as-path-acl as-path-acl-number import Reference an IPv6 prefix list to filter BGP routes received from a peer or peer group:peer { group-name | ipv6-address [ prefix-length ] } prefix-list ipv6-prefix-name import
| Use at least one method. By default, no route reception filtering is configured. |