On Mon, Mar 13, 2023 at 01:01:16PM +0000, Ochalski, Radoslaw via Bird-users wrote: > Hi, > > I was wondering if there is a way to match extended communities via all ASNs > wildcard? > > As per https://bird.network.cz/?get_doc&v=16&f=bird-5.html, it’s not possible: > > EC sets use similar expressions like pair sets, e.g. (rt, 123, 10..20) or > (ro, 123, *). Expressions requiring the translation (like (rt, *, 3)) are not > allowed (as they usually have 4B range for ASNs). > > This is kind a surprising, however maybe I am missing something?
Hi Because our implementation of community sets is just a balanced tree with intervals, expressions like '(*, 123)' for regular community sets are implemented by expanding it to 64k nodes, while '(123, *)' is just one node. For ECs, expanding to 4G nodes would be unfeasible, and one could argue that expressions like '(rt, *, 3)' do not really make sense, as it is the global part - ASN, who is supposed to assign meaning to the local part, so expecting consistent local parts is just misguided policy. Note that for large communities, one can use for-cycle iteration over bgp_large_community to implement pretty much any kind of policy: for lc c in bgp_large_community do if c.data1 = 123 then ... But we do not have accessors for ext communities. -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santi...@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."