Giter Site home page Giter Site logo

iptools-1's Introduction

iptools

About

iptools is a collection of 3 scripts which are used for doing simple IPv4 address calculations and builds on the wonderful ipcalc tool provided by Krischan Jodies. iptools does conversions of IP to 32-bit int, 32-bit int to IP and has a tool for telling you whether an IP is inside a subnet.

Before you can use these tools, you must install ipcalc first. ipcalc can be found at: http://jodies.de/ipcalc

The Tools

ip2int

ip2int will take a provided IPv4 address (using dotted octet notation) and return it as a 32-bit integer.

Usage:

ip2int <ip_address>

Example:

$ ./ip2int 10.0.0.1
167772161

int2ip

int2ip takes a provided 32-bit integer representation of an IPv4 address and returns it in dotted octet notation.

Usage:

int2ip <ip_address_int>

Example:

$ ./int2ip 167772161
10.0.0.1

insubnet

insubnet is a tool used to figure out whether a given IPv4 address (in dotted octet notation) is in the provided subnet (in CIDR notation). insubnet will return 0 if the address is inside the subnet and 1 if not.

Usage:

insubnet <ip_address> <cidr>

Example:

$ ./insubnet 10.1.1.15 10.1.1.0/24
10.1.1.15 is inside 10.1.1.0/24

Example:

$ ./insubnet 12.1.1.15 10.1.1.0/24
12.1.1.15 is NOT inside 10.1.1.0/24

Author

The iptools package is written by Spike Grobstein ([email protected]) and is licensed under the MIT license.

Feel free to modify and re-distribute, but don't forget proper attribution.

http://sadistech.com http://spike.grobste.in https://github.com/spikegrobstein

iptools-1's People

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.