Cisco Systems IOS XR Laptop User Manual


 
Implementing Routing Policy on Cisco IOS XR Software
Information About Implementing Routing Policy
RC-220
Cisco IOS XR Routing Configuration Guide
Unlike traditional !-comments in the CLI, RPL remarks persist through reboots and when configurations
are saved to disk or a TFTP server and then loaded back onto the router.
Disposition
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, the following policy
drops all routes because it neither modifies the attribute of any route nor explicitly passes it.
route-policy EMPTY
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 route-policy 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