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-371
Cisco IOS XR Routing Configuration Guide
OL-14356-01
By default, a route is dropped at the end of policy processing unless either the policy modifies a route
attribute or it passes the route by means of an explicit pass statement. For example, if route-policy B is
applied within route-policy A, then execution continues from policy A to policy B and back to policy A,
provided the prefix is not dropped by policy B.
route-policy A
if as-path neighbor-is '123' then
apply B
policy statement N
end-policy
Whereas the following policies pass all routes that they evaluate.
route-policy PASS-ALL
pass
end-policy
route-policy SET-LPREF
set local-preference 200
end-policy
In addition to being implicitly dropped, a route may be dropped by an explicit drop statement. Drop
statements cause a route to be dropped immediately so that no further policy processing is done. Note
also that a drop statement overrides any previously processed pass statements or attribute modifications.
For example, the following policy drops all routes. The first pass statement is executed, but is then
immediately overridden by the drop statement. The second pass statement never gets executed.
route-policy DROP-EXAMPLE
pass
drop
pass
end-policy
When one policy applies another, it is as if the applied policy were copied into the right place in the
applying policy, and then the same drop-and-pass semantics are put into effect. For example, policies
ONE and TWO are equivalent to policy ONE-PRIME:
route-policy ONE
apply two
if as-path neighbor-is '123' then
pass
endif
end-policy
route-policy TWO
if destination in (10.0.0.0/16 le 32) then
drop
endif
end-policy
route-policy ONE-PRIME
if destination in (10.0.0.0/16 le 32) then
drop
endif
if as-path neighbor-is '123' then
pass
endif
end-policy