LinuxCommandLibrary

ipcalc

calculates IP network information

TLDR

Calculate network info

$ ipcalc [192.168.1.0/24]
copy
Show with netmask
$ ipcalc [192.168.1.0] [255.255.255.0]
copy
Split network into subnets
$ ipcalc [192.168.0.0/16] -s [256] [256] [256]
copy
Check if IP is in network
$ ipcalc -c [192.168.1.100] [192.168.1.0/24]
copy
Show binary representation
$ ipcalc -b [192.168.1.0/24]
copy

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.
--minaddr
Show minimum host address.
--maxaddr
Show maximum host address.
-4, -6
Force IPv4/IPv6.

OUTPUT EXAMPLE

$ Address:   192.168.1.0
Netmask:   255.255.255.0 = 24
Wildcard:  0.0.0.255
Network:   192.168.1.0/24
HostMin:   192.168.1.1
HostMax:   192.168.1.254
Broadcast: 192.168.1.255
Hosts:     254
copy

CAVEATS

Different versions exist with varying features. Some features may not be available. IPv6 support varies by implementation.

SEE ALSO

sipcalc(1), ip(8), ifconfig(8)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community