Closed defo89 closed 3 months ago
Seems like a reasonable enhancement to me, although potentially fairly niche outside of your linked issue (which it sounds like has been resolved through the use of USE_POD_CIDR).
Probably would look something like this in the Calico API:
exportV4:
- action: Accept
matchOperator: In
cidr: 77.0.0.0/16
routePrefixLength: 32
would love to see this feature for more complete route control, especially for specific instances where we many only want to advertise service /32 and not the aggregate from all nodes
@caseydavenport that API example would work for matching a specific prefix length within a given prefix. However it would not cover a range use case described in birds documentation which is usually used in routers prefix-list approach: match ≥16
and ≤24
at same time (separate usage is also possible of course).
Cisco-style patterns like 10.0.0.0/8 ge 16 le 24 can be expressed in BIRD as 10.0.0.0/8{16,24}
Right, IIUC that's basically the union of "route within 10.0.0.0/8" and "route prefix >= 16" and "route prefix <= 24".
So we might want a more expressive prefix match section. e.g.,
# Match a specific prefix length
cidr: 77.0.0.0/16
prefix:
length: 32
or
# Match a range of prefix lengths
cidr: 77.0.0.0/16
prefix:
min: 16
max: 24
Spot on, whereas min
and max
could also be used separately:
# Match prefixes lengths until 24 (included)
cidr: 77.0.0.0/16
prefix:
max: 24
or
# Match prefixes lengths from 20
cidr: 77.0.0.0/16
prefix:
min: 20
Just checking if there is a planned ETA for this feature on the roadmap? Thanks a lot.
I think this one is still on the backlog. Would be happy to review PRs for it, though!
Expected Behavior
In certain scenarios there might be a need to allow/deny prefixes with variable prefix length.
Example: Allow accepting prefixes within
77.0.0.0/16
but not/32
host routes, or more complex case: do not accept routes with prefix length greater than or equal/20
and less than or equal/24
.Another use case could be related to https://github.com/projectcalico/calico/issues/8374 (not yet sure if behaviour in the issue is intended): allow prefix advertisement within ClusterCIDR range but disable announcement of
/32
prefixes.If I understand bird filters correctly, that would look like this:
From the above link:
Caveat: above works with
cidr
but I am not sure how the match would look like for communities.