Cisco Systems IOS XR Laptop User Manual


 
Implementing Routing Policy on Cisco IOS XR Software
Configuration Examples for Implementing Routing Policy
RC-241
Cisco IOS XR Routing Configuration Guide
DETAILED STEPS
Configuration Examples for Implementing Routing Policy
This section provides the following configuration examples:
Routing Policy Definition: Example, page RC-241
Simple Inbound Policy: Example, page RC-242
Modular Inbound Policy: Example, page RC-243
Translating Cisco IOS Route Maps to Cisco IOS XR Routing Policy Language: Example,
page RC-244
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.
Command or Action Purpose
Step 1
edit {route-policy | prefix-set | as-path-set |
community-set | extended-community-set}
name
Example:
RP/0/RP0/CPU0:router# edit route-policy sample1
Identifies the route policy, prefix set, AS path set,
community set, or extended community set name to be
modified.
A copy of the route policy, prefix set, AS path set,
community set, or extended community set is copied to
a temporary file and the microemacs editor is launched.
When you finish editing the policy or set, save the
changes by using the save-buffer command, ^X^S
(Control-X Control-S).
To commit the changed configuration:
save the buffer (Control-X Control-S)
exit MicroEmacs (Control-X Control-C)
Step 2
show rpl route-policy
name
[detail]
Example:
RP/0/RP0/CPU0:router# show rpl route-policy
sample2
(Optional) Displays the configuration of a specific named
route policy.
Use the detail keyword to display all policies and sets
that a policy uses.
Step 3
show rpl prefix-set
name
Example:
RP/0/RP0/CPU0:router# show rpl prefix-set
prefixset1
(Optional) Displays the contents of a named prefix set.
To display the contents of a named AS path set,
community set, or extended community set, replace the
prefix-set keyword with as-path-set, community-set,
or extcommunity-set, respectively.