Parameterization - Cisco ASR 9000 Series Configuration Manual

Aggregation services router
Hide thumbs Also See for ASR 9000 Series:
Table of Contents

Advertisement

Parameterization

The apply statement indicates that the policy drop-everything should be executed if the route under
consideration passed through autonomous system 1234.5 before it is received. If a route that has autonomous
system 1234.5 in its AS path is received, the route is dropped; otherwise, the route is accepted without
modification. This policy is an example of a hierarchical policy. Thus, the semantics of the apply statement
are just as if the applied policy were cut and pasted into the applying policy:
route-policy check-as-1234-prime
if as-path passes-through '1234.5' then
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.
Cisco ASR 9000 Series Aggregation Services Router Routing Configuration Guide, Release 5.1.x
480
drop
pass
Implementing Routing Policy
OL-30423-03

Advertisement

Table of Contents
loading

Table of Contents