aggregate6
aggregate6 will compress an unsorted list of IP prefixes (both IPv4 and IPv6).
Description
Takes a list of IPv6 prefixes in conventional format on stdin, and performs two optimisations to attempt to reduce the length of the prefix list. The first optimisation is to remove any supplied prefixes which are superfluous because they are already included in another supplied prefix. For example, 2001:67c:208c:10::/64 would be removed if 2001:67c:208c::/48 was also supplied.
The second optimisation identifies adjacent prefixes that can be combined under a single, shorter-length prefix. For example, 2001:67c:208c::/48 and 2001:67c:208d::/48 can be combined into the single prefix 2001:67c:208c::/47.
The above optimalisation steps 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:
$ doas pkg_add aggregate6
CentOS/RHEL/Rocky:
Fedora:
$ dnf install 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.
$ # 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
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.
>>> 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
Metadata
Release files for aggregate6 1.0.15
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aggregate6-1.0.15.tar.gz | 9.0 kB | Without provenance | Details for aggregate6-1.0.15.tar.gz |
Release files / aggregate6-1.0.15.tar.gz
| Download URL | aggregate6-1.0.15.tar.gz |
|---|---|
| Size | 9.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6011819340a829f4c639dad08843a782f6bcb4d1313789137fde306ce7d9d6ac
|
|
BLAKE2b-256 checksum How to use checksums |
816575709fa83dfc6016364cc35602b26a34515c20cfe8b75328e3fe3eb1beb2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for aggregate6 1.0.15
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.