The if-match ip route-source ip-prefix command configures a filtering rule that is based on IP addresses of the source devices from which routes are received.
The undo if-match ip route-source ip-prefix command cancels the configuration.
By default, no filtering rule based on IP addresses of the source devices from which routes are received is configured.
Usage Scenario
The if-match ip command is widely applied. The filtering rule configured using this command takes effect only after an IP prefix or an ACL is configured. For example:
Prerequisites
A route-policy has been configured using the route-policy command.
An IP prefix has been configured using the ip ip-prefix command.Configuration Impact
When you filter routes based on the source addresses, the routes that match the filtering rule are permitted and the route that do not match the filtering rule are denied.
Precautions
If the next hop address or source address of a route to be filtered is 0.0.0.0, by default, the system considers the mask length as 0 and matches the route.
If the next hop address or source address of a route to be filtered is not 0.0.0.0, by default, the system considers the mask length as 32 and matches the route.<HUAWEI> system-view [~HUAWEI] ip ip-prefix p1 permit 10.0.192.0 8 greater-equal 17 less-equal 18 [*HUAWEI] route-policy policy permit node 10 [*HUAWEI-route-policy] if-match ip route-source ip-prefix p1