CIDR Math

Tools

Routesum

routesum is both a command-line program and a Golang library that performs route summarization on a list of IP addresses and CIDR-formatted networks. Route summarization is the process of reducing a list of IPs and networks to its shortest possible form.
https://github.com/PatrickCronin/routesum

Netmask

netmask is a CLI tool for converting different types of network representations
https://github.com/tlby/netmask

Examples

Convert some IP ranges into CIDR ranges and then summarise those ranges into the shortest possible form:

netmask -c 10.237.0.0:10.255.255.255 10.0.0.0:10.235.255.255 | routesum