Manpages

NAME

aggregate − tool for aggregating CIDR networks

SYNOPSIS

aggregate [options]

DESCRIPTION

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/24

netmask: network/netmask.
e.g. 10.0.0.0/255.255.255.0

range: start_ip - end_ip.
e.g. 10.0.0.0 - 10.0.0.255

Note 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 netmask format and output is in range format

aggregate -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

AUTHOR

Horms <horms [AT] verge.au>