The if-match ip-prefix command sets a matching rule that is based on the IP prefix list.
The undo if-match ip-prefix command cancels the configuration.
By default, no matching rule based on the IP prefix list is set.
| Parameter | Description | Value |
|---|---|---|
| ip-prefix-name | Specifies the name of the IP 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. |
Usage Scenario
After an IP prefix list is configured as a matching rule of a routing policy on a device, the device matches routes by using the IP prefix list, and permits or denies the routes that match the IP prefix list.
The ip ip-prefix command must be used to configure an IP prefix so that the matching rule configured through the if-match ip-prefix command can take effect. For example:
Prerequisites
The if-match ip-prefix command can be used only after the route-policy command is used.
Configuration Impact
When you filter routes based on the IP prefixes, the routes that match the matching rule are permitted and the routes that do not match the matching rule are denied.
Precautions
The if-match ip-prefix and if-match acl commands are mutually exclusive. If you run the if-match acl command after running the if-match ip-prefix command, the configuration of the if-match acl command overrides the configuration of the if-match ip-prefix command.
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 match the IP prefix list.