0% found this document useful (0 votes)
3K views47 pages

Introducing Route Maps and Routing Policy Language

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3K views47 pages

Introducing Route Maps and Routing Policy Language

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

Routing Protocol Tools and Route Manipulation

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-1
• Route maps are a simple language to support complex routing policies,
in addition to filtering.
• Route maps are uniquely identified by a case-sensitive name.
• Each route map consists of one or more statements.
• Each statement contains zero or more match commands.
• Each statement contains zero or more set commands used to modify
routing updates.
• Route maps are available in Cisco IOS/IOS XE Software. (Cisco IOS XR
Software uses the Routing Policy Language.)

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-2
Route Map
Statement 10
Yes Yes No
Update Match? Permit Set Send Update

No Yes
No Drop Set

Statement 20
Yes Yes No
Match? Permit Set Send

No Yes
No Drop Set

Statement N
Yes Yes No
Match? Permit Set Send

No Yes
No Implicit drop Drop Set

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-3
Additional route-map options:
• The continue command can be used to jump to another statement
instead of exiting.
• Policy lists can be used to modularize and group match statements.

route-map Policy1 permit 10 route-map Policy2 permit 10


match condition match policy-list Policy3
continue 40
!
route-map Policy1 permit 20

! route-map Policy3 permit 10
route-map Policy1 permit 40 …
… route-map Policy3 permit 20
! …
route-map Policy1 permit 1000 route-map Policy3 permit 30

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-4
• Each route map is identified using a case-sensitive name.
• Each route map can have one or more ordered statements identified
using the sequence number.
• Each route-map statement can filter updates using permit or deny
options.
• Each statement processes updates matched by the match command
• Each statement can optionally modify or set parameters in an update.
• Match conditions of the same type are evaluated using a logical OR
operator; match conditions of different types are evaluated using a
logical AND operator.

Router(config)#
route-map map-tag [permit | deny] [sequence-number]
match condition
match condition
set parameter value
set parameter value

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-5
• Preferred paths for specific route-map Policy1 permit 10
prefixes match ip address prefix-list PL1
set local-preference 200
• Backup paths for specific prefixes
!
• Preferred paths for prefixes route-map Policy1 permit 20
based on AS path match ip address prefix-list PL2
set local-preference 50
• Backup paths for prefixes based
!
on AS path
route-map Policy1 permit 30
• Explicit permit at the end match as-path APACL1
set local-preference 200
!
route-map Policy1 permit 40
match as-path APACL2
set local-preference 50
!
route-map Policy1 permit 1000

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-6
• The first route-map statement
processes routes matched by
prefix list PL1 or PL2 and AS
path access list APACL1.
route-map Policy1 permit 10
• These routes are assigned local match ip address prefix-list PL1 PL2
preference 100 and MED 1000. match as-path APACL1
• All other routes are passed set local-preference 200
unchanged. set metric 1000
!
route-map Policy1 permit 1000

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-7
• RPL replaces route maps in Cisco IOS XR Software.
• RPL is a simple, yet powerful language, designed to process routing
updates.
• RPL addresses the deficiencies of route maps in Cisco IOS/IOS XE
Software:
- Better modularity
- Better reusability
- Parameterization
- Nesting of policies and conditions
- Powerful match options
- Reusable value sets

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-8
• Each routing policy is identified by a case-sensitive name.
• Entire policy is defined between route-policy and end-policy
commands.
• Main RPL functions:
- Filtering of updates (pass and drop commands)
- Modification of attributes (set commands)

Implicitly permit all routes by


Permit all routes. setting at least one attribute.

route-policy PermitAll route-policy LP100


pass set local-preference 100
end-policy end-policy

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-9
EBGP
• Note: Cisco IOS XR Software Permit all routes to
does not automatically send EBGP peers.
BGP updates to external peers.
route-policy PermitAll
• A routing policy is required to pass
forward updates. end-policy
!
router bgp 1
neighbor 1.2.3.4
remote-as 64111
address-family ipv4 unicast
route-policy PermitAll out
!
!
!

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-10
• Using the explicit pass command
continues the processing of route route-policy DropOrPass1
Drop!
policy. end-policy

• Using the explicit drop command route-policy DropOrPass2


stops processing of route policy. pass Pass!
end-policy
• The default action is drop.
• If any modification is applied to a route-policy DropOrPass3
Drop!
drop
route (e.g. set), it is an implicit end-policy
pass.
route-policy DropOrPass4
Pass!
set med 100
end-policy

