ipcalc
Calculate IP network information
TLDR
SYNOPSIS
ipcalc [options] address [netmask]
DESCRIPTION
ipcalc calculates IP network information. It shows network address, broadcast address, host range, and other details from an IP address and netmask or CIDR notation.The tool is essential for network planning, subnetting, and troubleshooting IP configuration issues.
PARAMETERS
address
IP address with optional CIDR.netmask
Subnet mask (if not CIDR).-b, --broadcast
Show broadcast address.-n, --network
Show network address.-h, --hostname
Show hostname.-s size...
Split into subnets of size.-c, --check
Validate address.--class
Show address class (A, B, C, D, or E).--minaddr
Show minimum host address.--maxaddr
Show maximum host address.-4, -6
Force IPv4/IPv6.-r, --random-private
Generate a random private address for given prefix length.--no-decorate
Print output without decoration (suitable for scripting).
CAVEATS
Two distinct implementations exist: the Red Hat version (ipcalc from initscripts) and the newer ipcalc by Nikos Mavrogiannopoulos. They have different options and features. The `-s` subnet splitting and `-c` check options are only available in certain versions. IPv6 support is available in the newer implementation only.
HISTORY
ipcalc has multiple implementations. The original was part of the Red Hat initscripts package. A newer, more feature-rich version was written by Nikos Mavrogiannopoulos with IPv6 support and additional calculation features.
