<div dir="ltr"><div>Is this what you are trying to accomplish?</div><div><br></div><div>$ python<br>Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15)<br>[GCC 7.3.0] on linux2<br>Type "help", "copyright", "credits" or "license" for more information.<br>>>> import netaddr<br>>>> SomeList=netaddr.IPSet()<br>>>> SomeList.add('<a href="http://203.0.113.0/25">203.0.113.0/25</a>')<br>>>> SomeList.add('<a href="http://203.0.113.128/25">203.0.113.128/25</a>')<br>>>> for x in list(SomeList.iter_cidrs()):<br>...   print x<br>...<br><a href="http://203.0.113.0/24">203.0.113.0/24</a></div><div></div><div>>>><br>>>> DifferentList=netaddr.IPSet()<br>>>> DifferentList.add('<a href="http://0.0.0.0/0">0.0.0.0/0</a>')<br>>>> DifferentList.remove('203.0.113.1')<br>>>> for x in list(DifferentList.iter_cidrs()):<br>...   print x<br>...<br><a href="http://0.0.0.0/1">0.0.0.0/1</a><br><a href="http://128.0.0.0/2">128.0.0.0/2</a><br><a href="http://192.0.0.0/5">192.0.0.0/5</a><br><a href="http://200.0.0.0/7">200.0.0.0/7</a><br><a href="http://202.0.0.0/8">202.0.0.0/8</a><br><a href="http://203.0.0.0/18">203.0.0.0/18</a><br><a href="http://203.0.64.0/19">203.0.64.0/19</a><br><a href="http://203.0.96.0/20">203.0.96.0/20</a><br><a href="http://203.0.112.0/24">203.0.112.0/24</a><br><a href="http://203.0.113.0/32">203.0.113.0/32</a><br><a href="http://203.0.113.2/31">203.0.113.2/31</a><br><a href="http://203.0.113.4/30">203.0.113.4/30</a><br><a href="http://203.0.113.8/29">203.0.113.8/29</a><br><a href="http://203.0.113.16/28">203.0.113.16/28</a><br><a href="http://203.0.113.32/27">203.0.113.32/27</a><br><a href="http://203.0.113.64/26">203.0.113.64/26</a><br><a href="http://203.0.113.128/25">203.0.113.128/25</a><br><a href="http://203.0.114.0/23">203.0.114.0/23</a><br><a href="http://203.0.116.0/22">203.0.116.0/22</a><br><a href="http://203.0.120.0/21">203.0.120.0/21</a><br><a href="http://203.0.128.0/17">203.0.128.0/17</a><br><a href="http://203.1.0.0/16">203.1.0.0/16</a><br><a href="http://203.2.0.0/15">203.2.0.0/15</a><br><a href="http://203.4.0.0/14">203.4.0.0/14</a><br><a href="http://203.8.0.0/13">203.8.0.0/13</a><br><a href="http://203.16.0.0/12">203.16.0.0/12</a><br><a href="http://203.32.0.0/11">203.32.0.0/11</a><br><a href="http://203.64.0.0/10">203.64.0.0/10</a><br><a href="http://203.128.0.0/9">203.128.0.0/9</a><br><a href="http://204.0.0.0/6">204.0.0.0/6</a><br><a href="http://208.0.0.0/4">208.0.0.0/4</a><br><a href="http://224.0.0.0/3">224.0.0.0/3</a><br>>>><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Oct 27, 2019 at 1:10 PM Joe Maimon <<a href="mailto:jmaimon@jmaimon.com">jmaimon@jmaimon.com</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">Does anyone have or seen any such tool? I have a script that seems to<br>
work, but its terribly slow.<br>
<br>
Currently I can produce aggregated subnets that can be mising up to a<br>
specified number of individual addresses. Which can be fed back in for<br>
multiple passes.<br>
<br>
Doing RTBH on individual /32 does not scale well, if you are eyeing<br>
collaboration with external lists. I have found likely sources that could<br>
produce another 100k prefixes easily.<br>
<br>
Joe<br>
</blockquote></div>