cidr-brewer


Namecidr-brewer JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/caleb531/cidr-brewer
SummaryA CLI utility for working with classless IP addresses
upload_time2016-07-09 04:30:07
maintainerNone
docs_urlNone
authorCaleb Evans
requires_pythonNone
licenseMIT
keywords networking ip addresses cidr
VCS
bugtrack_url
requirements colorama coverage flake8 invoke mando mccabe nose pep8 pyflakes python-termstyle radon rednose
Travis-CI
coveralls test coverage
            CIDR Brewer
===========

| *Copyright 2016 Caleb Evans*
| *Released under the MIT license*

|Build Status| |Coverage Status|

CIDR Brewer is a command-line utility which displays information for
classless IP addresses (such as subnet mask and network ID) so you don't
need to perform the calculations yourself.

Installing
----------

You can install CIDR Brewer via pip (ideally globally):

::

    pip install cidr-brewer

Usage
-----

To use, run ``cidr-brewer`` from the command line with one or two IP
addresses.

One IP address
~~~~~~~~~~~~~~

If you pass a single IP address using slash notation, CIDR Brewer will
compute the subnet mask, network ID, broadcast ID, and the range of
valid/available IP addresses.

::

    $ ./cidrbrewer.py 192.168.19.100/25
    Given IP address:
       192.168.19.100/25  11000000.10101000.00010011.01100100
    Subnet mask:
       255.255.255.128    11111111.11111111.11111111.10000000
    Network ID:
       192.168.19.0/25    11000000.10101000.00010011.00000000
    Broadcast ID:
       192.168.19.127     11000000.10101000.00010011.01111111
    First Available Address:
       192.168.19.1       11000000.10101000.00010011.00000001
    Last Available Address:
       192.168.19.126     11000000.10101000.00010011.01111110
    Subnet Size: 2^7 - 2 = 126

Additionally, if you supply a list of block sizes, CIDR Brewer will
compute the same information for each sub-block.

::

    $ ./cidrbrewer.py 42.114.152.128/25 --block-sizes 16 64 16 32
    Given IP address:
       42.114.152.128/25  00101010.01110010.10011000.10000000
    Block 1:
       Block Size: 2^6 = 64
       Network ID:
          42.114.152.128/26  00101010.01110010.10011000.10000000
       Broadcast ID:
          42.114.152.191     00101010.01110010.10011000.10111111
       First Available Address:
          42.114.152.129     00101010.01110010.10011000.10000001
       Last Available Address:
          42.114.152.190     00101010.01110010.10011000.10111110
       Subnet Size: 2^6 - 2 = 62
    Block 2:
       Block Size: 2^5 = 32
       Network ID:
          42.114.152.192/27  00101010.01110010.10011000.11000000
       Broadcast ID:
          42.114.152.223     00101010.01110010.10011000.11011111
       First Available Address:
          42.114.152.193     00101010.01110010.10011000.11000001
       Last Available Address:
          42.114.152.222     00101010.01110010.10011000.11011110
       Subnet Size: 2^5 - 2 = 30
    Block 3:
       Block Size: 2^4 = 16
       Network ID:
          42.114.152.224/28  00101010.01110010.10011000.11100000
       Broadcast ID:
          42.114.152.239     00101010.01110010.10011000.11101111
       First Available Address:
          42.114.152.225     00101010.01110010.10011000.11100001
       Last Available Address:
          42.114.152.238     00101010.01110010.10011000.11101110
       Subnet Size: 2^4 - 2 = 14
    Block 4:
       Block Size: 2^4 = 16
       Network ID:
          42.114.152.240/28  00101010.01110010.10011000.11110000
       Broadcast ID:
          42.114.152.255     00101010.01110010.10011000.11111111
       First Available Address:
          42.114.152.241     00101010.01110010.10011000.11110001
       Last Available Address:
          42.114.152.254     00101010.01110010.10011000.11111110
       Subnet Size: 2^4 - 2 = 14

Two IP addresses
~~~~~~~~~~~~~~~~

