Tool for consolidating subnets

1.0 2018-04-22 21:31 UTC

This package is not auto-updated.

Last update: 2023-03-28 09:55:34 UTC


Tool for shortening CIDRs lists.

Inspired by @andrewandante


The tool promises the list will be shortened to desired maximum size. It also promises all input addresses will be included within the output CIDRs.

It does not guarantee output list will not have ("leak") non-input IPs. In other words, it consolidates the list by merging CIDRs and making them bigger.

Algorithm aims to minimise the leak size.


$longList = ['', '', ''];
$subMuncher = new SubMuncher();
$shortList = $subMuncher->consolidate($longList, 1);
// $shortList is ['']
echo $subMuncher->getLeakTotal();
// Outputs "1" - was leaked.