______ ______ _______ _______ __ __
/ \ / |/ \ / \ / | / |
/$$$$$$ |$$$$$$/ $$$$$$$ |$$$$$$$ | _______ $$ |____ ______ $$ | __ ______ ______
$$ | $$/ $$ | $$ | $$ |$$ |__$$ | / |$$ \ / \ $$ | / | / \ / \
$$ | $$ | $$ | $$ |$$ $$< /$$$$$$$/ $$$$$$$ |/$$$$$$ |$$ |_/$$/ /$$$$$$ |/$$$$$$ |
$$ | __ $$ | $$ | $$ |$$$$$$$ |$$ | $$ | $$ |$$ $$ |$$ $$< $$ $$ |$$ | $$/
$$ \__/ | _$$ |_ $$ |__$$ |$$ | $$ |$$ \_____ $$ | $$ |$$$$$$$$/ $$$$$$ \ $$$$$$$$/ $$ |
$$ $$/ / $$ |$$ $$/ $$ | $$ |$$ |$$ | $$ |$$ |$$ | $$ |$$ |$$ |
$$$$$$/ $$$$$$/ $$$$$$$/ $$/ $$/ $$$$$$$/ $$/ $$/ $$$$$$$/ $$/ $$/ $$$$$$$/ $$/
A CIDR checker that can compare 2+n CIDR ranges and tell you if there is any overlap in their network ranges.
Currently written in Golang.
CIDR checker is simple to use, it accepts 1 or more ips, seperated by spaces, in CIDR notation format and lets the user know if there are any overlapping CIDRs in that input. For example:
$ cidr-checker 10.0.1.0/24 10.0.2.0/24 10.0.3.0/24
2023/09/03 13:59:58 All good no overlapping CIDRs.
If you wish to read from stdin using cidr-checker please use xargs. For example:
echo "10.0.0.0/24 10.0.1.0/24 10.0.2.0/24" | xargs cidr-checker
2023/09/03 14:00:20 All good no overlapping CIDRs.
You can also check that a specified network address contains the supplied IPs:
$ cidr-checker --network 10.0.0.0/8 10.0.1.0/24 10.0.2.0/24 10.0.3.0/24
You will need golang's tooling to install, once install.
go build .
To install this to your machine simply download the latest release from releases and copy into you bin path e.g. /usr/local/bin/.
You must have Golang tooling installed.
$ cd pkg/cidr_validators/
$ go test