Categories of Routing Policy Match Conditions
A match condition defines the criteria that a route must match. You can define one or more match conditions. If a route matches all match conditions, one or more actions are applied to the route.
Match conditions fall into two categories: standard and extended. In general, the extended match conditions are more complex than standard match conditions. The extended match conditions provide many powerful capabilities. The standard match conditions include criteria that are defined within a routing policy and are less complex than the extended match conditions, also called named match conditions.
Extended match conditions are defined separately from the routing policy and are given names. You then reference the name of the match condition in the definition of the routing policy itself.
Named match conditions allow you to do the following:
Reuse match conditions in other routing policies.
Read configurations that include complex match conditions more easily.
Named match conditions include communities, prefix lists, and AS path regular expressions.
Table 1 describes each match condition, including its category, when you typically use it, and any relevant notes about it. For more information about match conditions, see Routing Policy Match Conditions.
Match Condition |
Category |
When to Use |
Notes |
---|---|---|---|
AS path regular expression—A combination of AS numbers and regular expression operators. |
Extended |
(BGP only) Match a route based on its AS path. (An AS path consists of the AS numbers of all routers a packet must go through to reach a destination.) You can specify an exact match with a particular AS path or a less precise match. |
You use regular expressions to match the AS path. |
Community—A group of destinations that share a property. (Community information is included as a path attribute in BGP update messages.) |
Extended |
Match a group of destinations that share a property. Use a routing policy to define a community that specifies a group of destinations you want to match and one or more actions that you want taken on this community. |
Actions can be performed on the entire group. You can create multiple communities associated with a particular destination. You can create match conditions using regular expressions. |
Prefix list—A named list of IP addresses. |
Extended |
Match a route based on prefix information. You can specify an exact match of a particular route only. |
You can specify a common action only for all prefixes in the list. |
Route list—A list of destination prefixes. |
Extended |
Match a route based on prefix information. You can specify an exact match of a particular route or a less precise match. |
You can specify an action for each prefix in the route list or a common action for all prefixes in the route list. |
Standard—A collection of criteria that can match a route. |
Standard |
Match a route based on one of the following criteria: area ID, color, external route, family, instance (routing), interface name, level number, local preference, metric, neighbor address, next-hop address, origin, preference, protocol, routing table name, or tag. You can specify a match condition for policies based on protocols by naming a protocol from which the route is learned or to which the route is being advertised. |
None. |
Subroutine—A routing policy that is called repeatedly from another routing policy. |
Extended |
Use an effective routing policy in other routing policies. You can create a subroutine that you can call over and over from other routing policies. |
The subroutine action influences but does not necessarily determine the final action. For more information, see How a Routing Policy Subroutine Is Evaluated. |
Each term can consist of two statements, from
and to
, that define match conditions:
In the
from
statement, you define the criteria that an incoming route must match. You can specify one or more match conditions. If you specify more than one, all conditions must match the route for a match to occur.In the
to
statement, you define the criteria that an outgoing route must match. You can specify one or more match conditions. If you specify more than one, all conditions must match the route for a match to occur.
The order of match conditions in a term is not important, because a route must match all match conditions in a term for an action to be taken.