Cisco Systems IOS XR Laptop User Manual


 
Implementing Routing Policy on Cisco IOS XR Software
Information About Implementing Routing Policy
RC-207
Cisco IOS XR Routing Configuration Guide
policy. For example, three policies that are identical in every way except for the local preference value
they set can be represented as one common parameterized policy that takes the varying local preference
value as a parameter to the policy.
The policy language introduces the notion of sets. Sets are containers of similar data that can be used in
route attribute matching and setting operations. Four set types exist: prefix-sets, community-sets,
as-path-sets, and extcommunity-sets. These sets hold groupings of IPv4 or IPv6 prefixes, community
values, AS path regular expressions, and extended community values, respectively. Sets are simply
containers of data. Most sets also have an inline variant. An inline set allows for small enumerations of
values to be used directly in a policy rather than having to refer to a named set. Prefix lists, community
lists, and AS path lists must be maintained even when only one or two items are in the list. An inline set
in RPL allows the user to place small sets of values directly in the policy body without having to refer
to a named set.
Decision making, such as accept and deny, is explicitly controlled by the policy definitions themselves.
RPL combines matching operators, which may use set data, with the traditional Boolean logic operators
and, or, and not into complex conditional expressions. All matching operations return a true or false
result. The execution of these conditional expressions and their associated actions can then be controlled
by using simple if then, elseif, and else structures, which allow the evaluation paths through the policy
to be fully specified by the user.
Routing Policy Language Structure
This section describes the basic structure of RPL.
Names
The policy language provides two kinds of persistent, namable objects: sets and policies. Definition of
these objects is bracketed by beginning and ending command lines. For example, to define a policy
named test, the configuration syntax would look similar to the following:
route-policy test
[ . . . policy statements . . . ]
end-policy
Legal names for policy objects can be any sequence of the upper- and lowercase alphabetic characters;
the numerals 0 to 9; and the punctuation characters period, hyphen, and underscore. A name must begin
with a letter or numeral.
Sets
In this context, the term set is used in its mathematical sense to mean an unordered collection of unique
elements. The policy language provides sets as a container for groups of values for matching purposes.
Sets are used in conditional expressions. The elements of the set are separated by commas. Null (empty)
sets are not allowed.
Four kinds of sets exist: as-path-set, community-set, extcommunity-set, and prefix-set. You may want to
perform comparisons against a small number of elements, such as two or three community values, for
example. To allow for these comparisons, the user can enumerate these values directly. These
enumerations are referred to as inline sets. Functionally, inline sets are equivalent to named sets, but
allow for simple tests to be inline. Thus, comparisons do not require that a separate named set be
maintained when only one or two elements are being compared. See the set types described in the
following sections for the syntax. In general, the syntax for an inline set is a comma-separated list