Example:
RP/0/RP0/CPU0:router(config-rpl)# end-policy
Ends the definition of a route policy and exits route-policy configuration mode.
Step 4 commit
Routing Policy Definition: Example
In the following example, a BGP route policy named sample1 is defined using the route-policy name
command. The policy compares the network layer reachability information (NLRI) to the elements
in the prefix set test. If it evaluates to true, the policy performs the operations in the then clause. If
it evaluates to false, the policy performs the operations in the else clause, that is, sets the MED value
to 200 and adds the community 2:100 to the route. The final steps of the example commit the
configuration to the router, exit configuration mode, and display the contents of route policy sample1.
configure
route-policy sample1
if destination in test then
drop
else
set med 200
set community (2:100) additive
endif
end-policy
end
show config running route-policy sample1
Building configuration...
route-policy sample1
if destination in test then
drop
else
set med 200
set community (2:100) additive
endif
end-policy
Attach Routing Policy to BGP Neighbor
This task explains how to attach a routing policy to a BGP neighbor.
Before you begin
A routing policy must be preconfigured and well defined prior to it being applied at an attach point. If a policy
is not predefined, an error message is generated stating that the policy is not defined.
SUMMARY STEPS
1. configure
2. router bgp as-number
3. neighbor ip-address
Routing Configuration Guide for Cisco NCS 5500 Series Routers, IOS XR Release 6.3.x
129
Implementing Routing Policy
Attach Routing Policy to BGP Neighbor