route-policy DropOrPass5
pass Drop!
drop
pass
end-policy

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-11
• RPL uses various match options for conditional update processing.
• Condition syntax:
if attribute operator value then
… do something … route-policy SetLP

elseif attr operator value then if med eq 10 then


set local-preference 200
… do something else … elseif med eq 20 then
set local-preference 150
else
else
… do something else … set local-preference 50
endif
endif
end-policy

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-12
Comparing attributes against values supports these operators:
• eq : An attribute numerically equal to specified value
• le : An attribute numerically lower than or equal to a specified value
• ge : An attribute numerically greater than or equal to a specified value
• is : An attribute equal to a specified value
• in : An attribute contained in a value set
• Many other attribute-specific options
route-policy SetLP
if med le 19 then
set local-preference 200
Simple elseif med eq 20 then
conditions set local-preference 150
elseif med ge 21 then
set local-preference 50
endif
end-policy

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-13
• Multiple match options can be combined using Boolean operators:
- and : both conditions must match
- or : at least one condition must match
- not : negate the following condition

Using composite
conditions

route-policy SetLP
if med eq 10 and not local-preference eq 100 then
set local-preference 200
elseif med eq 20 or local-preference eq 200 then
set local-preference 150
else
set local-preference 150
endif
end-policy

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-14
• Multiple match options can be combined using Boolean operators:
- not : highest precedence
- and : higher precedence than or, lower than not
- or : lowest precedence
• Influence precedence by grouping using parentheses.

if med eq 10 and not local-preference eq 100 or med eq 50 then

vs.
if med eq 10 and (not local-preference eq 100 or med eq 50) then
vs.
if med eq 10 and not (local-preference eq 100 or med eq 50) then

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-15
• Two types of nesting are supported:
- “if” statement within another “if” statement
- A routing policy within another routing policy
• Multiple levels of nesting are supported.

Nested “if” statements Nested policies

route-policy SetC route-policy SetC


if med eq 10 then if local-preference eq 100 then
if local-preference eq 100 then set community (1:10) additive
set community (1:10) additive endif
endif end-policy
endif
end-policy route-policy MatchMED
if med eq 10 then
apply SetC
endif
end-policy

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-16
• Use the set command to assign values to attributes and parameters.
• Note: All set statements are processed when the processing of policy
completes (e.g. matching on a previously set attribute is not possible).

Original update
route-policy SetLP MED= 10 LP=100 Weight=0
Match
if med eq 10 then 1
set local-preference 200
endif
Match
if local-preference eq 100 then 2 Set
set weight 100
Set
endif 3
if local-preference eq 200 then No match!
set weight 200
endif
end-policy 4 MED= 10 LP=200 Weight=100
Modified update

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-17
• Note: Last set wins when multiple sets are evaluated for a unique
parameter.

MED = 10 LP = 100 Original update

route-policy SetLP
set local-preference 100
set local-preference 200
set local-preference 300
end-policy

MED = 10 LP = 300 Modified update

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-18
• Note: All set commands are evaluated in the same order for nonunique
attributes and operations.

Original update Original update


AS Path: 10 20 30 Community: 1:10, 1:20

route-policy Prepend route-policy SetComm


prepend as-path 40 2 set community (1:100) additive
prepend as-path 40 3 set community (1:200) additive
end-policy end-policy

AS Path: 40 40 40 40 40 10 20 30 Community: 1:10, 1:20, 1:100, 1:200


Modified update Modified update

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-19
• Standard BGP community attribute:
set community (value [value2 …]) [additive]

• Extended BGP community attribute:


set extcommunity (value [value2 …]) [additive]

• BGP dampening parameters:


set dampening [halflife value] [max-suppres value] [reuse value] [suppress value]

• Local preference attribute:


set local-preference value

• MED attribute:
set med {[+|-]value | igp-cost | max-reachable}

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-20
• Delete standard BGP community attributes:
delete community {all | [not] in community-set}

• Delete extended BGP community attributes:


delete extcommunity rt {all | [not] in extcomm-set}

• Prepend AS path:
prepend as-path {AS | most-recent} [count]

• Replace a sequence of AS numbers with local AS:


replace as-path {private-as | ‘AS1 AS2 …’}

• Suppress route if aggregated:


suppress-route

• Unsuppress route if aggregated:


