The filter-policy export command configures global-level, protocol-level, and interface-level export filtering policies. Only the routes that match the filtering policy can be added into the routing table and advertised through Update packets.
The undo filter-policy export command cancels the configuration. To delete an interface-level route filtering policy, you must specify the interface-type and interface-number parameters in the undo filter-policy export command so that only the specified route filtering policy can be deleted.
By default, the route filtering function is disabled.
filter-policy { acl-number | ip-prefix ip-prefix-name } export [ static | direct | bgp | unr | { rip | ospf | isis } [ process-id ] | interface-type interface-number ]
undo filter-policy [ acl-number | ip-prefix ip-prefix-name ] export [ static | direct | bgp | unr | { rip | ospf | isis } [ process-id ] | interface-type interface-number ]
| Parameter | Description | Value |
|---|---|---|
| acl-number | Specifies the number of the basic ACL that is used to filter the destination addresses of routes. | The value is an integer ranging from 2000 to 2999. |
| ip-prefix ip-prefix-name | Specifies the name of the IP prefix list that is used to filter the destination addresses of routes. | The value must be the name of an existing IP prefix list. |
| static | Specifies static routes. | - |
| direct | Specifies direct routes. | - |
| bgp | Specifies BGP routes. | - |
| unr | Specifies UNR routes. | - |
| rip | Specifies RIP routes. | - |
| ospf | Specifies OSPF routes. | - |
| isis | Specifies IS-IS routes. | - |
| process-id | Specifies the process ID. | The value is an integer ranging from 1 to 65535. The default value is 1. |
| interface-type interface-number | Specifies type and number of the interface based on which routes are filtered. | - |
The filter-policy export command is configured in the RIP process. If routes are filtered based on an interface or a protocol, you can configure only one routing policy based on an interface or a protocol at a time. If no interface or protocol is specified, the system considers the configured routing policy as the global routing policy, and only one routing policy can be configured at a time. If the routing policy is configured repeatedly, the new routing policy overwrites the old routing policy.
# Filter the imported static routes based on the IP prefix list named abc. Then, only the routes that match the filtering policy are added into the RIP routing table and then sent through RIP Update packets.
<sysname> system-view [sysname] rip 100 [sysname-rip-100] filter-policy ip-prefix abc export static
# Filter the routes imported from IS-IS process 1 based on ACL 2002. Only the routes that match the filtering policy are added into the RIP routing table and then sent through RIP Update packets.
<sysname> system-view [sysname] rip 100 [sysname-rip-100] filter-policy 2002 export isis 1