GithubHelp home page GithubHelp logo

ne00n / cidrl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from emden-norfolk/cidrl

0.0 1.0 0.0 84 KB

List all IP addresses within a CIDR block.

License: BSD 3-Clause "New" or "Revised" License

C 96.96% Makefile 3.04%

cidrl's Introduction

cidrl โ€” CIDR List

CIDRL lists all IP addresses within a CIDR block (IPv4 and IPv6.) Supports subnetting.

Classless Inter-Domain Routing (CIDR; rfc1519) is a strategy for assigning and routing Internet Protocol (IP) addresses.

Usage

cidrl for IPv4

Analyse and list all hosts in a /29:

$ man cidrl
$ cidrl -a 192.168.50.16/29
Gateway:    192.168.50.16
Broadcast:  192.168.50.23
Netmask:    255.255.255.248
Hosts:      8
$ cidrl 192.168.50.16/29
192.168.50.16
192.168.50.17
192.168.50.18
192.168.50.19
192.168.50.20
192.168.50.21
192.168.50.22
192.168.50.23

Split a /24 into /28:

$ cidrl -s28 10.0.0.0/24
10.0.0.0/28
10.0.0.16/28
10.0.0.32/28
10.0.0.48/28
10.0.0.64/28
10.0.0.80/28
10.0.0.96/28
10.0.0.112/28
10.0.0.128/28
10.0.0.144/28
10.0.0.160/28
10.0.0.176/28
10.0.0.192/28
10.0.0.208/28
10.0.0.224/28
10.0.0.240/28

See examples/host_exists_in_network.sh for an example on how to use the -e option to programmatically check if a host exists within a given network. Alternatively, use cidrl -ae <host> <network>.

cidrl6 for IPv6

Split an IPv6 /60 into /64:

$ man cidrl6
$ cidrl6 -s64 fa01:0:0:ffa0::/60
fa01:0:0:ffa0::/64
fa01:0:0:ffa1::/64
fa01:0:0:ffa2::/64
fa01:0:0:ffa3::/64
fa01:0:0:ffa4::/64
fa01:0:0:ffa5::/64
fa01:0:0:ffa6::/64
fa01:0:0:ffa7::/64
fa01:0:0:ffa8::/64
fa01:0:0:ffa9::/64
fa01:0:0:ffaa::/64
fa01:0:0:ffab::/64
fa01:0:0:ffac::/64
fa01:0:0:ffad::/64
fa01:0:0:ffae::/64
fa01:0:0:ffaf::/64

Analyse an IPv6 network and check if a given host exists within it:

$ cidrl6 -ae fa01::ffb0:3:0:0:ae90 fa01:0:0:ffa0::/64
Network:    fa01:0:0:ffa0::
Range-end:  fa01::ffa0:ffff:ffff:ffff:ffff
Netmask:    ffff:ffff:ffff:ffff::

The host fa01::ffb0:3:0:0:ae90 does not exist within this network.

Installation

$ git clone [email protected]:emden-norfolk/cidrl.git
$ cd cidrl/
$ make
$ sudo make install

References

The following manual pages are helpful for understanding the implementation of CIDRL:

Further reading:

See also:

Author

2016 (c) Damien Bezborodov

cidrl's People

Contributors

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