Specifying match conditions

You can specify the following match conditions in a policy statement:

  • Match routes by their protocol type – BGP, static, direct, host, IS-IS, OSPF, and so on.

  • Match routes of any protocol by their address family – IPv4-unicast, IPv6-unicast, EVPN.

  • Match routes of any protocol by their IPv4/IPv6 prefix.

  • Match aggregate and BGP routes by their standard and large communities.

  • Match BGP routes by their AS path length.

  • Match BGP routes by their AS path encoding.

  • Match BGP routes by whether the EVPN route has an Ethernet Segment identifier (ESI) that matches a member of a specified ESI set.

  • Match BGP routes by whether the EVPN route has an Ethernet tag ID that matches a member of a specified Ethernet tag set.

  • Match BGP routes by whether the EVPN type-2 route has a MAC address that matches a member of a specified MAC set.

  • Match BGP routes by whether the originating router’s IP address in an EVPN type-3 or type-4 route matches a specified IP address.

  • Match BGP routes by whether the EVPN route is a specified route type (ethernet-ad, mac-ip, ethernet-segment, imet, or ip-prefix).

  • Match BGP routes by whether the BGP VPN route has a specified route distinguisher value.

  • Match IS-IS routes by their association with either Level1 (L1) or Level2 (L2).

  • Match IS-IS routes by their route type (internal or external). An IPv4 route is internal if the prefix was signaled in TLV 128. An IPv4 route is external if the prefix was signaled in TLV 130. The encoding of TLV 236 indicates whether an IPv6 route is internal or external.

  • Match IS-IS routes by their tag value.

  • Match OSPF routes by their area ID.

  • Match OSPF routes by their route type (intra-area, inter-area, type-1-ext, type-2-ext, type-1-nssa, type-2-nssa, summary-aggregate, or nssa-aggregate).

  • Match OSPF routes by instance ID.

  • Match routes based on EVPN route type.

  • Match routes based on IP addresses and prefixes via prefix-sets for route types 2 and 5.

  • Match routes based BGP encapsulation extended community.

If a statement has no match conditions defined, all routes evaluated by the policy are considered to be matches.

The following example specifies BGP protocol as a match condition in a policy statement:

--{ candidate shared default }--[  ]--
# info routing-policy policy policy01
    routing-policy {
        policy policy01 {
            statement 100 {
                match {
                    protocol bgp
                }
            }
        }
    }