<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"><style>body { line-height: 1.5; }blockquote { margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em; }div.FoxDiv20251216103226797745 { }body { font-size: 14px; font-family: "Microsoft YaHei UI"; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<div><span></span><div>Hello,</div><div><br></div><div>The mask range works magically! Thank you very much!</div><div><br></div><hr color="#b5c4df" size="1" align="left" style="width: 210px; height: 1px;"><div><div style="position: static !important; font-size: 13.3333px;">zx</div></div></div>
<blockquote style="margin-Top: 0px; margin-Bottom: 0px; margin-Left: 0.5em; margin-Right: inherit"><div> </div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm"><div style="PADDING-RIGHT: 8px; PADDING-LEFT: 8px; FONT-SIZE: 12px;FONT-FAMILY:tahoma;COLOR:#000000; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; PADDING-TOP: 8px"><div><b>From:</b> <a href="mailto:green@qrator.net">Alexander Zubkov</a></div><div><b>Date:</b> 2025-12-09 03:11</div><div><b>To:</b> <a href="mailto:zx@zxinc.org">zx@zxinc.org</a></div><div><b>CC:</b> <a href="mailto:bird-users@network.cz">bird-users</a></div><div><b>Subject:</b> Re: Writing filters that detect intersection between a prefix and a prefix set</div></div></div><div><div class="FoxDiv20251216103226797745"><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>
</div></div></blockquote>
</body></html>