|
| 1 | +|Requirements Status| |Coverage Status| |
| 2 | + |
| 3 | +aggregate6 |
| 4 | +========== |
| 5 | + |
| 6 | +aggregate6 will compress an unsorted list of IP prefixes (both IPv4 and |
| 7 | +IPv6). |
| 8 | + |
| 9 | +Description |
| 10 | +----------- |
| 11 | + |
| 12 | +Takes a list of IPv6 prefixes in conventional format on stdin, and |
| 13 | +performs two optimisations to attempt to reduce the length of the prefix |
| 14 | +list. The first optimisation is to remove any supplied prefixes which |
| 15 | +are superfluous because they are already included in another supplied |
| 16 | +prefix. For example, ``2001:67c:208c:10::/64`` would be removed if |
| 17 | +``2001:67c:208c::/48`` was also supplied. |
| 18 | + |
| 19 | +The second optimisation identifies adjacent prefixes that can be |
| 20 | +combined under a single, shorter-length prefix. For example, |
| 21 | +``2001:67c:208c::/48`` and ``2001:67c:208d::/48`` can be combined into |
| 22 | +the single prefix ``2001:67c:208c::/47``. |
| 23 | + |
| 24 | +The above optimalisation steps are often useful in context of |
| 25 | +compressing firewall rules or BGP prefix-list filters. |
| 26 | + |
| 27 | +The following command line options are available: |
| 28 | + |
| 29 | +:: |
| 30 | + |
| 31 | + -4 Only output IPv4 prefixes |
| 32 | + -6 Only output IPv6 prefixes |
| 33 | + -h, --help show help message and exit |
| 34 | + -m N Sets the maximum prefix length for entries read, longer prefixes will be discarded prior to processing |
| 35 | + -t truncate IP/mask to network/mask |
| 36 | + -v Display verbose information about the optimisations |
| 37 | + -V Display aggregate6 version |
| 38 | + |
| 39 | +Installation |
| 40 | +------------ |
| 41 | + |
| 42 | +OpenBSD: |
| 43 | + |
| 44 | +``$ doas pkg_add aggregate6`` |
| 45 | + |
| 46 | +CentOS/RHEL/Rocky: |
| 47 | + |
| 48 | +| ``$ yum install epel-release`` |
| 49 | +| ``$ yum install aggregate6`` |
| 50 | +
|
| 51 | +Fedora: |
| 52 | + |
| 53 | +``$ dnf install aggregate6`` |
| 54 | + |
| 55 | +Other platforms: |
| 56 | + |
| 57 | +``$ pip3 install aggregate6`` |
| 58 | + |
| 59 | +CLI Usage |
| 60 | +--------- |
| 61 | + |
| 62 | +Either provide the list of IPv4 and IPv6 prefixes on STDIN, or give |
| 63 | +filenames containing lists of IPv4 and IPv6 prefixes as arguments. |
| 64 | + |
| 65 | +:: |
| 66 | + |
| 67 | + $ # via STDIN |
| 68 | + $ cat file_with_list_of_prefixes | aggregate6 |
| 69 | + ... output ... |
| 70 | + |
| 71 | + $ # with a filename as argument |
| 72 | + $ aggregate6 file_with_list_of_prefixes [ ... optional_other_prefix_lists ] |
| 73 | + ... output ... |
| 74 | + |
| 75 | + $ # Whitespace separated works too |
| 76 | + $ echo 2001:67c:208c::/48 2000::/3 | aggregate6 |
| 77 | + 2000::/3 |
| 78 | + |
| 79 | + $ # You can combine IPv4 and IPv6 |
| 80 | + $ echo 10.0.0.0/16 10.0.0.0/24 2000::/3 | aggregate6 |
| 81 | + 10.0.0.0/16 |
| 82 | + 2000::/3 |
| 83 | + |
| 84 | +Library Usage |
| 85 | +------------- |
| 86 | + |
| 87 | +Aggregate6 can be used in your own pyp/python2/python3 project as python |
| 88 | +module. Currently there is just one simple public function: |
| 89 | +``aggregate()`` which takes a list as parameter. |
| 90 | + |
| 91 | +:: |
| 92 | + |
| 93 | + >>> from aggregate6 import aggregate |
| 94 | + >>> aggregate(["10.0.0.0/8", "10.0.0.0/24"]) |
| 95 | + ['10.0.0.0/8'] |
| 96 | + >>> |
| 97 | + |
| 98 | +Bugs |
| 99 | +---- |
| 100 | + |
| 101 | +Please report bugs at https://github.com/job/aggregate6/issues |
| 102 | + |
| 103 | +Author |
| 104 | +------ |
| 105 | + |
| 106 | + |
| 107 | + |
| 108 | +.. |Requirements Status| image:: https://requires.io/github/job/aggregate6/requirements.svg?branch=master |
| 109 | + :target: https://requires.io/github/job/aggregate6/requirements/?branch=master |
| 110 | +.. |Coverage Status| image:: https://coveralls.io/repos/github/job/aggregate6/badge.svg?branch=master |
| 111 | + :target: https://coveralls.io/github/job/aggregate6?branch=master |
0 commit comments