The if-match clauses define the matching rules that are used to match certain route attributes.
The system view is displayed.
The route-policy view is displayed.
A matching rule based on a basic ACL is configured.
Run quit
Return to the system view.
Run acl { name basic-acl-name { basic | [ basic ] number basic-acl-number } | [ number ] basic-acl-number } [ match-order { config | auto } ]
The ACL view is displayed.
Run rule [ rule-id ] [ name rule-name ] { deny | permit }
A rule is configured for the ACL.
When the rule command is used to configure a filtering rule for a named ACL, only the configurations specified by source and time-range take effect.
If the action specified in an ACL rule is permit, a route matching the rule will be accepted or advertised by the system.
If the action specified in an ACL rule is deny, a route matching the rule will not be accepted or advertised by the system.
If the network segment of a route is not within the range specified in an ACL rule, the route will not be accepted or advertised by the system.
If an ACL does not contain any rules, none of the routes matched against the filter-policy that uses this ACL will be accepted or advertised by the system.
Routes can be filtered using a blacklist or whitelist:
If ACL rules are used for matching in configuration order, the system matches the rules in ascending order of their IDs.
Filtering using a blacklist: Configure a rule with a smaller ID and specify the action deny in this rule to filter out the unwanted routes. Then, configure another rule with a larger ID in the same ACL and specify the action permit in this rule to accept or advertise the other routes.
Filtering using a whitelist: Configure a rule with a smaller ID and specify the action permit in this rule to permit the routes to be accepted or advertised. Then, configure another rule with a larger ID in the same ACL and specify the action deny in this rule to filter out the unwanted routes.
To configure a rule to match routes against a specified cost, run the if-match cost cost or if-match cost { greater-equal greater-equal-value [ less-equal less-equal-value ] | less-equal less-equal-value } command.
To configure a rule to match routes against a specified route preference, run the if-match preference preference command.
To configure a rule to match IPv4 routes against a specified next hop or source address, run the if-match ip { next-hop | route-source | group-address } { acl { acl-number | acl-name } | ip-prefix ip-prefix-name } command.
To configure a rule to match routes against a specified IP prefix list, run the if-match ip-prefix ip-prefix-name command.
The commands in Step 3 can be run in any required order. A node may have multiple if-match clauses or no if-match clause.
If no if-match clause is specified, all routes will match the route-policy node.
The configuration is committed.