Giter Site home page Giter Site logo

codeexpress / cidr2ip Goto Github PK

View Code? Open in Web Editor NEW
42.0 2.0 13.0 24 KB

Convert CIDR blocks to constituent IP addresses

License: GNU General Public License v3.0

Makefile 12.27% Go 87.73%
ipv4 cidr-notation cidr-range cidr-subnet cidr2ip network golang-tools golang ip-address ip-range

cidr2ip's Introduction

cidr2ip

This program converts IPv4 CIDR blocks into their constituent IP addresses.

Input modes

  1. Commnd line arguments
code@express:~$ cidr2ip 10.0.0.0/30 192.68.0.0/30
10.0.0.1
10.0.0.2
192.68.0.1
192.68.0.2

The -r flag outputs IP ranges seperated by hyphen.

code@express:~$ cidr2ip -r 10.0.0.0/30 192.68.0.0/30
10.0.0.1-10.0.0.2
192.68.0.1-192.68.0.2
  1. Piped input
code@express:~$ cat cidrs.txt | cidr2ip
192.168.0.101
192.168.0.102
  1. File input
code@express:~$ cidr2ip -f cidrs.txt
192.168.0.101
192.168.0.102

Install

Use go install

If you have golang tools installed, you can download and build the source code locally as follows:

go install github.com/codeexpress/cidr2ip@latest

Download from the releases pages

Download pre-built binary from the releases page. Rename it to cidr2ip. Optionally, add it to your PATH to be able to invoke cidr2ip from any directory without specifying the full path to binary.

cidr2ip's People

Contributors

alexandregv avatar codeexpress avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cidr2ip's Issues

IP Range instead of singles IP option?

Excellent work but have a suggestion and that is to have an option to have the ip ranges like
192.168.0.0-192.168.255.255 instead of been 192.168.0.0 192.168.0.1 192.168.0.2 etc

help

I have a list of in this format :
1.58.76.0-2.58.79.255
1.59.12.0-2.59.15.255
1.1.79.0-5.1.79.255

i want transform in this format :
1.58.76.01
1.58.76.02
....
2.58.79.255
...
1.59.12.1
1.59.12.2
1.59.12.3
...
2.59.15.255

how i run , ?

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.