If you pass two IP addresses (without slash notation), CIDR Brewer will
also compute the largest subnet mask needed for communication between
the two addresses.

::

    $ ./cidrbrewer.py 172.16.11.74 172.16.11.78
    Given IP addresses:
       172.16.11.74       10101100.00010000.00001011.01001010
       172.16.11.78       10101100.00010000.00001011.01001110
    Largest subnet mask allowing communication:
       29 bits
       255.255.255.248    11111111.11111111.11111111.11111000
    Network ID:
       172.16.11.72/29    10101100.00010000.00001011.01001000
    Broadcast ID:
       172.16.11.79       10101100.00010000.00001011.01001111
    First Available Address:
       172.16.11.73       10101100.00010000.00001011.01001001
    Last Available Address:
       172.16.11.78       10101100.00010000.00001011.01001110
    Subnet Size: 2^3 - 2 = 6

If you pass two IP addresses (with slash notation), CIDR Brewer will
also indicate if the IP addresses can already communicate on their
respective subnets.

::

    $ ./cidrbrewer.py 125.47.32.170/25 125.47.32.53/25
    Given IP addresses:
       125.47.32.170/25   01111101.00101111.00100000.10101010
       125.47.32.53/25    01111101.00101111.00100000.00110101
    Can these IP addresses communicate?
       No
    Largest subnet mask allowing communication:
       24 bits
       255.255.255.0      11111111.11111111.11111111.00000000
    Network ID:
       125.47.32.0/24     01111101.00101111.00100000.00000000
    Broadcast ID:
       125.47.32.255      01111101.00101111.00100000.11111111
    First Available Address:
       125.47.32.1        01111101.00101111.00100000.00000001
    Last Available Address:
       125.47.32.254      01111101.00101111.00100000.11111110
    Subnet Size: 2^8 - 2 = 254

Examples
--------

The ``/examples`` directory contains example IP addresses for you to
test against the utility.

.. |Build Status| image:: https://travis-ci.org/caleb531/cidr-brewer.svg?branch=master
   :target: https://travis-ci.org/caleb531/cidr-brewer
.. |Coverage Status| image:: https://coveralls.io/repos/caleb531/cidr-brewer/badge.svg?branch=master
   :target: https://coveralls.io/r/caleb531/cidr-brewer?branch=master
            

