aggregate8
Tool for aggregating cidr networks
Usage
aggregate [options]
Overview
aggregate(8) is a tool for aggregating CIDR networks. Input is read from stdin and output is written to stdout. It undestands IPv4 networks represented as network/prefix, network/netmask and start_address - end_addres. It is able to read input in any one of these formats and output in the same or a different format.
It is also able to limit the maximum and minimum prefix length that will be output. This can be used to filter, for instance ignoring all networks with a prefix longer than 24 bits. That is all networks smaller than a traditional Class C.
Options
- -h, --help:
-
Display terse help.
-
-i, --input-format FORMAT: -
Format for input. One of:
prefix:network/prefix.
e.g. 10.0.0.0/24netmask:network/netmask.
e.g. 10.0.0.0/255.255.255.0range:start_ip - end_ip.
e.g. 10.0.0.0 - 10.0.0.255Note that while prefix and netmask types imply a single CIDR network, a range may span multiple CIDR networks.
The default is prefix.
-
-M, --maximum-format FORMAT: -
Supress the output of networks whose prefix is greater than this value. Valid values 0-32. -1 for no maximum prefix. Default is -1.
-
-m, --minimum-format FORMAT: -
Supress netorks whose prefix is less than this value. Valid values 0-32. -1 for no minimum prefix. Default is -1.
-
-o, --output-format FORMAT: -
Format for intput. Available formats are as per --input-format. Defailt is prefix.
Examples
- Example 1:
-
Aggregate some prefixes.
aggregate 10.0.0.0/19 10.0.255.0/24 10.1.0.0/24 10.1.1.0/24 10.1.2.0/24 10.1.2.0/25 10.1.2.128/25 10.1.3.0/25 ^D 10.0.0.0/19 10.0.255.0/24 10.1.0.0/23 10.1.2.0/24 10.1.3.0/25
- Example 2:
-
Aggregate some prefixes ignoring anything smaller than a /24.
aggregate -M 24 10.0.0.0/19 10.0.255.0/24 10.1.0.0/24 10.1.1.0/24 10.1.2.0/24 10.1.2.0/25 10.1.2.128/25 10.1.3.0/25 ^D 10.0.0.0/19 10.0.255.0/24 10.1.0.0/23 10.1.2.0/24
- Example 3:
-
Same as example 1 but input is in
netmaskformat and output is inrangeformataggregate -i netmask 10.0.0.0/255.255.224.0 10.0.255.0/255.255.255.0 10.1.0.0/255.255.255.0 10.1.1.0/255.255.255.0 10.1.2.0/255.255.255.0 10.1.2.0/255.255.255.128 10.1.2.128/255.255.255.128 10.1.3.0/255.255.255.128 ^D 10.0.0.0 - 10.0.31.255 10.0.255.0 - 10.0.255.255 10.1.0.0 - 10.1.1.255 10.1.2.0 - 10.1.2.255 10.1.3.0 - 10.1.3.127
Releases
2 releases since Debian 3.0 (Woody); the text changed 1 time.