The filter-policy import command filters the received routes.
The undo filter-policy import command removes the filtering for the received routes.
By default, the received route is not filtered.
filter-policy { acl-number | ip-prefix ip-prefix-name } import
filter-policy { acl6-number | ipv6-prefix ipv6-prefix-name } import
undo filter-policy { acl-number | ip-prefix ip-prefix-name } import
undo filter-policy { acl6-number | ipv6-prefix ipv6-prefix-name } import
| Parameter | Description | Value |
|---|---|---|
acl-number |
Specifies the number of the basic ACL. |
The value is an integer ranging from 2000 to 2999. |
ip-prefix ip-prefix-name |
Specifies the name of IPv4 prefix list. |
The name is a string of 1 to 169 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. |
acl6-number |
Specifies the basic ACL6 number. |
The value is an integer ranging from 2000 to 2999. |
ipv6-prefix ipv6-prefix-name |
Specifies the name of the IPv6 prefix list. |
The name is a string of 1 to 169 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. |
acl-number and ip-prefix ip-prefix-name are valid only in the BGP view, BGP-IPv4 unicast address family view, BGP-VPN instance IPv4 address family view, and BGP-VPNv4 address family view.
acl6-number and ipv6-prefix ipv6-prefix-name are valid only in the BGP-IPv6 unicast address family view, and BGP-VPN instance IPv6 address family view.
BGP view, BGP-VPN instance IPv4 address family view, BGP-IPv4 unicast address family view, BGP-VPNv4 address family view, BGP-IPv6 unicast address family view, BGP-VPN instance IPv6 address family view
Usage Scenario
The filter-policy import command is used to filter the routes received by BGP to determine whether to add them to the BGP routing table.
Configuration Impact
If the filter-policy import command runs for multiple times, the latest configuration overrides the previous one.
Precautions
Creating an IP prefix list before it is referenced is recommended. By default, nonexistent IP prefix lists cannot be referenced using the command. If the route-policy nonexistent-config-check disable command is run in the system view and a nonexistent IP prefix list is referenced using the current command, all routes advertised by the specified peer are accepted.
# Use ACL 2000 to filter the routes received by BGP.
<sysname> system-view
[sysname] bgp 100
[sysname-bgp] ipv4-family unicast
[sysname-bgp-af-ipv4] filter-policy 2000 import
<sysname> system-view
[sysname] bgp 100
[sysname-bgp] ipv6-family unicast
[sysname-bgp-af-ipv6] filter-policy 2000 import