Cisco Systems OL-14356-01 Network Router User Manual


 
Implementing Routing Policy on Cisco IOS XR Software
Information About Implementing Routing Policy on Cisco IOS XR Software
RC-365
Cisco IOS XR Routing Configuration Guide
OL-14356-01
In the example below, we define a parameterized policy "param-example". In this example, the policy
takes two parameters "$mymed" and “$prefixset”. 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 this example we are passing a MED value and prefix set name as parameters.
route-policy param-example ($mymed, $prefixset)
if destination in $prefixset then
set med $mymed
endif
end-policy
This parameterized policy can then be reused with different parameterizations as shown in the example
below. 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 attributes for each protocol.
router bgp 2
neighbor 10.1.1.1
remote-as 3
address-family ipv4 unicast
route-policy param-example(10, prefix_set1)
route-policy param-example(20, prefix_set2)
The parameterized policy param-example provides a policy definition that is expanded with the values
provided as the parameters in the neighbor route-policy in and out statement.
Global Parameterization
RPL supports the definition of systemwide global parameters that can be used inside policy definition.
Global parameters can be configured as follows:
Policy-global
glbpathtype ‘ebgp’
glbtag ‘100’
end-global
The global parameter values can be used directly inside a policy definition similar to the local parameters
of parameterized policy. In the following example, the globalparam argument, which makes use of the
global parameters gbpathtype and glbtag, is defined for a nonparameterized policy.
route-policy globalparam
if path-type is $glbpathtype then
set tag $glbtag
endif
end-policy
When a parameterized policy has a parameter name “collision” with a global parameter name,
parameters local to policy definition take precedence, effectively masking off global parameters. In
addition, a validation mechanism is in place to prevent the deletion of a particular global parameter if it
is referred by any policy.
Semantics of Policy Application
This section discusses how routing policies are evaluated and applied. The following concepts are
discussed:
Boolean Operator Precedence, page RC-366
Multiple Modifications of the Same Attribute, page RC-366