Hello,

If you want to match any prefix that intersects (less or more specific) with some prefix of interest - you can use a prefix set like:
  define filter1 = [ 192.168.1.0/24{0,32}, 192.168.2.0/24{0,32} ];
I.e. you need to set the mask range from minimum to maximum - from 0 to 32.

Then you can accept or reject depending on the match result. For example:
  if net ~ filter1 then reject;

Regards,
Alexander

On Sat, Dec 6, 2025 at 6:42 AM zx@zxinc.org <zx@zxinc.org> wrote:
Hello,

I have a prefix set like [ 192.168.1.0/24+, 192.168.2.0/24+ ] and I want to write a filter that
filters all prefixes intersects with the prefix set and accepts all others, that is,
accepts 192.168.0.0/24192.168.3.0/24, 10.0.0.0/8,
rejects 192.168.1.1/32, 192.168.1.0/24, 192.168.2.0/24, 192.168.2.0/23, 192.168.0.0/16, 192.0.0.0/8,

Anyone who knows how to write such a filter? Is it possible?

Thanks.

----
zx