Skip to content

Merge and de-dupe overlapping and adjacent IP address ranges (CIDRs).

License

Notifications You must be signed in to change notification settings

kfeldmann/cidrmerge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CIDR Merge

Merge and de-dupe overlapping or adjacent IP ranges (only IPv4). Invalid CIDRs in the input cause cidrmerge to print an error and halt.

Please report any use-cases where cidrmerge fails. Thank you!

$ ./cidrmerge -?
Usage: cat cidr_list [cidr_list...] | ./cidrmerge > output
$ 
$ cat test
123.11.13.0/24
123.10.0.0/16
123.10.125.0/24
123.11.12.0/24
123.10.121.16
123.10.125.0/24
123.11.12.221/32
$ 
$ cat test | ./cidrmerge 
123.10.0.0/16
123.11.12.0/23
$ 
$ echo 10.1.1.1/24 | ./cidrmerge 
ERROR: [10.1.1.1/24] Invalid starting address for /24. Try 10.1.1.0 or 10.1.2.0
$ 

About

Merge and de-dupe overlapping and adjacent IP address ranges (CIDRs).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages