< Home

Configuring the If-Match Clause

The if-match clauses define the rules for matching certain route attributes.

Context

if-match clauses: define the matching rules. The matching rules are used by the routes that match the Route-Policy. The matching objects refer to some attributes of the route.

If no if-match clause is specified, all the routes can pass the filtering on the node.

Procedure

  1. Access the system view.

    system-view

  2. Access the Route-Policy view.

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

  3. Run the following command as required:

    • Configure an ACL to match the routes.

      if-match acl acl-number

    • Configure a cost to match the routes.

      if-match cost cost

    • Configure the outbound interface to match the routes.

      if-match interface interface-type interface-number

    • Configure the next hop or the source address to match the routes.

      if-match ip { next-hop | route-source | group-address } { acl acl-number | ip-prefix ip-prefix-name }

    • Configure the IP prefix list to match the routes.

      if-match ip-prefix ip-prefix-name

      For the same Route-Policy node, you cannot run the if-match acl command and the if-match ip-prefix command at the same time. This is because the latest configuration overrides the previous configuration.

    • Configure an if-match clause to match AS_Path filters.

      if-match as-path-filter { as-path-filter-number &<1-16> | as-path-filter-name }

    • Configure an if-match clause to match the community attributes of BGP routing information.

      if-match community-filter { basic-comm-filter-num [ whole-match ] | adv-comm-filter-num } &<1-16>

    • Configure an if-match clause to match the extended community attribute of BGP routing information.

      if-match extcommunity-filter { { basic-extcomm-filter-num | adv-extcomm-filter-num } &<1-16> | extcomm-filter-name }

    • Configure the route type (OSPF in this case) to match the routes.

      if-match route-type { external-type1 | external-type1or2 | external-type2 | internal | nssa-external-type1 | nssa-external-type1or2 | nssa-external-type2 }

    • Configure the destination address, next hop, or the source address to match the ipv6 routes.

      if-match ipv6 { address | next-hop | route-source } prefix-list prefix-list-name

    • Configure the route type (IS-IS in this case) to match the routes.

      if-match route-type { is-is-level-1 | is-is-level-2 }

    • Configure the tag to match the routes.

      if-match tag tag

    • Configure the preference to match the routes.

      if-match preference preference

    The commands in step 3 can be used regardless of the order. A node can have multiple or no if-match clauses.

    • For the same node in a route-policy, the relationship between if-match clauses is "AND". The route must meet all the matching rules before the actions defined by the apply clauses are performed. In the if-match route-type and if-match interface commands, the relationship between the if-match clauses is "OR". In other commands, the relationship between if-match clauses is "AND".
    • If no if-match clause is specified, all the routes meet the matching rules.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >