AGGREGATE6(7)
π AGGREGATE6 π
okay so bestie, meet aggregate6 β the little icon that takes your messy unsorted pile of IP prefixes (both IPv4 and IPv6, we love a versatile queen) and compresses them down into something cute and tidy. β¨
πΈ DESCRIPTION πΈ
So here's the vibe: you pipe a list of IPv6 prefixes in conventional format into it on stdin, and it runs two optimisations to try and shrink that prefix list down. Two. Because one was simply not enough. π
Optimisation numero uno: it yeets any prefixes that are straight-up superfluous, i.e. ones already covered by another prefix you handed it. Example, because examples are everything:
2001:67c:208c:10::/64would get removed if2001:67c:208c::/48was also supplied. Like, girl, you're already in there. π«Ά
Optimisation numero dos: it hunts down adjacent prefixes that can be smooshed together under a single, shorter-length prefix. For example:
2001:67c:208c::/48and2001:67c:208d::/48can be combined into the single prefix2001:67c:208c::/47. β¨ iconic behaviour, no notes β¨
These optimalisation steps (yes we're spelling it like that, that's the original, periodt) are often useful in context of compressing firewall rules or BGP prefix-list filters. π§
The following command line options are available:
-4β Only output IPv4 prefixes-6β Only output IPv6 prefixes-h,--helpβ show help message and exit-m Nβ Sets the maximum prefix length for entries read, longer prefixes will be discarded prior to processing-tβ truncate IP/mask to network/mask-vβ Display verbose information about the optimisations-Vβ Display aggregate6 version
π INSTALLATION π
OpenBSD 6.3:
$ doas pkg_add aggregate6
Other platforms:
$ pip3 install aggregate6
π¦ CLI USAGE π¦
Either provide the list of IPv4 and IPv6 prefixes on STDIN, or give filenames containing lists of IPv4 and IPv6 prefixes as arguments. Both. Either. Whatever feels right for you, bestie. π
$ # via STDIN
$ cat file_with_list_of_prefixes | aggregate6
... output ...
$ # with a filename as argument
$ aggregate6 file_with_list_of_prefixes [ ... optional_other_prefix_lists ]
... output ...
$ # Whitespace separated works too
$ echo 2001:67c:208c::/48 2000::/3 | aggregate6
2000::/3
$ # You can combine IPv4 and IPv6
$ echo 10.0.0.0/16 10.0.0.0/24 2000::/3 | aggregate6
10.0.0.0/16
2000::/3
ngl the whitespace-separated one is such a serve, it just works π
π LIBRARY USAGE π
Aggregate6 can be used in your own pyp/python2/python3 project as python module. Currently there is just one simple public function: aggregate() which takes a list as parameter. One function. Minimalist. Main character energy fr fr. π
>>> import from aggregate6 import aggregate
>>> aggregate(["10.0.0.0/8", "10.0.0.0/24"])
[Β΄10.0.0.0/8Β΄]
>>>
π BUGS π
Please report bugs at https://github.com/job/aggregate6/issues β do NOT suffer in silence, bestie, that's not the vibe. π
π AUTHOR π
Job Snijders job@instituut.net
and that's the whole entire page, mwah π December 2017, AGGREGATE6(7) β go compress some prefixes, you absolute legend πβ¨π¦
π¦ where this page comes from
- epel 10: aggregate6 1.0.15-1.el10_3 Β· BSD-2-Clause
- epel 9: aggregate6 1.0.15-1.el9 Β· BSD-2-Clause
- fedora 43: aggregate6 1.0.14-6.fc43 Β· BSD-2-Clause
- fedora 43: aggregate6 1.0.15-1.fc43 Β· BSD-2-Clause
- fedora 44: aggregate6 1.0.14-8.fc44 Β· BSD-2-Clause
- fedora 44: aggregate6 1.0.15-1.fc44 Β· BSD-2-Clause
- nixos 26.05: python3.13-aggregate6 1.0.15
- nixos 26.05: python3.14-aggregate6 1.0.15
- nixpkgs unstable: python3.13-aggregate6 1.0.15
- nixpkgs unstable: python3.14-aggregate6 1.0.15
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms