https://github.com/caleb531/cidr-brewer

A CLI utility for working with classless IP addresses

https://github.com/caleb531/cidr-brewer

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.2%) to scientific vocabulary

Keywords

cidr cli ip-address ipv4 python
Last synced: 6 months ago · JSON representation

Repository

A CLI utility for working with classless IP addresses

Basic Info
  • Host: GitHub
  • Owner: caleb531
  • License: mit
  • Language: Python
  • Default Branch: main
  • Size: 108 KB
Statistics
  • Stars: 4
  • Watchers: 1
  • Forks: 2
  • Open Issues: 1
  • Releases: 1
Topics
cidr cli ip-address ipv4 python
Created almost 10 years ago · Last pushed 8 months ago
Metadata Files
Readme License

README.md

CIDR Brewer

Copyright 2016-2024 Caleb Evans
Released under the MIT license

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

$ cidr-brewer 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.

$ cidr-brewer 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.

$ cidr-brewer 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.

$ cidr-brewer 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.

Owner

  • Name: Caleb Evans
  • Login: caleb531
  • Kind: user
  • Location: Carlsbad, CA

Hi, I'm Caleb, a web developer who lives for Christ by building enjoyable apps and useful tools. I hope you are blessed by what I've made!

GitHub Events

Total
  • Push event: 11
Last Year
  • Push event: 11

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 65
  • Total Committers: 1
  • Avg Commits per committer: 65.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Caleb Evans c****b@c****e 65
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 1
  • Total pull requests: 7
  • Average time to close issues: N/A
  • Average time to close pull requests: 7 months
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 2.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 7
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • aodj (1)
Pull Request Authors
  • dependabot[bot] (7)
Top Labels
Issue Labels
Pull Request Labels
dependencies (7)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 7 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 2
  • Total versions: 1
  • Total maintainers: 1
pypi.org: cidr-brewer

A CLI utility for working with classless IP addresses

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 2
  • Downloads: 7 Last month
Rankings
Dependent packages count: 10.1%
Dependent repos count: 11.6%
Forks count: 19.1%
Stargazers count: 23.1%
Average: 26.5%
Downloads: 68.9%
Maintainers (1)
Last synced: 6 months ago

Dependencies

requirements.txt pypi
  • Pygments ==2.10.0
  • bleach ==4.1.0
  • certifi ==2018.11.29
  • chardet ==3.0.4
  • charset-normalizer ==2.0.4
  • colorama ==0.3.9
  • coverage ==5.3
  • docutils ==0.14
  • flake8 ==3.6.0
  • flake8-isort ==2.4
  • flake8-polyfill ==1.0.2
  • idna ==2.8
  • isort ==4.3.4
  • mando ==0.6.4
  • mccabe ==0.6.1
  • nose ==1.3.7
  • packaging ==21.0
  • pkginfo ==1.5.0.1
  • pycodestyle ==2.4.0
  • pyflakes ==2.0.0
  • pyparsing ==2.4.7
  • radon ==2.2.0
  • readme-renderer ==24.0
  • rednose ==1.3.0
  • requests ==2.26.0
  • requests-toolbelt ==0.9.1
  • six ==1.10.0
  • termstyle ==0.1.11
  • testfixtures ==5.4.0
  • tqdm ==4.31.1
  • twine ==1.13.0
  • urllib3 ==1.26.6
  • webencodings ==0.5.1
.github/workflows/tests.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
  • coverallsapp/github-action master composite
pyproject.toml pypi
.github/workflows/build.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
.github/workflows/lint.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
.github/workflows/publish.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
  • pypa/gh-action-pypi-publish release/v1 composite