There is indeed: ipcalc. This is a standard program available for any Linux. This command shows you everything you need to know for a single network:
$ ipcalc 192.168.10.0/24
Address: 192.168.10.0 11000000.10101000.00001010. 00000000 Netmask: 255.255.255.0 = 24 11111111.11111111.11111111. 00000000 Wildcard: 0.0.0.255 00000000.00000000.00000000. 11111111 => Network: 192.168.10.0/24 11000000.10101000.00001010. 00000000 HostMin: 192.168.10.1 11000000.10101000.00001010. 00000001 HostMax: 192.168.10.254 11000000.10101000.00001010. 11111110 Broadcast: 192.168.10.255 11000000.10101000.00001010. 11111111 Hosts/Net: 254 Class C, Private Internet
So, here you see the old-fashioned dotted-quad notation, the newfangled CIDR notation, the available host address range, the number of hosts you can have on this network, and the binary addresses. ipcalc shows the network portion of the address, which is 192.168.10, and the host portion, which is 1–254. And it's a nice visual aid for understanding netmasks.
On Fedora, ipcalc is very different, and not nearly as helpful as the real ipcalc. You can install the real ipcalc from source, which you can download from http://freshmeat.net/projects/ipcalc/, or try whatmask. whatmask is similar to ipcalc, and it is in the Fedora repositories, so you can install it with
yum install whatmask.
You need to specify the netmaskif it's not /24 (or 255.255.255.0). The more common CIDR netmasks are:
Or, their dotted-quad equivalents:
Use netmasks to differentiate the network part of the address and the host address part. These are the private IPv4 private address ranges:
The first one, 10.0.0.0–10.255.255.255, gives you the most possible addresses. If you use the first quad for the network address, and the last three for host addresses, you'll have 16,777,214 addresses to play with, all in one giant network, which you can see for yourself:
$ ipcalc 10.0.0.0/8
Address: 10.0.0.0 00001010. 00000000.00000000.00000000 Netmask: 255.0.0.0 = 8 11111111. 00000000.00000000.00000000 Wildcard: 0.255.255.255 00000000. 11111111.11111111.11111111 => Network: 10.0.0.0/8 00001010. 00000000.00000000.00000000 HostMin: 10.0.0.1 00001010. 00000000.00000000.00000001 HostMax: 10.255.255.254 00001010. 11111111.11111111.11111110 Broadcast: 10.255.255.255 00001010. 11111111.11111111.11111111 Hosts/Net: 16777214 Class A, Private Internet
A 16,777,214-host network all in one subnet probably isn't what you want, so you can whittle it down into smaller subnets. This example show three subnets that use the first two quads (in bold) for the network portion of the address:
$ ipcalc 10.1.0.0/16
$ ipcalc 10.2.0.0/16
$ ipcalc 10.3.0.0/16
You could number these all the way up to 10.255.0.0/16. You can make even smaller subnets with a bigger netmask:
$ ipcalc 10.1.1.0/24
$ ipcalc 10.1.2.0/24
$ ipcalc 10.1.3.0/24
All the way up to 10.255.255.0/16.
The host address portions number from 1–254. Remember, the broadcast address is always the highest in the subnet.
ipcalc has one more excellent trick: calculating multiple subnets with one command. Suppose you want to divide a 10.150.0.0 network into three subnets for 100 total hosts. Just tell ipcalc your netmask, and how many hosts you want in each segment:
$ ipcalc 10.150.0.0/16 --s 25 25 50
ipcalc then spells it all out for you, and even shows your unused address ranges.
ipcalc has a few simple options, which you can see by running:
$ ipcalc --help
Classless Inter-Domain Routing (CIDR) notation is compact, and lets you slice and dice your networks finely, all the way down to a single host, which is /32. It is supposed to replace the old dotted-quad netmask notation, but you'll find you need to know both because there are applications that still don't support CIDR.
Learn more about this topic from Linux Networking Cookbook.
If you want a book that lays out the steps for specific Linux networking tasks, one that clearly explains the commands and configurations, this is the book for you. Linux Networking Cookbook is a soup-to-nuts collection of recipes that covers everything you need to know to perform your job as a Linux network administrator. You'll dive straight into the gnarly hands-on work of building and maintaining a computer network.