
route-policy Child A
if destination in (10.10.0.0/16) then
set local-pref 111
endif
end-policy
!
route-policy Child B
if as-path originates-from '222' then
set community (333:222) additive
endif
end-policy
!
route-policy Parent
if apply Child A and apply Child B then
set community (333:333) additive
else
set community (333:444) additive
endif
end-policy
!
In the above scenarios, whenever the policy
Parent
is executed, the decision of the "if" condition in that is
selected based on the result of policies
Child A
and
Child B
. The policy
Parent
is equivalent to policy
merged
as given below:
route-policy merged
if destination in (10.10.0.0/16) and as-path originates-from '222' then
set local-pref 111
set community (333:222, 333:333) additive
elseif destination in (10.10.0.0/16) then /*Only Policy Child A is pass */
set local-pref 111
set community (333:444) additive /*From else block */
elseif as-path originates-from '222' then /*Only Policy Child B is pass */
set community (333:222, 333:444) additive /*From else block */
else
set community (333:444) additive /*From else block */
endif
end-policy
Apply Conditions can be used with parameters and are supported on all attach points and on all clients.
Hierarchical Apply Conditions can be used without any constraints on a cascaded level.
Existing route policy semantics can be expanded to include this Apply Condition:
Route-policy policy_name
If apply policyA and apply policyB then
Set med 100
Else if not apply policyD then
Set med 200
Else
Set med 300
Endif
End-policy
Routing Configuration Guide for Cisco NCS 6000 Series Routers, IOS XR Release 6.4.x
446
Implementing Routing Policy
Apply Condition Policies