GithubHelp home page GithubHelp logo

lukateras / subnetgen Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 10 KB

Random local IPv4/IPv6 ULA subnet generator

License: Creative Commons Zero v1.0 Universal

Nix 13.66% Meson 2.96% C 83.38%
cidr c ipv4 ipv6 meson

subnetgen's Introduction

subnetgen

Tool to generate IPv4 and IPv6 subnetworks.

Rationale is to make sure networks are composable, allowing to use more than one network while keeping every peer addressable.

IPv6 subnetworks are RFC 4193 ULA conformant.

Randomness is taken from getentropy(3). At the moment of writing, this API is only natively supported in Fuchsia, Linux and OpenBSD. Compatiblity shim is provided for Windows.

Network Flag N, 50% collision chance Network capacity
IPv4 -4 300 254
IPv6 -6 1 230 000 more than septillion

As you can see, generated IPv4 networks provide very limited capacity. You can trade some uniqueness for more peers by decrementing CIDR prefix: refer to CIDR.xyz.

Flags are processed in order and can be repeated. For example, subnetgen -44664 will print two IPv4 subnets, then two IPv6 subnets, and then one more IPv4 subnet, in that order, each on separate line.

If you want to calculate chance of collision, refer to birthday problem.

subnetgen's People

Contributors

lukateras avatar

Watchers

 avatar  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.