Parameterization - Cisco NCS 5500 Series Configuration Manuals

Routing configuration ios xr release 6.3.x
Hide thumbs Also See for NCS 5500 Series:
Table of Contents

Advertisement

Implementing Routing Policy
else
endif
end-policy
You may have as many levels of hierarchy as desired. However, many levels may be difficult to maintain and
understand.

Parameterization

In addition to supporting reuse of policies using the apply statement, policies can be defined that allow for
parameterization of some of the attributes. The following example shows how to define a parameterized policy
named param-example. In this case, the policy takes one parameter, $mytag. Parameters always begin with
a dollar sign and consist otherwise of any alphanumeric characters. Parameters can be substituted into any
attribute that takes a parameter.
In the following example, a 16-bit community tag is used as a parameter:
route-policy param-example ($mytag)
set community (1234:$mytag) additive
end-policy
This parameterized policy can then be reused with different parameterization, as shown in the following
example. In this manner, policies that share a common structure but use different values in some of their
individual statements can be modularized. For details on which attributes can be parameterized, see the
individual attribute sections.
route-policy origin-10
if as-path originates-from '10.5' then
apply param-example(10.5)
else
pass
endif
end-policy
route-policy origin-20
if as-path originates-from '20.5' then
apply param-example(20.5)
else
pass
endif
end-policy
The parameterized policy param-example provides a policy definition that is expanded with the values provided
as the parameters in the apply statement. Note that the policy hierarchy is always maintained, Thus, if the
definition of param-example changes, then the behavior of origin_10 and origin_20 changes to match.
The effect of the origin-10 policy is that it adds the community 1234:10 to all routes that pass through this
policy and have an AS path indicating the route originated from autonomous system 10. The origin-20 policy
is similar except that it adds to community 1234:20 for routes originating from autonomous system 20.
pass
Routing Configuration Guide for Cisco NCS 5500 Series Routers, IOS XR Release 6.3.x
Parameterization
145

Advertisement

Table of Contents
loading

Table of Contents