$ sudo yum install ipcalc
mac에서도 설치 가능하다.
Usage: ipcalc [OPTION...]
-c, --check Validate IP address for specified address family
-4, --ipv4 IPv4 address family (default)
-6, --ipv6 IPv6 address family
-b, --broadcast Display calculated broadcast address
-h, --hostname Show hostname determined via DNS
-m, --netmask Display default netmask for IP (class A, B, or C)
-n, --network Display network address
-p, --prefix Display network prefix
-s, --silent Don't ever display error messages
$ ipcalc -b 192.168.0.88/24
BROADCAST=192.168.0.255
$ ipcalc -b 192.168.0.88/25
BROADCAST=192.168.0.127
$ ipcalc -c 192.168.1.99
$ ipcalc -c 192.168.1.9999999999
ipcalc: bad IPv4 address: 192.168.1.9999999999
$ ipcalc -n 192.168.1.99/24
NETWORK=192.168.1.0
$ ipcalc -n 192.168.1.99/25
NETWORK=192.168.1.0
$ ipcalc -n 192.168.1.99/1
NETWORK=128.0.0.0