<div dir="ltr"><div>Hello,</div><div><br></div><div>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:</div><div> define filter1 = [ <a href="http://192.168.1.0/24{0,32}">192.168.1.0/24{0,32}</a>, <a href="http://192.168.2.0/24{0,32}">192.168.2.0/24{0,32}</a> ];</div><div>I.e. you need to set the mask range from minimum to maximum - from 0 to 32.</div><div><br></div><div>Then you can accept or reject depending on the match result. For example:</div><div> if net ~ filter1 then reject;</div><div><br></div><div>Regards,</div><div>Alexander</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Sat, Dec 6, 2025 at 6:42 AM <a href="mailto:zx@zxinc.org">zx@zxinc.org</a> <<a href="mailto:zx@zxinc.org">zx@zxinc.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg-6223912846159216070"><div>
Hello,<div><br></div><div>I have a prefix set like [ <a href="http://192.168.1.0/24+" target="_blank">192.168.1.0/24+</a>, <a href="http://192.168.2.0/24+" target="_blank">192.168.2.0/24+</a> ] and I want to write a filter that</div><div>filters all prefixes intersects with the prefix set and accepts all others, that is,</div><div>accepts <a href="http://192.168.0.0/24" target="_blank">192.168.0.0/24</a>, <span style="background-color:transparent"><a href="http://192.168.3.0/24" target="_blank">192.168.3.0/24</a>, <a href="http://10.0.0.0/8" target="_blank">10.0.0.0/8</a>,</span></div><div><span style="background-color:transparent">rejects <a href="http://192.168.1.1/32" target="_blank">192.168.1.1/32</a>, <a href="http://192.168.1.0/24" target="_blank">192.168.1.0/24</a>, <a href="http://192.168.2.0/24" target="_blank">192.168.2.0/24</a>, <a href="http://192.168.2.0/23" target="_blank">192.168.2.0/23</a>, <a href="http://192.168.0.0/16" target="_blank">192.168.0.0/16</a>, <a href="http://192.0.0.0/8" target="_blank">192.0.0.0/8</a>,</span></div><div><br></div><div><span style="background-color:transparent">Anyone who knows how to write such a filter? Is it possible?</span></div><div><br></div><div>Thanks.</div><div><br></div><div>----</div><div>zx</div><div><br></div></div></div></blockquote></div>