Policy Definitions - Cisco NCS 5500 Series Configuration Manuals

Routing configuration ios xr release 6.3.x
Hide thumbs Also See for NCS 5500 Series:
Table of Contents

Advertisement

Policy Definitions

the policy makes the policy easier to understand, modify at a later date, and troubleshoot if an unexpected
behavior occurs.
prefix-set rfc1918
# These are the networks defined as private in RFC1918 (including
# all subnets thereof)
10.0.0.0/8 ge 8,
172.16.0.0/12 ge 12,
192.168.0.0/16 ge 16
end-set
route-policy quickstart-remarks
# Handle routes to RFC1918 networks
if destination in rfc1918 then
# Set the community such that we do not export the route
set community (no-export) additive
endif
end-policy
Policy Definitions
Policy definitions create named sequences of policy statements. A policy definition consists of the CLI
route-policy keyword followed by a name, a sequence of policy statements, and the end-policy keyword.
For example, the following policy drops any route it encounters:
route-policy drop-everything
drop
end-policy
The name serves as a handle for binding the policy to protocols. To remove a policy definition, issue the no
route-policy name command.
Policies may also refer to other policies such that common blocks of policy can be reused. This reference to
other policies is accomplished by using the apply statement, as shown in the following example:
route-policy check-as-1234
if as-path passes-through '1234.5' then
apply drop-everything
else
pass
endif
end-policy
The apply statement indicates that the policy drop-everything should be executed if the route under
consideration passed through autonomous system 1234.5 before it is received. If a route that has autonomous
system 1234.5 in its AS path is received, the route is dropped; otherwise, the route is accepted without
modification. This policy is an example of a hierarchical policy. Thus, the semantics of the apply statement
are just as if the applied policy were cut and pasted into the applying policy:
route-policy check-as-1234-prime
if as-path passes-through '1234.5' then
Routing Configuration Guide for Cisco NCS 5500 Series Routers, IOS XR Release 6.3.x
144
drop
Implementing Routing Policy

Advertisement

Table of Contents
loading

Table of Contents