IOS XR RPL examples

Here are a few examples of creating IOS XR RPL’s the idea is still vastly the same as route-maps with the difference of live editing similar to the way a file would be edited in vi for linux. I really like XR its better than any OS cisco has every came out with. I will start off with a example of local-pref and community strings then throw it all together in how it would be setup in XR.

Modifying local preference
IOS

route-map LOCPREF permit 10
set local-preference 200

IOS XR

route-policy LOCPREF
set local-preference 200
end-policy

Adding no export to a community string

IOS

route-map NO_EXPORT
set community no-export
end

IOS XR

route-policy NO-EXPORT
set community (no-export)
end-policy

Some take aways with IOS XR that has to be done is if there is a eBGP peering with a upstream neighbor
anywhere within that RPL has to be the use of the pass functionality. So if I had a peering like so

router bgp 1
address-family ipv4 unicast
neighbor 2.2.2.2
remote-as 2
address-family ipv4 unicast

Without a RPL facing 2.2.2.2 I will receive zero routes from 2.2.2.2 so in most demonstrations or IOS
XR best practices there will be a pass command put into a EBGP I like to push mine like so.

route-policy EBGP_PASS
pass
end-policy

So the config turns into the following.

router bgp 1
address-family ipv4 unicast
neighbor 2.2.2.2
remote-as 2
address-family ipv4 unicast
route-policy EBGP_PASS in
route-policy EBGP_PASS out

So just for some more examples of IOS XR lets say I want to tag 10.1.0.0/16 and 10.2.0.0/16 to
no export community strings but let everything else go untagged community wise. First we create
whats called a prefix-set in XR

prefix-set NO-EXPORT
10.76.0.0/16,
10.77.0.0/16
end-set

This is similar to a prefix set how ever there is one really awesome thing about prefix-sets that
are different from XR you can edit them without potentially breaking anything. Once editted I can
add anything else without having to remove a prefix-list like traditional IOS or add a seq number
somewhere along the path.

prefix-set-before

So lets continue on I want to set NO-EXPORT prefix-set to be tagged by the community string but let
everything else go here is how I would set that up.

prefix-set-after
route-policy NO-EXPORT
if destination in NO-EXPORT then
set community (no-export)
pass
elseif
pass
endif
end-policy

So lets take a look at this policy. If in the routing table it matches prefix-set NO-EXPORT then
set 10.1.0.0/16 and 10.2.0.0/16 to (NO-EXPORT) okay if it did not match that elseif pass and it
ends the policy.

There are some other community strings but you get the jist of it. You can also edit a RPL in the
same manor you can edit a prefix-set.

Advertisements
Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: