logo

utils-cidr

utilities to manipulate CIDR ip-ranges git clone https://anongit.hacktivis.me/git/utils-cidr.git
commit: 7e1203f36d86742147600cd7fbca141a07df32e4
parent f274e82ad0c8f000d8a65a9a96faa779a510edf5
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sat, 18 Oct 2025 15:52:56 +0200

cidr2list.1: Add rationale on IPv6

Diffstat:

Mcidr2list.115+++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/cidr2list.1 b/cidr2list.1 @@ -6,12 +6,12 @@ .Os .Sh NAME .Nm cidr2list -.Nd expand cidr ranges into a list +.Nd expand CIDR ranges into a list .Sh SYNOPSIS .Nm .Sh DESCRIPTION .Nm -reads cidr ranges and cidr-less IPv4 addresses from standard +reads CIDR ranges and CIDR-less IPv4 addresses from standard input and prints the full list of the addresses of their range, assuming a /32 for CIDR-less addresses. .Sh EXIT STATUS @@ -24,5 +24,16 @@ $ printf '%s\en' 192.168.0.42/31 192.168.0.69/31 | cidr2list 192.168.0.68 192.168.0.69 .Ed +.Sh RATIONALES +.Nm +doesn't supports IPv6 because the typical usage would be extremely +large ranges like /48 and /64 which would respectively imply +printing 2^(128-48) and 2^(128-64) IPv6 addresses. +Which cannot fit into current (2025) storage, let alone RAM. +.Pp +Meanwhile even printing 0.0.0.0/0 (all of IPv4) would take less than +(2^32)*16\ =\ 64\ GiB, which is big but not impractical. +.br +16 being the maximum used for each line: 4*3 digits, 3 dots, 1 newline. .Sh AUTHORS .An Haelwenn (lanodan) Monnier Aq Mt contact@hacktivis.me