Giter Site home page Giter Site logo

subnetcalculator's Introduction

Subnetcalculator

Installation

CLone this repository in local.

Create a virtual environment and install the packages:

python -m venv .env.windows
.env.windows/Scripts/activate
pip install pyyaml pydantic

Run python subnetcalculator/subnetcalculator.py --help

This should display:

usage: subnetcalculator [-h] [--generate-json-schema] [--generate-example {simple,advanced,company}] [--out-stdin] [--out-txt FILE] [--out-json FILE] [--out-yaml FILE] target

positional arguments:
  target                Configuration file to use for the subnet structure generation. Or destination file if --generate-json-schema or --generate-example is set.

options:
  -h, --help            show this help message and exit
  --generate-json-schema
                        Generate the json schema to the given file.
  --generate-example {simple,advanced,company}
                        Generate an example configuration file.
  --out-stdout           Render the computation to the STDIN using print.
  --out-txt FILE        Store the output the given txt file.
  --out-json FILE       Store the output the given json file.
  --out-yaml FILE       Store the output the given yaml file.

Generate a configuration example

Always activate the environment first: .env.windows/Scripts/activate

python subnetcalculator/subnetcalculator.py --generate-example simple yourfile.yaml

That will create a sample configuration file yourfile.yaml.

Compute subnets

Always activate the environment first: .env.windows/Scripts/activate

python subnetcalculator/subnetcalculator.py --out-stdout yourfile.yaml

That will compute the subnets and display them in the standard output.

NAME                CIDR                     ADDRCOUNT      FIRSTADDR           LASTADDR            DESCRIPTION                                       
PUBLIC              10.1.0.0/18              16384          10.1.0.0            10.1.63.255         Hosts internet facing resources.
PRIVATE             10.1.64.0/18             16384          10.1.64.0           10.1.127.255        Hosts compute resources.
DATA                10.1.128.0/18            16384          10.1.128.0          10.1.191.255        Hosts databases.

You can add --out-yaml youroutput.yaml to put the result in a yaml file that can used by other scripts.

subnetcalculator's People

Contributors

leikt avatar

Watchers

 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.