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-361
Cisco IOS XR Routing Configuration Guide
OL-14356-01
The fourth component is the policy clients (the routing protocols). This component calls the execution
engine at the appropriate times to have a given policy be applied to a given route, and then perform some
number of actions. These actions may include deleting the route if policy indicated that it should be
dropped, passing along the route to the protocol decision tree as a candidate for the best route, or
advertising a policy modified route to a neighbor or peer as appropriate.
Routing Policy Language Usage
This section provides basic routing policy language usage examples. See the “How to Implement
Routing Policy on Cisco IOS XR Software” section on page RC-408 for detailed information on how to
implement routing policy language.
The pass policy
The following example shows how the policy accepts all presented routes without modifying the routes.
route-policy quickstart-pass
pass
end-policy
The drop everything policy
The following example shows how the policy explicitly rejects all routes presented to it. This type of
policy is used to ignore everything coming from a specific peer.
route-policy quickstart-drop
drop
end-policy
Ignore routes with specific AS numbers in the path
The following example shows the policy definition in three parts. First, the as-path-set command
defines three regular expressions to match against an AS path. Second, the route-policy command
applies the AS path set to a route. If the AS path attribute of the route matches the regular expression
defined with the as-path-set command, the protocol refuses the route. Third, the route policy is attached
to BGP neighbor 10.0.1.2. BGP consults the policy named ignore_path_as on routes received (imported)
from neighbor 10.0.1.2.
as-path-set ignore_path
ios-regex '_11_',
ios-regex '_22_',
ios-regex '_33_'
end-set
route-policy ignore_path_as
if as-path in ignore_path then
drop
else
pass
endif
end-policy
router bgp 2
neighbor 10.0.1.2 address-family ipv4 unicast policy ignore_path_as in