Cisco NCS 6000 Series Configuration Manual page 415

Ios xr release 6.4.x
Hide thumbs Also See for NCS 6000 Series:
Table of Contents

Advertisement

Implementing Routing Policy
Set Community Based on MED
The following example shows how the policy tests the MED of a route and modifies the community attribute
of the route based on the value of the MED. If the MED value is 127, the policy adds the community 123:456
to the route. If the MED value is 63, the policy adds the value 123:789 to the community attribute of the route.
Otherwise, the policy removes the community 123:123 from the route. In any case, the policy instructs the
protocol to accept the route.
route-policy quickstart-med
if med eq 127 then
set community (123:456) additive
elseif med eq 63 then
set community (123:789) additive
else
delete community in (123:123)
endif
pass
end-policy
Set Local Preference Based on Community
The following example shows how the community-set named quickstart-communities defines community
values. The route policy named quickstart-localpref tests a route for the presence of the communities specified
in the quickstart-communities community set. If any of the community values are present in the route, the
route policy sets the local preference attribute of the route to 31. In any case, the policy instructs the protocol
to accept the route.
community-set quickstart-communities
987:654,
987:543,
987:321,
987:210
end-set
route-policy quickstart-localpref
if community matches-any quickstart-communities then
set local-preference 31
endif
pass
end-policy
Persistent Remarks
The following example shows how comments are placed in the policy to clarify the meaning of the entries in
the set and the statements in the policy. The remarks are persistent, meaning they remain attached to the policy.
For example, remarks are displayed in the output of the show running-config command. Adding remarks to
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
Routing Configuration Guide for Cisco NCS 6000 Series Routers, IOS XR Release 6.4.x
Routing Policy Language Usage
393

Advertisement

Table of Contents
loading

Table of Contents