Configuring if-match clauses

You can either specify no if-match clauses or multiple if-match clauses for a routing policy node. If no if-match clauses are specified for a permit-mode node, all routes can pass the node. If no if-match clauses are specified for a deny-mode node, no routes can pass the node.

The if-match clauses of a routing policy node have a logical AND relationship. A route must meet all if-match clauses before it can be executed by the apply clauses of the node. If an if-match command exceeds the maximum length, multiple identical if-match clauses are generated. These clauses have a logical OR relationship. A route only needs to match one of them.

To configure if-match clauses:

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter routing policy node view.

route-policy route-policy-name { deny | permit } node node-number

N/A

3. Match routes whose destination, next hop, or source matches an ACL or prefix list.

  • Match IPv4 routes whose destination, next hop, or source matches an ACL or IPv4 prefix list:if-match ip { address | next-hop | route-source } { acl acl-number | prefix-list prefix-list-name }

  • Match IPv6 routes whose destination, next hop, or source matches an ACL or IPv6 prefix list:if-match ipv6 { address | next-hop | route-source } { acl acl6-number | prefix-list prefix-list-name }

By default, no ACL or prefix list match criterion is configured.

If the ACL used by an if-match clause does not exist, the clause is always matched. If no rules of the specified ACL are matched or the match rules are inactive, the clause is not matched.

4. Match routes having the specified cost.

if-match cost value

By default, no cost match criterion is configured.

5. Match routes having the specified output interface.

if-match interface { interface-type interface-number }&<1-16>

By default, no output interface match criterion is configured.

6. Match IGP routes having the specified tag value.

if-match tag value

By default, no tag match criterion is configured.