unsuppress-route

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-21
Route Flap Dampening
2200 points
2000 Suppress Limit

1100 points
1000

750 Reuse Limit

Forget Limit

t
Halve
Time

dampened

flap flap flap

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-22
Conditional BGP Dampening
Conditional BGP dampening, where smaller prefixes
are more aggressively punished than larger prefixes

router bgp 1
address-family ipv4 unicast
bgp dampening route-policy BDamp
!
!
route-policy BDamp
if destination in (0.0.0.0/0 ge 25) then
set dampening max-suppress 30 halflife 10 reuse 750 suppress 1000
elseif destination in (0.0.0.0/0 ge 21) then
set dampening max-suppress 15 halflife 7 reuse 750 suppress 2000
elseif destination in (0.0.0.0/0 ge 17) then
set dampening max-suppress 10 halflife 5 reuse 750 suppress 3000
else
set dampening max-suppress 5 halflife 3 reuse 750 suppress 4000
endif
end-policy

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-23
• OSPF metric type:
set metric-type {type-1 | type-2]

• OSPF metric:
set ospf-metric value

• IS-IS metric type:


set metric-type {external | internal}

• IS-IS metric type:


set isis-metric value

• IS-IS level for redistributed routes:


set level {level-1 | level-2 | level-1-2}

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-24
RPL supports two types of parameters:
• Global parameters:
- Defined globally using the policy-global command
- Available for use in all routing policies
• Parameters passed to a nested routing policy:
- Defined when creating a routing policy
- Available in match and set statements within a policy or when calling another
nested routing policy

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-25
• Parameters are defined using the policy-global command, and are
separated by commas.
• Values are defined within single quotes.
• Parameters are referenced by prepending the $ sign to the name of the
parameter.

Defining global variables Using global variables

policy-global route-policy SetMED


# Global variables if as-path originates-from ’$AS’ then
AS '65001', set med $DefMED
Lo0 '10.1.2.3', endif
EBGP1 '192.168.1.1', end-policy
EBGP2 '192.168.2.1',
DefWeight '0',
DefLP '100',
DefMED '0'
end-global

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-26
• Declare parameters when creating a routing policy.
• Nesting policies with parameters allows for greater modularization and
optimization of policies.

Policy using passed Using a nested policy and


parameters passing parameters to it

route-policy SetMED($med, $as) route-policy ProcessUpdates


if as-path originates-from '$as' then if as-path neighbor-is '100' then
set med $med apply SetMED(50,100)
else elseif as-path neighbor-is '200' then
set med max-reachable apply SetMED(150,200)
endif endif
end-policy end-policy
! !

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-27
• Design a routing policy.
• Configure the policy.
• Test the policy by using show commands.
• Apply the policy if it is correct.
• Use routing policies in many places (attach points):
- Routing updates (e.g. BGP, OSPF, EIGRP, IS-IS, RIP)
- Route origination (e.g. redistribution, network commands)
- Route insertion into routing table
- show commands to filter output

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-28
Attach Points
OSPF Database BGP Table
Redistribution
default orig. network
area in neighbor in & out
aggregation
area out default orig.
show bgp
IS-IS Database dampening
retain RT clear dampening
default orig.
allocate label debug update
Import filter EXEC
EIGRP Database
default in/out Export tagging Table-policy Table-policy
filter in/out
filter intf. in/out VRF IPv4 IPv6
Routing Routing
RIP Database table table

default orig.
filter in/out Static routes

filter intf. in/out Connected routes

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-29
Validity Checking
• RPL validity checking is done in two phases:
- Syntax checking and value checking are performed during policy
configuration.
RP/0/RP1/CPU0:CRS(config-rpl)#set med 289314790283408912634789
^
% Invalid input detected at '^' marker.

- Applicability of a policy for a given attach point is checked during configuration


commit.
RP/0/RP1/CPU0:CRS(config-bgp-af)#commit
% Failed to commit one or more configuration items during an atomic operation, no
changes have been made. Please use 'show configuration failed' to view the errors
RP/0/RP1/CPU0:CRS(config)# show config failed
!! CONFIGURATION FAILED DUE TO SEMANTIC ERRORS
router bgp 1
address-family ipv4 unicast
redistribute connected route-policy t9
!!% Could not find entry in list: Policy [t9] uses the 'ospf-metric' attribute.
There is no 'ospf-metric' attribute at the BGP redistribution-dflt attach point.

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-30
• Trying to edit an existing routing policy through configuration-mode CLI
will result in the policy being rewritten:
RP/0/RP1/CPU0:CRS(config)#route-policy R1
% WARNING: Policy object 'route-policy R1' exists! Reconfiguring it via CLI
will replace current definition. Use 'abort' to cancel.
RP/0/RP1/CPU0:CRS(config-rpl)# abort

