The filter-policy export command configures a device to filter the routes to be advertised. BGP advertises only the routes that pass filtering.
The undo filter-policy export command restores the default configuration.
By default, the routes to be advertised are not filtered.
filter-policy { acl-number | acl-name acl-name | ip-prefix ip-prefix-name } export [ protocol [ process-id ] ]
filter-policy { acl6-number | acl6-name acl6-name | ipv6-prefix ipv6-prefix-name } export [ protocol [ process-id ] ]
undo filter-policy export [ protocol [ process-id ] ]
undo filter-policy { acl-number | acl-name acl-name | ip-prefix ip-prefix-name } export [ protocol [ process-id ] ]
undo filter-policy { acl6-number | acl6-name acl6-name | ipv6-prefix ipv6-prefix-name } export [ protocol [ process-id ] ]
Parameter | Description | Value |
---|---|---|
acl-number |
Specifies the number of a basic ACL. |
The value is an integer that ranges from 2000 to 2999. |
acl-name acl-name |
Specifies the name of a named ACL. |
The value is a string of 1 to 64 case-sensitive characters without spaces. The value must start with a letter. |
ip-prefix ip-prefix-name |
Specifies the name of an 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. |
protocol |
Specifies the name of a routing protocol. |
The BGP view, BGP-IPv4 unicast address family view, BGP-IPv4 multicast address family view, and BGP-VPN instance IPv4 address family view support direct, isis, ospf, rip, static, and unr. The BGP-IPv6 unicast address family view and BGP-VPN instance IPv6 address family view support direct, isis, ospfv3, ripng, static, and unr. |
process-id |
Specifies the number of a process that needs to perform matching. If protocol is direct, static, or unr, no process ID is required. |
The value is an integer that ranges from 1 to 65535. |
acl6-number |
Specifies the number of a basic ACL6. |
The value is a string of 1 to 64 case-sensitive characters without spaces. The value must start with a letter. |
acl6-name acl6-name |
Specifies the name of a named ACL6. |
The value is a string of 1 to 64 case-sensitive characters without spaces. The name should start with a letter and can contain numbers, hyphens (-), or underscores (_). |
ipv6-prefix ipv6-prefix-name |
Specifies the name of an 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. |
protocol [ process-id ] is valid only in the BGP view, BGP-IPv4 unicast address family view, BGP-IPv4 multicast address family view, BGP-VPN instance IPv4 address family view, BGP-IPv6 unicast address family view, and BGP-VPN instance IPv6 address family view.
acl-name acl-name, acl-number, and ip-prefix ip-prefix-name are valid only in the BGP view, BGP-IPv4 unicast address family view, BGP-IPv4 multicast address family view, BGP-VPN instance IPv4 address family view, and BGP-VPNv4 address family view.
acl6-name acl6-name, acl6-number, and ipv6-prefix ipv6-prefix-name are valid only in the BGP-IPv6 unicast address family view, BGP-VPN instance IPv6 address family view, and BGP-VPNv6 address family view.
BGP view, BGP-IPv4 unicast address family view, BGP-IPv4 multicast address family view, BGP-VPN instance IPv4 address family view, BGP-VPNv4 address family view, BGP-IPv6 unicast address family view, BGP-VPN instance IPv6 address family view, BGP-VPNv6 address family view
Usage Scenario
For an ACL, when the rule command is used to configure a filtering rule, the filtering rule is effective only with the source address range that is specified by the source parameter and with the time period that is specified by the time-range parameter.
The filter-policy export command affects the routes advertised by BGP. After the command is run, BGP filters the routes that are imported by using the import-route command. Only the routes that pass the filtering can be added to the local BGP routing table and advertised by BGP.
If protocol is specified, only the routes imported from the specified protocol will be filtered. If protocol is not specified, the routes imported from all protocols will be filtered.
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 are advertised to the specified peer.