12-22-2021 10:56 AM
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.
12-29-2021 09:19 AM
Well, actually my second workaround idea won't work since you can't pass a literal community at all, apparently.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide