cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
693
Views
0
Helpful
1
Replies

IOS-XR RPL: parameterized inline sets with apply or policy invocations

XxIII
Level 1
Level 1

How to pass an inline set to a parameterized policy? This doesn't appear to be possible, in spite of language (quoted below) implying that it should be.

 

with this policy:

 

route-policy lpref-communities($lpref, $communities_set)
set local-preference $lpref
set community send-to-internal additive
set community $communities_set additive
end-policy


I can pass a single element:

 

RP/0/RP0/CPU0:default(config-bgp-af)#network x:x:8000:2323::/64 route-policy lpref-communities (100, 65000:1)
RP/0/RP0/CPU0:default(config-bgp-af)#

 

well, actually I can't, as apparently 65000:1 is a name, not a literal, and putting () around it isn't accepted.

!!% Could not find entry in list: Policy [lpref-communities] uses community set [65000:1]. [65000:1] must be defined before [lpref-communities] can be attached

 

or a set:

 

RP/0/RP0/CPU0:default(config-bgp-af)#network x:x:8000:2323::/64 lpref-communities (100, send-to-internal)
RP/0/RP0/CPU0:default(config-bgp-af)#

 

But attempting to use an inline set:

 

RP/0/RP0/CPU0:default(config-bgp-af)#network x:x:8000:2323::/64 route-policy lpref-communities (100, (65000:1, 65000:2))
^
% Invalid input detected at '^' marker.
RP/0/RP0/CPU0:ubbdefault(config-bgp-af)#

I run into the same issue using apply statements.

I've tried several variations (such as quoting, or brackets), but  nothing is working. Either this isn't possible or the necessary syntax eludes me. If this isn't possible, we're going to have to create either a bunch of one-off named sets, or multi-argument variations with separate parameter for each community

 

Quoting from "Routing Policy on IOS-XR Software":

Functionally, inline sets are equivalent to named sets, but allow for simple tests to be inline. Thus, comparisons do not require that a separate named set be maintained when only one or two elements are being compared. See the set types described in the following sections for the syntax. In general, the syntax for an inline set is a comma-separated list surrounded by parentheses as follows: (element-entry element-entry element-entry, ...element-entry), where element-entry is an entry of an item appropriate to the type of usage such as a prefix or a community value.

 

1 Reply 1

XxIII
Level 1
Level 1

Well, actually my second workaround idea won't work since you can't pass a literal community at all, apparently.