Skip to content

Converts IP Address Range to Classless Inter-Domain Routing

Notifications You must be signed in to change notification settings

viruslab/ip2cidr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ip2cidr

Introduction

A simple Ruby gem for converting a range of IP addresses to a list of CIDR blocks.

Installation

Install the gem on the command line using

gem install ip2cidr

Usage

Using the class:

$  irb
>> require "ip2cidr"
>> IPToCIDR.solveCIDR("192.168.0.1", "192.168.0.16")
=> ["192.168.0.1/32", "192.168.0.2/31", "192.168.0.4/30", "192.168.0.8/29", "192.168.0.16/32"]

Using the binary file:

$ ip2cidr 192.168.0.1 192.168.0.16
192.168.0.1/32
192.168.0.2/31
192.168.0.4/30
192.168.0.8/29
192.168.0.16/32

This gem cannot use either 0.0.0.0 or 255.255.255.255 as inputs and will return an ArgumentError if they are used as inputs.

Authors

Carlo Niño A. Bitoon

Kirk Gandril B. Madraga

John Patrick Suelto

About

Converts IP Address Range to Classless Inter-Domain Routing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages