en cz  
2014-08-01

Version 1.2 released.

2013-11-07

Version 1.1 released.

2004-12-02

Version 1.0 released.

RSS
Ipinfo is a simple tool for calculation of IP networks - broadcast address, wildacrd address or count of usable IP addresses in a network, all of it based just on the knowledge of an IP address and network mask (or prefix length). The program is written in C programming language primarily on the Linux platform, however it should be possible to run it on other platforms too.

As a product part of the package there is a program ipmatch, which can simple tell if given IP address belongs to a given subnet (or if it is a network or a broadcast address).

Version 1.0 can be distributed and modified freely under the terms of GPL license, however version 1.1 and higher are distributed under the terms of this license:

Licence Beerware, revize 42:
As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return.

Installation is simple, just unpack the downloaded file, enter the newly created directory, compile and install the program. If compilation or installation fails, check definition values in Makefile:

$ tar xzf ipinfo-x.y.tar.gz
$ cd ipinfo-x.y
$ make
# make install

You need to have these programs installed before you compile ipinfo:

  • make
  • gcc
  • install

The program will be installed into directory /usr/local/bin (you have to have root superuser permission for that probably). If you want to change this directory, change definition of BINDIR in Makefile. A manual page containing execution instruction will be installed too (see MANDIR in Makefile).

ipinfo

The program can be run with a few parameters:

ipinfo [parameters] ip [mask]

List of parameters:

Parameter Function
-a, --all Display everything (default behavior)
-i, --ip Display given IP address
-d, --decimal Display decimal value of given IP address
-c, --class Display class information
-m, --netmask Display network mask
-p, --prefix Display network prefix length
-n, --network Display network address
-w, --wildcard Display wildcard address
-b, --broadcast Display boradcast address
-t, --ipcount Display count af all IP addresses in network
-H, --hostcount Display count of host IP addresses in network
-I, --hostmin Display first usable IP address of a host in network
-A, --hostmax Display last usable IP address of a host
-l, --legend Force display legend (usable only if output has 1 line)
-h, --help, --usage Display help

Ip address can be specified in one of these formats:
(a.b.c.d is IP address, e.f.g.h is network mask, pp is prefix length)

  • a.b.c.d/pp
  • a.b.c.d pp
  • a.b.c.d/e.f.g.h
  • a.b.c.d e.f.g.h
  • a.b.c.d

ipmatch

The program can be run with a few parameters:

ipmatch [-r|-n|-h|-b] ip network/netmask

List of parameters:

Parameter Function
-r, --range Check if IP address is in given range (default)
-n, --network Check if IP address is network address
-h, --host Check if IP address is a host address
-b, --broadcast Check if IP address is broadcast address
-t, --text Print text output (IN/OUT) - default: no output
--help, --usage Display help

Network and netmask can be specified in one of these formats:

  • a.b.c.d/prefix (prefix is set instead of netmask)
  • a.b.c.d prefix
  • a.b.c.d/e.f.g.h (full netmask)
  • a.b.c.d e.f.g.h
  • a.b.c.d (netmask will be determined automatically)

Return values:

0 - IP was checked as being in range
1 - syntax or usage error
2 - IP was checked as being out of range

Select version:

Version:
Date:
Size:
MD5:
Direct link:

ipinfo

Enter IP address
IP address with netmask or prefix length, i. e. 192.168.0.0/24

ipmatch

IP adress: network/netmask:
Enter network address with netmask or prefix length, i.e. 192.168.0.0/255.255.255.0 or 192.168.0.0/24

There are no known bugs at this moment. If you have discover any unexpected behavior of this software, please let me know at mccohy@kyberdigi.cz.

1. 8. 2014

Probably becouse of a typo and missing checks the program was throwing an error in case of useing netmask with the end value set to 128 or 224. This was repaired in version 1.2, if you have any lower version, perform an upgrade.