The filter-policy export command filters the advertised routes, and only the routes that pass the filtering can be advertised by BGP.
The undo filter-policy export command removes the filtering for the advertised routes.
By default, the advertised route is not filtered.
filter-policy { acl-number | ip-prefix ip-prefix-name } export [ direct | isis process-id | ospf process-id | rip process-id | unr | static ]
filter-policy { acl6-number | ipv6-prefix ipv6-prefix-name } export [ direct | isis process-id | ospfv3 process-id | ripng process-id | unr | static ]
undo filter-policy export [ direct | isis process-id | ospf process-id | rip process-id | unr | static ]
undo filter-policy export [ direct | isis process-id | ospfv3 process-id | ripng process-id | unr | static ]
undo filter-policy { acl-number | ip-prefix ip-prefix-name } export [ direct | isis process-id | ospf process-id | rip process-id | unr | static ]
undo filter-policy { acl6-number | ipv6-prefix ipv6-prefix-name } export [ direct | isis process-id | ospfv3 process-id | ripng process-id | unr | static ]
| Parameter | Description | Value |
|---|---|---|
acl-number |
Specifies the basic ACL number. |
The value is an integer ranging from 2000 to 2999. |
ip-prefix ip-prefix-name |
Specifies the name of IPv4 address 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. |
direct |
Configures a device to filter the direct routes to be advertised. |
- |
isis |
Configures a device to filter the IS-IS routes to be advertised. |
- |
process-id |
Specifies the ID of an eligible process. |
The value is an integer ranging from 1 to 65535. |
ospf |
Configures a device to filter the OSPF routes to be advertised. |
- |
rip |
Configures a device to filter the RIP routes to be advertised. |
- |
unr |
Configures a device to filter the UNR routes to be advertised. |
- |
static |
Configures a device to filter the static routes to be advertised. |
- |
ospfv3 |
Configures a device to filter the OSPFv3 routes to be advertised. |
- |
ripng |
Configures a device to filter the RIPNG routes to be advertised. |
- |
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 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-VPN instance IPv4 address family view, BGP-IPv6 unicast address family view and BGP-VPN instance IPv6 address family view.
acl-number and ip-prefix-name 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-name 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-VPNv4 address family view, BGP-VPN instance IPv4 address family view, BGP-VPN instance IPv6 address family view, BGP-IPv6 unicast address family view, BGP-IPv4 unicast address family view
Usage Scenario
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 (BGP) 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.
Configuration Impact
If the filter-policy export command with the same protocol value being specified is run several 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 are advertised to the specified peer.
# Use ACL 2000 to filter all the routes advertised by BGP.
<sysname> system-view
[sysname] bgp 100
[sysname-bgp] ipv4-family unicast
[sysname-bgp-af-ipv4] filter-policy 2000 export
<sysname> system-view
[sysname] bgp 100
[sysname-bgp] ipv6-family unicast
[sysname-bgp-af-ipv6] filter-policy 2000 export