Raw data

            {
    "_id": null,
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "cheesecake_code_kwalitee_id": null,
    "keywords": "networking ip addresses cidr",
    "upload_time": "2016-07-09 04:30:07",
    "requirements": [
        {
            "name": "colorama",
            "specs": [
                [
                    "==",
                    "0.3.7"
                ]
            ]
        },
        {
            "name": "coverage",
            "specs": [
                [
                    "==",
                    "4.0.3"
                ]
            ]
        },
        {
            "name": "flake8",
            "specs": [
                [
                    "==",
                    "2.5.4"
                ]
            ]
        },
        {
            "name": "invoke",
            "specs": [
                [
                    "==",
                    "0.12.2"
                ]
            ]
        },
        {
            "name": "mando",
            "specs": [
                [
                    "==",
                    "0.3.3"
                ]
            ]
        },
        {
            "name": "mccabe",
            "specs": [
                [
                    "==",
                    "0.4.0"
                ]
            ]
        },
        {
            "name": "nose",
            "specs": [
                [
                    "==",
                    "1.3.7"
                ]
            ]
        },
        {
            "name": "pep8",
            "specs": [
                [
                    "==",
                    "1.7.0"
                ]
            ]
        },
        {
            "name": "pyflakes",
            "specs": [
                [
                    "==",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "python-termstyle",
            "specs": [
                [
                    "==",
                    "0.1.10"
                ]
            ]
        },
        {
            "name": "radon",
            "specs": [
                [
                    "==",
                    "1.3.2"
                ]
            ]
        },
        {
            "name": "rednose",
            "specs": [
                [
                    "==",
                    "0.4.3"
                ]
            ]
        }
    ],
    "author": "Caleb Evans",
    "home_page": "https://github.com/caleb531/cidr-brewer",
    "github_user": "caleb531",
    "download_url": "https://pypi.python.org/packages/dc/55/4fec566bf631af704f0c17524c7be7bcd5f7564aeaf5ce76e0c927356729/cidr-brewer-1.0.0.tar.gz",
    "platform": "UNKNOWN",
    "version": "1.0.0",
    "cheesecake_documentation_id": null,
    "description": "CIDR Brewer\n===========\n\n| *Copyright 2016 Caleb Evans*\n| *Released under the MIT license*\n\n|Build Status| |Coverage Status|\n\nCIDR Brewer is a command-line utility which displays information for\nclassless IP addresses (such as subnet mask and network ID) so you don't\nneed to perform the calculations yourself.\n\nInstalling\n----------\n\nYou can install CIDR Brewer via pip (ideally globally):\n\n::\n\n    pip install cidr-brewer\n\nUsage\n-----\n\nTo use, run ``cidr-brewer`` from the command line with one or two IP\naddresses.\n\nOne IP address\n~~~~~~~~~~~~~~\n\nIf you pass a single IP address using slash notation, CIDR Brewer will\ncompute the subnet mask, network ID, broadcast ID, and the range of\nvalid/available IP addresses.\n\n::\n\n    $ ./cidrbrewer.py 192.168.19.100/25\n    Given IP address:\n       192.168.19.100/25  11000000.10101000.00010011.01100100\n    Subnet mask:\n       255.255.255.128    11111111.11111111.11111111.10000000\n    Network ID:\n       192.168.19.0/25    11000000.10101000.00010011.00000000\n    Broadcast ID:\n       192.168.19.127     11000000.10101000.00010011.01111111\n    First Available Address:\n       192.168.19.1       11000000.10101000.00010011.00000001\n    Last Available Address:\n       192.168.19.126     11000000.10101000.00010011.01111110\n    Subnet Size: 2^7 - 2 = 126\n\nAdditionally, if you supply a list of block sizes, CIDR Brewer will\ncompute the same information for each sub-block.\n\n::\n\n    $ ./cidrbrewer.py 42.114.152.128/25 --block-sizes 16 64 16 32\n    Given IP address:\n       42.114.152.128/25  00101010.01110010.10011000.10000000\n    Block 1:\n       Block Size: 2^6 = 64\n       Network ID:\n          42.114.152.128/26  00101010.01110010.10011000.10000000\n       Broadcast ID:\n          42.114.152.191     00101010.01110010.10011000.10111111\n       First Available Address:\n          42.114.152.129     00101010.01110010.10011000.10000001\n       Last Available Address:\n          42.114.152.190     00101010.01110010.10011000.10111110\n       Subnet Size: 2^6 - 2 = 62\n    Block 2:\n       Block Size: 2^5 = 32\n       Network ID:\n          42.114.152.192/27  00101010.01110010.10011000.11000000\n       Broadcast ID:\n          42.114.152.223     00101010.01110010.10011000.11011111\n       First Available Address:\n          42.114.152.193     00101010.01110010.10011000.11000001\n       Last Available Address:\n          42.114.152.222     00101010.01110010.10011000.11011110\n       Subnet Size: 2^5 - 2 = 30\n    Block 3:\n       Block Size: 2^4 = 16\n       Network ID:\n          42.114.152.224/28  00101010.01110010.10011000.11100000\n       Broadcast ID:\n          42.114.152.239     00101010.01110010.10011000.11101111\n       First Available Address:\n          42.114.152.225     00101010.01110010.10011000.11100001\n       Last Available Address:\n          42.114.152.238     00101010.01110010.10011000.11101110\n       Subnet Size: 2^4 - 2 = 14\n    Block 4:\n       Block Size: 2^4 = 16\n       Network ID:\n          42.114.152.240/28  00101010.01110010.10011000.11110000\n       Broadcast ID:\n          42.114.152.255     00101010.01110010.10011000.11111111\n       First Available Address:\n          42.114.152.241     00101010.01110010.10011000.11110001\n       Last Available Address:\n          42.114.152.254     00101010.01110010.10011000.11111110\n       Subnet Size: 2^4 - 2 = 14\n\nTwo IP addresses\n~~~~~~~~~~~~~~~~\n\nIf you pass two IP addresses (without slash notation), CIDR Brewer will\nalso compute the largest subnet mask needed for communication between\nthe two addresses.\n\n::\n\n    $ ./cidrbrewer.py 172.16.11.74 172.16.11.78\n    Given IP addresses:\n       172.16.11.74       10101100.00010000.00001011.01001010\n       172.16.11.78       10101100.00010000.00001011.01001110\n    Largest subnet mask allowing communication:\n       29 bits\n       255.255.255.248    11111111.11111111.11111111.11111000\n    Network ID:\n       172.16.11.72/29    10101100.00010000.00001011.01001000\n    Broadcast ID:\n       172.16.11.79       10101100.00010000.00001011.01001111\n    First Available Address:\n       172.16.11.73       10101100.00010000.00001011.01001001\n    Last Available Address:\n       172.16.11.78       10101100.00010000.00001011.01001110\n    Subnet Size: 2^3 - 2 = 6\n\nIf you pass two IP addresses (with slash notation), CIDR Brewer will\nalso indicate if the IP addresses can already communicate on their\nrespective subnets.\n\n::\n\n    $ ./cidrbrewer.py 125.47.32.170/25 125.47.32.53/25\n    Given IP addresses:\n       125.47.32.170/25   01111101.00101111.00100000.10101010\n       125.47.32.53/25    01111101.00101111.00100000.00110101\n    Can these IP addresses communicate?\n       No\n    Largest subnet mask allowing communication:\n       24 bits\n       255.255.255.0      11111111.11111111.11111111.00000000\n    Network ID:\n       125.47.32.0/24     01111101.00101111.00100000.00000000\n    Broadcast ID:\n       125.47.32.255      01111101.00101111.00100000.11111111\n    First Available Address:\n       125.47.32.1        01111101.00101111.00100000.00000001\n    Last Available Address:\n       125.47.32.254      01111101.00101111.00100000.11111110\n    Subnet Size: 2^8 - 2 = 254\n\nExamples\n--------\n\nThe ``/examples`` directory contains example IP addresses for you to\ntest against the utility.\n\n.. |Build Status| image:: https://travis-ci.org/caleb531/cidr-brewer.svg?branch=master\n   :target: https://travis-ci.org/caleb531/cidr-brewer\n.. |Coverage Status| image:: https://coveralls.io/repos/caleb531/cidr-brewer/badge.svg?branch=master\n   :target: https://coveralls.io/r/caleb531/cidr-brewer?branch=master",
    "lcname": "cidr-brewer",
    "name": "cidr-brewer",
    "github": true,
    "bugtrack_url": null,
    "license": "MIT",
    "travis_ci": true,
    "github_project": "cidr-brewer",
    "summary": "A CLI utility for working with classless IP addresses",
    "split_keywords": [
        "networking",
        "ip",
        "addresses",
        "cidr"
    ],
    "author_email": "caleb@calebevans.me",
    "urls": [
        {
            "has_sig": false,
            "upload_time": "2016-07-09T04:30:07",
            "comment_text": "",
            "python_version": "source",
            "url": "https://pypi.python.org/packages/dc/55/4fec566bf631af704f0c17524c7be7bcd5f7564aeaf5ce76e0c927356729/cidr-brewer-1.0.0.tar.gz",
            "md5_digest": "3341bd59ad1fc5aa642681f26f0c10a0",
            "downloads": 0,
            "filename": "cidr-brewer-1.0.0.tar.gz",
            "packagetype": "sdist",
            "path": "dc/55/4fec566bf631af704f0c17524c7be7bcd5f7564aeaf5ce76e0c927356729/cidr-brewer-1.0.0.tar.gz",
            "size": 4720
        }
    ],
    "cheesecake_installability_id": null,
    "coveralls": true
}
        
Elapsed time: 0.01313s