Skip to content

ygavenchuk/merge-ip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Merge-IP

A simple CLI tool that merges 2 or more sequential CIDRs where it is possible.

I.e. assume you have next CIDRs:

  • 10.1.0.0/24
  • 10.1.1.0/24
  • 10.1.2.0/24
  • 10.1.3.0/24

It's redundant to have 4 routing records for those CIDRs, it would be more convenient to combine them into, say 10.1.0.0/22

As a side effect the tool removes duplicates and orders CIDRs in ascending order. It reads CIDRs or IPs separated by space(s) or new line(s) from standard input or file and prints results into the standard output.

Usage

  • ./merge-ip -f file-with-cidrs.txt
  • cat file-with-cidrs.txt | merge-ip

Build

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=ninja -G Ninja
cmake --build --target merge-ip

Build for OpenWrt

See instructions here

Special thanks

This tool is inspired by:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published