Introduction to Subnet Masks and IP Addressing in IPv4
In network management, understanding subnet masks and IP addressing is essential. Subnet masks help distinguish the network part from the host part of an IP address, enabling efficient division and administration of IP space. Below you’ll find an overview of important subnet masks in CIDR notation and their use in IPv4 networks, as well as a brief guide on using the ipcalc tool under Linux for subnet calculations.
Important Subnet Masks and Their Meanings
CIDR | Decimal Subnet Mask | Theoretical Subnets | Available Hosts per Subnet |
---|---|---|---|
/32 | 255.255.255.255 | Single host | 1 |
/31 | 255.255.255.254 | Point-to-Point links | 2 (No broadcast) |
/30 | 255.255.255.252 | 1/4 of a /24 | 2 |
/29 | 255.255.255.248 | 1/8 of a /24 | 6 |
/28 | 255.255.255.240 | 1/16 of a /24 | 14 |
/27 | 255.255.255.224 | 1/32 of a /24 | 30 |
/26 | 255.255.255.192 | 1/64 of a /24 | 62 |
/25 | 255.255.255.128 | 1/128 of a /24 | 126 |
/24 | 255.255.255.0 | Base subnet | 254 |
/23 | 255.255.254.0 | 2x /24 subnets | 510 |
/22 | 255.255.252.0 | 4x /24 subnets | 1,022 |
/21 | 255.255.248.0 | 8x /24 subnets | 2,046 |
/20 | 255.255.240.0 | 16x /24 subnets | 4,094 |
/19 | 255.255.224.0 | 32x /24 subnets | 8,190 |
/18 | 255.255.192.0 | 64x /24 subnets | 16,382 |
/17 | 255.255.128.0 | 128x /24 subnets | 32,766 |
/16 | 255.255.0.0 | Standard Class B network | 65,534 |
Subnet Calculation with ipcalc
Installation
On most Linux distributions, ipcalc can be installed using the package manager. For example:
sudo apt-get install ipcalc – for Debian/Ubuntu
sudo yum install ipcalc – for Fedora/RHEL
Usage
To use ipcalc, simply enter an IP address and subnet mask (in CIDR notation) on the command line. For example:
ipcalc 192.168.1.0/24
This command gives you a summary of the subnet, including the network address, broadcast address, number of available hosts, and other useful information.
Conclusion
Understanding subnet masks and the ability to segment networks efficiently are essential skills for network administrators. Tools like ipcalc significantly simplify planning and managing IPv4 networks. For further information or specific use cases, we recommend exploring the topic in greater depth and consulting comprehensive resources on the subject.