Coder Social home page Coder Social logo

rbm78bln / subnet-subtractor Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 5 KB

A tool for subtracting sets of subnets from each other

Home Page: https://github.com/rbm78bln/subnet-subtractor

License: MIT License

Makefile 2.30% C++ 97.70%
subnet subnet-calculator subnets subnetting subnetting-ipv4-addresses subnetting-ipv6-addresses

subnet-subtractor's Introduction

Subnet Subtractor

A tool for subtracting sets of subnets from each other

What is this for?

Let's say you want to create a route or filewall rule that matches a certain subnet except an even smaller subnet within that range. What whould be the resulting set of subnets that matches only exactly those IPs? Yes, you can easily calculate this manually - or just use a tiny little tool, that does exactly this for you. Here you go. This little tool automatically splits, joins, and subtracts one set of subnets from another set of subnets and returns the smallest set of subnets that matches exactly the given specs using the shortest network prefixes.

Can it do IPv6 as well?

Actually it can only do IPv6 underneath the hood, yet it even nicely handles IPv4 for convenience.

What's the state of this project?

This is just a tiny little quick hack with a remarkably awful Makefile, file- and code-structure. But good luck anyway.

How to compile and run?

Use make.

Here's an example for running this tool and its corresponding output:

[user@host ~]$ ./subnet-subtractor 192.168.0.0/17 +192.168.128.0/17 -192.168.178.0/24 -192.168.179.0/24
Given Included Subnets:
+ 192.168.0.0/16

Given Excluded Subnets:
- 192.168.178.0/23

Included Subnets without Excluded Subnets:
= 192.168.0.0/17
= 192.168.192.0/18
= 192.168.128.0/19
= 192.168.160.0/20
= 192.168.184.0/21
= 192.168.180.0/22
= 192.168.176.0/23

Why would I want to compile a tool for that?

You don't need to. Just do it on the web: Visual Subnet Calculator

-

subnet-subtractor's People

Contributors

rbm78bln avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.