LinuxCommandLibrary

cidr

IP subnet and CIDR notation calculator

TLDR

Calculate subnet info

$ ipcalc [192.168.1.0/24]
copy
Show network range
$ sipcalc [10.0.0.0/8]
copy
Calculate with netmask
$ ipcalc [192.168.1.0] [255.255.255.0]
copy
Design subnets
$ ipcalc [192.168.1.0/24] [/27]
copy

SYNOPSIS

ipcalc [options] address[/prefix] [netmask]
sipcalc [options] address[/prefix]

DESCRIPTION

CIDR calculators compute network information from IP addresses and subnet masks. Common tools include ipcalc, sipcalc, and whatmask. They calculate network and broadcast addresses, usable host ranges, wildcard masks, and other subnet parameters.
These utilities are essential for network planning, subnetting, and troubleshooting. Given an IP address and prefix length (or netmask), they break down all relevant addressing details. Some tools also support IPv6, subnet splitting, and supernetting.
Available on most Linux distributions via package managers. For visual CIDR notation exploration, online tools like cidr.xyz provide interactive visualizations.

IPCALC OPTIONS

-n

Don't show hostname
-b
Don't show broadcast
-s hosts
Split network for hosts
-r hosts
Calculate needed prefix

SIPCALC OPTIONS

-a

All information
-d
Resolve hostnames
-4
IPv4 only
-6
IPv6 only

OUTPUT FIELDS

Network

First address in subnet
Broadcast
Last address in subnet
HostMin/HostMax
Usable address range
Hosts/Net
Number of usable addresses
Wildcard
Cisco wildcard mask

INSTALLATION

$ apt install ipcalc sipcalc
copy

CAVEATS

Use for network planning and troubleshooting. Online tools available at cidr.xyz for visualization.

SEE ALSO

ip(8), ifconfig(8), netmask(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community