AGGREGATE(1)
π NAME π
okay bestie, meet aggregate π it's the tool that optimises a list of route prefixes so your filters come out nice and short β¨
π§ SYNOPSIS π§
aggregate [-m max-length] [-o max-opt-length] [-p default-length] [-q]
[-t] [-v]
π DESCRIPTION π
okay so aggregate takes a list of prefixes in conventional format on stdin and does two optimisations to make the list shorter. it's giving minimalism π¦
The first optimisation is all about deleting the extras ποΈ If a prefix is already covered by another prefix you supplied, it's superfluous and gets removed. For example, 203.97.2.0/24 would be removed if 203.97.0.0/17 was also supplied. bye bye, not needed π
The second optimisation is the glow-up π It finds adjacent prefixes that can be merged under one shorter prefix. For example, 203.97.2.0/24 and 203.97.3.0/24 can be combined into the single prefix 203.97.2.0/23. two become one, iconic β¨
πΈ OPTIONS πΈ
-m max-lengthβ sets the maximum prefix length for entries read from stdin, measured in max_length bits. the default is32. anything with a longer length gets discarded before processing even starts π ββοΈ-o max-opt-lengthβ sets the maximum prefix length for optimisation, in max-opt-length bits. the default is32. longer prefixes just don't get optimised, they're left alone π«Ά-p default-lengthβ sets the default prefix length. there is no default, so without this option a prefix missing a mask length is treated as invalid π« use-p 32 -m 32 -o 32to aggregate a list of host routes written as bare addresses, for example π-qβ quiet mode π€« tells aggregate to never generate warning messages or other output on stderr-tβ silently truncates prefixes that have an inconsistent mask. for example, an input prefix203.97.2.226/24gets truncated to203.97.2.0/24. without this option,203.97.2.226/24is not accepted and you get a warning about the inconsistent mask instead π-vβ verbose mode π changes the output format so you can see the source line number each prefix came from. a-means a route that can be suppressed, and a+means a shorter-prefix aggregate that aggregate added as an adjacency optimisation. verbose output still shows up even if-qis selected, so no sneaky quiet mode on this one π
π¨ DIAGNOSTICS π¨
aggregate exits with 0 on success, and with >0 if an error occurs. so 0 = slay, anything bigger = something went wrong π
π EXAMPLES π
okay so here's the input list of prefixes:
193.58.204.0/22
193.58.208.0/22
193.193.160.0/22
193.193.168.0/22
193.243.164.0/22
194.126.128.0/22
194.126.132.0/22
194.126.134.0/23
194.151.128.0/19
195.42.240.0/21
195.240.0.0/16
195.241.0.0/16
and here's what aggregate does with it when you use the -v flag π
aggregate: maximum prefix length permitted will be 24
[ 0] + 193.58.204.0/21
[ 1] - 193.58.204.0/22
[ 2] - 193.58.208.0/22
[ 3] 193.193.160.0/22
[ 4] 193.193.168.0/22
[ 5] 193.243.164.0/22
[ 0] + 194.126.128.0/21
[ 6] - 194.126.128.0/22
[ 7] - 194.126.132.0/22
[ 8] - 194.126.134.0/23
[ 9] 194.151.128.0/19
[ 10] 195.42.240.0/21
[ 0] + 195.240.0.0/15
[ 11] - 195.240.0.0/16
[ 12] - 195.241.0.0/16
look at it go π€© 193.58.204.0/22 and 193.58.208.0/22 got combined under the single prefix 193.58.204.0/21, and 194.126.134.0/23 got suppressed because it was already included in 194.126.132.0/22. the number in square brackets at the start of each line is the original line number, or 0 for new prefixes that aggregate introduced β¨
without the -v flag, the output is just this, clean and simple π«§
193.58.204.0/21
193.193.160.0/22
193.193.168.0/22
193.243.164.0/22
194.126.128.0/21
194.151.128.0/19
195.42.240.0/21
195.240.0.0/15
π¦ SEE ALSO π¦
aggregate-ios(1) π
π HISTORY π
aggregate was written by Joe Abley <jabley@mfnx.net> π and has been reasonably well tested. it's suitable for shrinking customer prefix filters for production use without extensive hand-proving of the results π₯
Autoconf bits were donated by Michael Shields <michael.shields@mfn.com>. The -t option was suggested by Robin Johnson <robbat2@fermi.orbis-terrarum.net>, and the treatment of leading zeros on octet parsing was changed following comments from Arnold Nipper <arnold@nipper.de>. the girlies really showed up for this one π«Ά
An early version of aggregate would attempt to combine adjacent prefixes regardless of whether the first prefix lay on an appropriate bit boundary or not. it was pointed out with great restraint by Robert Noland <rnoland@2hip.net> ππ
β οΈ BUGS β οΈ
β οΈ common unix parsing of IPv4 addresses understands individual octets written in octal or hexadecimal, following a0or0xprefix, respectively. that convention has been deliberately disabled here, because resources such as the IRR don't follow it and confusion can result π
For extremely sensitive applications, judicious use of the -v option together with a pencil and paper is probably advisable ποΈπ
Thanks for hanging out with me, bestie! π This page was written by Joe Abley and dates from 2001 November 2, so it's been around long enough to be a certified legend ππβ¨
π¦ where this page comes from
- debian bookworm: aggregate 1.6-7+b1
- fedora 43: aggregate 1.6-33.fc43 Β· ISC
- fedora 44: aggregate 1.6-35.fc44 Β· ISC
- ubuntu jammy: aggregate 1.6-7build1
- ubuntu noble: aggregate 1.6-7build1
- Copyright (c) 2000-2001 by Metromedia Fiber Network Services, Inc
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms