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-367
Cisco IOS XR Routing Configuration Guide
OL-14356-01
set community (10:24) additive
set community (10:25) additive
end-policy
This policy sets the community string on the route to contain all three community values: 10:23, 10:24,
and 10:25.
The second of these cases is AS path prepending. Consider a policy of the form:
route-policy prepend-example
prepend as-path 2.5 3
prepend as-path 666.5 2
end-policy
This policy prepends 666.5 666.5 2.5 2.5 2.5 to the AS path. This prepending is a result of all actions
being taken and to the AS path being an attribute that contains an array of values rather than a simple
scalar value.
When Attributes Are Modified
A policy does not modify route attribute values until all tests have been completed. In other words,
comparison operators always run on the initial data in the route. Intermediate modifications of the route
attributes do not have a cascading effect on the evaluation of the policy. Take the following example:
if med eq 12 then
set med 42
if med eq 42 then
drop
endif
endif
This policy never executes the drop statement because the second test (med eq 42) sees the original,
unmodified value of the MED in the route. Because the MED has to be 12 to get to the second test, the
second test always returns false.
Default Drop Disposition
All route policies have a default action to drop the route under evaluation unless the route has been
modified by a policy action or explicitly passed. Applied (nested) policies implement this disposition as
though the applied policy were pasted into the point where it is applied.
Consider a policy to allow all routes in the 10 network and set their local preference to 200 while
dropping all other routes. You might write the policy as follows:
route-policy two
if destination in (10.0.0.0/8 ge 8 le 32) then
set local-preference 200
endif
end-policy
route-policy one
apply two
end-policy
It may appear that policy one drops all routes because it neither contains an explicit pass statement nor
modifies a route attribute. However, the applied policy does set an attribute for some routes and this
disposition is passed along to policy one. The result is that policy one passes routes with destinations in
network 10, and drops all others.