[Contents] [Prev] [Next] [Index] [Report an Error]

Routing Policy Components

Routing policies are made up of one or more terms, which contain a set of match conditions and a set of actions. Match conditions are criteria that a route must match before the actions can be applied. If a route matches all criteria, one or more actions are applied to the route. These actions specify whether to accept or reject the route, control how a series of policies are evaluated, and manipulate the characteristics associated with a route.

This section contains the following topics:

Routing Policy Terms

A term is a named structure in which match conditions and actions are defined. Each routing policy contains one or more terms.

Generally, a Services Router compares a route against the match conditions of each term in a routing policy, starting with the first and moving through the terms in the order in which they are defined, until a match is made and an explicitly configured or default action of accept or reject is taken. If none of the terms in the policy match the route, the Services Router compares the route against the next policy, and so on, until either an action is taken or the default policy is evaluated.

Routing Policy Match Conditions

A match condition defines the criteria that a route must match for an action to take place. Each term can have one or more match conditions. If a route matches all the match conditions for a particular term, the actions defined for that term are processed.

Each term can consist of two statements, to and from, that define match conditions:

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.

Table 55 summarizes the routing policy match conditions.

Table 55: Summary of Routing Policy Match Conditions

aggregate-contributor

Matches routes that are contributing to a configured aggregate. This match condition can be used to suppress a contributor in an aggregate route.

area area-id

Matches a route learned from the specified OSPF area during the exporting of OSPF routes into other protocols.

as-path name

Name of an AS path regular expression. BGP routes whose AS path matches the regular expression are processed.

color preference

Color value. You can specify preference values that are finer-grained than those specified in the preference match conditions. The color value can be a number from 0 through 4,294,967,295 (232 – 1). A lower number indicates a more preferred route.

community

Name of one or more communities. If you list more than one name, only one name needs to match for a match to occur. (The matching is effectively a logical OR operation.)

external [type metric-type]

Matches external OSPF routes, including routes exported from one level to another. In this construct type is an optional keyword. The metric-type value can be either 1 or 2. When you do not specify type, this condition matches all external routes.

interface interface-name

Name or IP address of one or more router interfaces. Do not use this qualifier with protocols that are not interface-specific, such as internal BGP (IBGP).

Depending on where the policy is applied, this match condition matches routes learned from or advertised through the specified interface.

internal

Matches a routing policy against the internal flag for simplified next-hop self policies.

level level

Matches the IS-IS level. Routes that are from the specified level or are being advertised to the specified level are processed.

local-preference value

BGP local preference attribute. The preference value can be from 0 through 4,294,967,295 (232 – 1).

metric metric

metric2 metric

Metric value. The metric value corresponds to the multiple exit discriminator (MED), and metric2 corresponds to the interior gateway protocol (IGP) metric if the BGP next hop runs back through another route.

neighbor address

Address of one or more neighbors (peers).

For BGP export policies, the address can be a directly connected or indirectly connected peer. For all other protocols, the address is the neighbor from which the advertisement is received.

next-hop address

Next-hop address or addresses specified in the routing information for a particular route. For BGP routes, matches are performed against each protocol next hop.

origin value

BGP origin attribute, which is the origin of the AS path information. The value can be one of the following:

  • egp—Path information originated from another AS.
  • igp—Path information originated from within the local AS.
  • incomplete—Path information was learned by some other means.

policy [ policy-names ]

Name of one or more policies to evaluate as a subroutine.

preference preference

preference2 preference

Preference value. You can specify a primary preference value (preference) and a secondary preference value (preference2). The preference value can be a number from 0 through 4,294,967,295 (232 – 1). A lower number indicates a more preferred route.

prefix-list name

Named list of IP addresses configured at the Policy-options level in the configuration hierarchy.

This match condition can be used on import policies only.

protocol protocol

Name of the protocol from which the route was learned or to which the route is being advertised. It can be one of the following: aggregate, bgp, direct, dvmrp, isis, local, ospf, pim-dense, pim-sparse, rip, ripng, or static.

