http://linux-ip.net/html/tools-ipcalc.html
There are a number of different utilities called ipcalc, almost all of which perform the same basic task. These are handy calculators for converting from CIDR to traditional IP notation and determining network and broadcast addresses.
Doubtless, there are a large number of other IP calculators available to ease the job of the network administrator. The above tools are meant as a brief summary of some of the offerings.
NAME ipcalc - An IP Netmask/broadcast/etc calculator
SYNTAX ipcalc [-n|-h|-v|-help] <ADDRESS>[[/]<NETMASK>] [NETMASK]
DESCRIPTION ipcalc takes an IP address and netmask and calculates the resulting broadcast, network, Cisco wildcard mask, and host range. By giving a second netmask, you can design sub- and supernetworks. It is also intended to be a teaching tool and presents the results as easy-to- understand binary values.
-n Don't display ANSI color codes
-b Suppress the bitwise output
-c Just print bit-count-mask of given address
EXAMPLES ipcalc 192.168.0.1/24
ipcalc 192.168.0.1/255.255.128.0
ipcalc 192.168.0.1 255.255.128.0 255.255.192.0
ipcalc 192.168.0.1 0.0.63.255
AUTHOR Written by Krischan Jodies <krischan@jodies.de>
SEE ALSO ipsc(1) gipsc(1)
The ipcalc website: http://jodies.de/ipcalc
$ ipcalc -n -b 192.168.0.1/24 Address: 192.168.0.1 Netmask: 255.255.255.0 = 24 Wildcard: 0.0.0.255 => Network: 192.168.0.0/24 HostMin: 192.168.0.1 HostMax: 192.168.0.254 Broadcast: 192.168.0.255 Hosts/Net: 254 Class C, Private Internet
usage: ipsc [options] <addr/mask | addr/offset | addr> -C <class> Network class (a, b, or c). Must be used with -B -B <bits> Subnet bits (must be used with -C) -i <if> Reverse engineer an interface (e.g. eth0) -a Print all information available -g Print general information -s Print all possible subnets -h Print host information -c Print CIDR information
$ ipsc -i eth0 Network class: C Network mask: 255.255.255.0 Network mask (hex): FFFFFF00 Network address: 192.168.15.0 Subnet bits: 0 Max subnets: 1 Full subnet mask: 255.255.255.0 Full subnet mask (hex): FFFFFF00 Host bits: 8 Addresses per subnet: 256 Bit map: nnnnnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh
http://linuxcommand.org/man_pages/ipcalc1.html
SYNOPSIS
ipcalc [OPTION]... <IP address>[/prefix] [netmask]
DESCRIPTION
ipcalc provides a simple way to calculate IP information for a host. The various options specify what information ipcalc should display on standard out. Multiple options may be specified. An IP address to operate on must always be specified. Most operations also require a netmask or a CIDR prefix as well.
OPTIONS
-b, --broadcast Display the broadcast address for the given IP address and netmask.
-h, --hostname Display the hostname for the given IP address.
-m, --netmask Calculate the netmask for the given IP address. It assumes that the IP address is in a complete class A, B, or C network. Many networks do not use the default net- masks, in which case an inappropriate value will be returned.
-p, --prefix Show the prefix for the given mask/IP address.
-n, --network Display the network address for the given IP address and netmask.
-s, --silent Don't ever display error messages.
AUTHORS
Erik Troan <ewt@redhat.com>
documented on: 2005.02.16