• Use EXEC-mode editor instead.


• Three editors are available:
- GNU Nano
- Emacs
- VIM
• Modify the policy, and complete the process:
- Save changes.
- Exit editor.
- Commit changes.

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-31
Using an Editor
• An editor can be used for routing policies and sets.
RP/0/RP1/CPU0:CRS#edit ?
as-path-set edit an as-path-set
community-set edit a community-set
extcommunity-set edit an extended-community-set
policy-global edit policy-global definitions
prefix-set edit a prefix-set
rd-set edit a rd-set
route-policy edit a route-policy

• Invoke the desired editor.


RP/0/RP1/CPU0:CRS#edit route-policy RP1 ?
emacs to use Micro Emacs editor
inline to use command line
nano to use nano editor
vim to use Vim editor
<cr>

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-32
RPL can match attributes against a set of multiple values:
• Inline sets using parentheses for one-time use
• Named value sets for reusability as-path-set
community-set
Value sets: extcommunity-set
prefix-set
• AS path in AS path set
rd-set
• Standard community in community set
• Extended community in extcommunity set
• Prefix in prefix set Named value set
• Route distinguisher in route distinguisher set
xy-set set-name
Inline value set value,
value2
route-policy RP end-set
if attribute in (value, value2, …) !
then route-policy RP
set local-preference 200 if attr in set-name then
endif set local-preference 200
end-policy endif
end-policy
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-33
• Define an AS-path set using the as-path-set command.
• Use one or more comma-separated ios-regex commands to define
regular expression that define set membership.
• Use the in operator in routing policy to test for membership of AS path in
AS path set.

Match prefixes originating in Use an AS path set in a policy to match


defined autonomous systems. prefixes based on AS path attribute.

as-path-set PreferredOriginators route-policy RP


