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