route-filter destination-prefix match-type <actions>

List of destination prefixes. When specifying a destination prefix, you can specify an exact match with a specific route or a less precise match using match types. You can configure either a common action that applies to the entire list or an action associated with each prefix.

Route filters can be used on import policies only.

route-type value

Type of route. The value can be either external or internal.

source-address-filter destination-prefix match-type <actions>

List of multicast source addresses. When specifying a source address, you can specify an exact match with a specific route or a less precise match using match types. You can configure either a common action that applies to the entire list or an action associated with each prefix.

Source-address filters can be used on import policies only.

Routing Policy Actions

An action defines what the Services Router does with the route when the route matches all the match conditions in the from and to statements for a particular term. If a term does not have from and to statements, all routes are considered to match and the actions apply to all routes.

Each term can have one or more of the following types of actions. The actions are configured under the then statement.

Table 56 summarizes the routing policy actions.

If you do not specify an action, one of the following results occurs:

Table 56: Summary of Key Routing Policy Actions

Flow Control Actions

These actions control the flow of routing information into and out of the routing table.

accept

Accepts the route and propagates it. After a route is accepted, no other terms in the routing policy and no other routing policies are evaluated.

reject

Rejects the route and does not propagate it. After a route is rejected, no other terms in the routing policy and no other routing policies are evaluated.

next term

Skips to and evaluates the next term in the same routing policy. Any accept or reject action specified in the then statement is ignored. Any actions specified in the then statement that manipulate route characteristics are applied to the route.

next policy

Skips to and evaluates the next routing policy. Any accept or reject action specified in the then statement is ignored. Any actions specified in the then statement that manipulate route characteristics are applied to the route.

Route Manipulation Actions

These actions manipulate the route characteristics.

as-path-prepend as-path

Appends one or more autonomous system (AS) numbers at the beginning of the AS path. If you are specifying more than one AS number, include the numbers in quotation marks.

The AS numbers are added after the local AS number has been added to the path. This action adds AS numbers to AS sequences only, not to AS sets. If the existing AS path begins with a confederation sequence or set, the appended AS numbers are placed within a confederation sequence. Otherwise, the appended AS numbers are placed with a nonconfederation sequence.

as-path-expand last-as count n

Extracts the last AS number in the existing AS path and appends that AS number to the beginning of the AS path n times. Replace n with a number from 1 through 32.

The AS numbers are added after the local AS number has been added to the path. This action adds AS numbers to AS sequences only, not to AS sets. If the existing AS path begins with a confederation sequence or set, the appended AS numbers are placed within a confederation sequence. Otherwise, the appended AS numbers are placed with a nonconfederation sequence.

class class-name

Applies the specified class-of-service (CoS) parameters to routes installed into the routing table.

color preference

color2 preference

Sets the preference value to the specified value. The color and color2 preference values can be a number from 0 through 4,294,967,295 (232 – 1). A lower number indicates a more preferred route.

damping name

Applies the specified route-damping parameters to the route. These parameters override BGP's default damping parameters.

This action is useful only in import policies.

local-preference value

Sets the BGP local preference attribute. The preference can be a number from 0 through 4,294,967,295 (232 – 1).

metric metric

metric2 metric

metric3 metric

metric4 metric

Sets the metric. You can specify up to four metric values, starting with metric (for the first metric value) and continuing with metric2, metric3, and metric4.

For BGP routes, metric corresponds to the MED, and metric2 corresponds to the IGP metric if the BGP next hop loops through another router.

next-hop address

Sets the next hop.

If you specify address as self, the next-hop address is replaced by one of the local router's addresses. The advertising protocol determines which address to use.

Default and Final Actions

If none of the terms' match conditions evaluate to true, the final action is executed. The final action is defined in an unnamed term. Additionally, you can define a default action (either accept or reject) that overrides any action intrinsic to the protocol.


[Contents] [Prev] [Next] [Index] [Report an Error]