ios-regex ’_10$’, if as-path in PreferredOriginators then
ios-regex ’_20$’, set local-preference 200
ios-regex ’_30$’, endif
ios-regex ’_40$’ end-policy
end-set

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-34
Predefined matching criteria Description
is-local matches any prefix with an empty AS path attribute
(equals regular expression '^$‘)

neighbor-is path matches based on first ASN in the AS Path


attribute (equals regular expression '^path_‘)

originates-from path matches based on last ASN in the AS Path attribute


(equals regular expression '_path$')

passes-through ASN matches based on ASN anywhere in the AS Path


(equals regular expression '_path_‘)

length len matches AS paths based on number of ASNs in the


path
unique-length len matches AS paths based on number of unique
ASNs in the path

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-35
Using built-in AS-Path Equivalent regular
match options expressions

route-policy RP route-policy RP
if as-path is-local then if as-path in (ios-regex '^$')
set local-preference 200 then
endif set local-preference 200
if as-path neighbor-is '20' endif
then if as-path in (ios-regex '^20_')
set local-preference 190 then
endif set local-preference 190
if as-path originates-from '20' endif
then if as-path in (ios-regex '_20$')
set local-preference 180 then
endif set local-preference 180
if as-path passes-through '20' endif
then if as-path in (ios-regex '_20_')
set local-preference 170 then
endif set local-preference 170
end-policy endif
end-policy

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-36
• Define a standard community set using the community-set command.
• Use one or more comma-separated match options:
- ios-regex commands to define regular expressions that define set
membership
- numbered membership matching
- membership matching using well-known standard communities
• Use the matches-any operator to match routes that have at least one
community in the community set.
• Use the matches-every operator in routing policy to match routes that
have all communities in the community set.

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-37
• Use one or more comma-separated ios-regex commands to define
regular expressions that define set membership.

Setting Local Preference


based on community
matching using regular
expressions

community-set ImpComms community-set ImpComms


ios-regex ’123:10..’, ios-regex ’123:[12]0..’,
ios-regex ’123:20..’ end-set
end-set

route-policy Comm2LP
if community matches-any ImpComms then
set local-preference 200
endif
end-policy

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-38
Use numbered matching:
• AS:num
• AS:[range]
• AS:*
Setting Local Preference
based on numbered
community matching

community-set ImpComms
123:1010
123:[2000..2099]
999:*
end-set
!
route-policy Comm2LP
if community matches-any ImpComms then
set local-preference 200
endif
end-policy

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-39
Use identifiers for well-known communities:
• Internet : Match all communities.
• local-as :Keep tagged prefixes in the local AS.
• no-advertise :Prevent tagged prefixes from being advertised to any peer.
• no-export :Prevent tagged prefixes from being announced to EBGP peers.

Prevent sending of core Delete all communities


subnets to external peers. on incoming updates.

router bgp 1 route-policy DeleteAllComms


address-family ipv4 unicast delete community in (internet)
redistribute connected route-policy end-policy
NoExport !
! router bgp 1
route-policy NoExport neighbor 1.2.3.4
set community no-export address-family ipv4 unicast
! route-policy DeleteAllComms in
!

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-40
• Used to match prefixes in routing protocol updates: Prefix[/length [{le |
ge | eq} mask-len]]

Various prefix sets Various prefix sets

prefix-set PrivatePrefixes prefix-set DefaultRoute


10.0.0.0/8 le 32, 0.0.0.0/0
172.16.0.0/12 le 32, end-set
192.168.0.0/16 le 32 !
end-set prefix-set AllPrefixes
! 0.0.0.0/0 le 32
prefix-set CoreLoopbacks end-set
172.16.1.0/24 eq 32 !
end-set prefix-set SmallPrefixes
! 0.0.0.0/0 ge 24
prefix-set HostRoutes end-set
0.0.0.0/0 eq 32 !
end-set prefix-set
SmallPrefixesExceptHostRoutes
0.0.0.0/0 ge 24 le 31
end-set

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-41
• Use the show rpl route-policy [policy-name] [detail] commands to
display the policies.
• Detailed output also displays all referenced objects (e.g. sets and nested
route policies).
Display a policy and all
other associated objects.

RP/0/RP1/CPU0:CRS# show rpl route-policy MgmtRTExport detail


extcommunity-set rt MgmtRT
23456:100,
23456:200
end-set
!
prefix-set MgmtLoopbacks
10.1.1.0/24 le 32
end-set
!
route-policy MgmtRTExport
if destination in MgmtLoopbacks then
set extcommunity rt MgmtRT
endif
end-policy
!
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-42
• Use the show rpl route-policy policy-name attachpoints commands
to list the attach points of the policy.
• Detailed output also displays all referenced objects (e.g. sets and nested
route policies).
Display attach points
for a routing policy.

RP/0/RSP0/CPU0:PE1#show rpl route-policy pass attachpoints


Thu Nov 17 19:50:52.025 UTC

BGP Attachpoint: Neighbor

Neighbor/Group type afi/safi in/out vrf name


--------------------------------------------------------------------------------
192.168.101.11 -- IPv4/uni in default
192.168.101.11 -- IPv4/uni out default

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-43
• Some policies can be tested (e.g. outbound BGP filter).
• Use the show bgp route-policy policy-name command to list BGP
entries permitted by the policy.
• Note: Attributes modified by the policy are not displayed.
Test a new policy to
filter outgoing updates.

RP/0/RP1/CPU0:CRS# show bgp route-policy FilterOut


BGP router identifier 0.0.0.0, local AS number 1
BGP generic scan interval 60 secs
BGP table state: Active
BGP main routing table version 30
BGP scan interval 60 secs
Status codes: s suppressed, d damped, h history, * valid, > best
i - internal, S stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 10.4.100.0/30 0.0.0.0 0 200 32768 ?

Processed 1 prefixes, 1 paths


RP/0/RP1/CPU0:CRS#

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-44
• When you migrate from Cisco IOS/IOS XE Software to Cisco IOS XR
Software, use the following guidelines to translate route maps to
policies:
- Each numbered entry is one if statement.
- Each match option is one condition:
• Match conditions of the same type should be joined using the OR logical
operator.
• Match conditions of different types should be joined using the AND logical
operator.
• Use parentheses to maintain proper precedence.

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-45
route-map RM permit 10
match ip address prefix-list PL1 Sample route map
set local-preference 200
!
route-map RM permit 20
match ip address prefix-list PL2
set local-preference 150
!

Translated routing
policy

route-policy RP
if destination in PL-Set1 then
set local-preference 200
elseif destination in PL-Set2 then
set local-preference 150
endif
end-policy

© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-46
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—5-47

You might also like