LFCA 40 🐧 Subnets and CIDR Explained
An IP address is not a single number. It is two: the network the device is on, and the interface’s identity within that network. The split between the two is the subnet, and the way the split is expressed is the CIDR prefix. The subnet determines which destinations are local and which are remote, which traffic is delivered directly and which is sent to the gateway, and how many interfaces can share the network. The /24 in 192.168.1.100/24 is not a detail; it is the single most consequential number in a network configuration. Getting it right makes the network work; getting it wrong makes the devices unable to reach the destinations they should, or reaching the wrong ones. This chapter covers the subnet model: how the mask splits the address, how CIDR replaced the class system, how to compute the network and broadcast addresses, how to count the usable hosts, how to divide a network into smaller subnets, and the tools that do the arithmetic. It builds on the previous chapter’s IP address material and prepares the ground for routing and firewalls.
Key point: A subnet is a range of IP addresses defined by a network address and a prefix length. The prefix length, written in CIDR notation as /N, says how many of the address’s leading bits are the network part; the remaining bits are the host part. The network address has all the host bits set to 0, and the broadcast address has all the host bits set to 1. The number of addresses in the subnet is 2^(32−N) for IPv4, and the number of usable hosts is two fewer because the network and broadcast addresses are reserved. A subnet mask is the same information written as a dotted-decimal value (255.255.255.0 for /24). The ipcalc and sipcalc tools compute the values, and the ip route output shows the subnets the device can reach.
Why subnets exist
A network can have millions of devices, and a router cannot know every device’s address. Instead, the router knows the networks — the ranges of addresses — and forwards the traffic toward the network that contains the destination. The subnet is that range, and it is the unit of routing.
The routing table. A router’s table maps the network prefixes to the interfaces or the next hops. A packet’s destination address is matched against the prefixes, and the longest matching prefix wins. The 192.168.1.0/24 prefix matches the addresses 192.168.1.0 through 192.168.1.255, and the packet with one of those addresses is forwarded to the interface that connects to that subnet.
Why the network part is the routing unit. The routers do not track the individual hosts; they track the networks. A router with a route to 192.168.1.0/24 knows how to reach every host in that subnet. The aggregation is what makes the internet’s routing table manageable — the millions of addresses are summarized into the thousands of prefixes.
Why the host part is the interface’s identity. Within a subnet, the hosts find each other through the ARP (IPv4) or the NDP (IPv6) protocol, which maps the addresses to the MAC addresses. The host part of the address distinguishes one interface from another on the same subnet. The two interfaces on the same subnet have the same network part and different host parts.
Why the split matters for the device. When a device sends a packet, it compares the destination’s address with its own subnet. If the destination is in the same subnet, the packet is delivered directly (via ARP). If the destination is outside, the packet is sent to the gateway (the router). The comparison is the subnet’s purpose, and the split is the input.
Why the wrong prefix breaks the network. A device with the wrong prefix classifies the destinations incorrectly. A destination that is local but classified as remote is sent to the gateway, which may not route it back. A destination that is remote but classified as local is sent to the local network, where no host answers. Both produce the “works for some destinations, not others” symptom, and the prefix is the cause.
Why the subnet is a design choice. The network’s size, the number of the hosts, and the growth’s plan determine the prefix. A /24 holds 254 hosts, which is right for a home or a small office. A /22 holds 1022 hosts, which is right for a larger site. The choice is the design, and the prefix is the expression.
Why the prefix is the first thing to check in a network problem. A device that can reach some destinations but not others, or that can reach the local network but not the internet, often has the wrong prefix. The check is the first step, and the
ip addrandip routecommands show the current values.
The subnet mask and the CIDR prefix
The subnet mask and the CIDR prefix are two notations for the same information. The mask is the 32-bit value with the network bits set to 1, and the prefix is the count of those bits.
The mask as a 32-bit value. For the /24 prefix, the mask is 255.255.255.0, which is 11111111.11111111.11111111.00000000 in binary. The first 24 bits are 1, and the last 8 are 0.
The prefix as the count. The /24 says the first 24 bits are the network part. The two notations are the same, and the CIDR form is the modern one.
| CIDR | Mask | Binary (last octet) |
|---|---|---|
/8 | 255.0.0.0 | 00000000 |
/16 | 255.255.0.0 | 00000000 |
/24 | 255.255.255.0 | 00000000 |
/25 | 255.255.255.128 | 10000000 |
/26 | 255.255.255.192 | 11000000 |
/27 | 255.255.255.224 | 11100000 |
/28 | 255.255.255.240 | 11110000 |
/29 | 255.255.255.248 | 11111000 |
/30 | 255.255.255.252 | 11111100 |
Why the mask is contiguous. The 1 bits are always the leading bits, and the 0 bits are always the trailing bits. The mask is a prefix, and the prefix is the count. A mask with a 0 in the middle and a 1 after would be ambiguous, and it is not allowed.
Why the non-octet masks exist. A /25 divides a /24 into two halves, and the mask’s last octet is 128. A /26 divides it into four quarters, and the mask is 192. The non-octet masks are the subnets smaller than the octet boundaries, and they are the common case in the modern networks.
Why the CIDR replaced the class system. The class system had only three usable sizes — the class A (/8), the class B (/16), and the class C (/24). A network with 500 hosts could use a class B (65,534 addresses) and waste the rest, or use two class C networks and route between them. The CIDR allows any prefix, so the 500-host network can be a /23 (510 addresses) and use the space efficiently.
Why the prefix is written with the address. The 192.168.1.100/24 is the address and the prefix together, which is the interface’s full specification. The ip addr command shows this form, and the /24 is the important part.
Why the mask can be written in both forms. The ip addr shows the CIDR, the ifconfig shows the mask, and the ipcalc accepts both. The two are the same, and the conversion is the arithmetic.
Computing the network and broadcast addresses
The network address is the address with all the host bits set to 0, and the broadcast address is the address with all the host bits set to 1. The two are computed from the address and the prefix.
The computation. The address and the mask are compared bit by bit. The network bits are kept, and the host bits are set to 0 for the network and to 1 for the broadcast.
Address: 192.168.1.100 = 11000000.10101000.00000001.01100100
Mask: 255.255.255.0 = 11111111.11111111.11111111.00000000
└──────── network ────────┘└─ host ─┘
Network: 192.168.1.0 = 11000000.10101000.00000001.00000000
Broadcast:192.168.1.255 = 11000000.10101000.00000001.11111111
The network is 192.168.1.0, and the broadcast is 192.168.1.255. The host part is 0 for the network and 255 for the broadcast.
Why the network address is not assignable. The network address represents the subnet itself, not a host. It is used in the routing tables, and it cannot be assigned to an interface.
Why the broadcast address is not assignable. The broadcast address is the address for the all-hosts on the subnet. A packet sent to it is delivered to every host on the subnet. It cannot be assigned to an interface because the interface would receive the broadcast and the directed traffic as the same.
The usable host range. The usable addresses are the network plus one to the broadcast minus one. For 192.168.1.0/24, the usable range is 192.168.1.1 to 192.168.1.254.
The first and the last usable. The first usable is the network address plus one, and the last usable is the broadcast address minus one. The two are the common host addresses for the gateway and the servers.
Why the network and the broadcast are the two reserved. The two are the two extremes of the host range, and the two are the subnet’s own addresses. The reservation is the model, and the usable count is the total minus two.
The subnet with two addresses. The /31 has two addresses, and both are usable in the point-to-point links (RFC 3021). The /32 has one address, which is a single host route. The two are the special cases, and the general rule is the total minus two.
Why the computation matters. The network and the broadcast are what the device and the router use to classify the traffic. The network address is the route’s destination, and the broadcast is the destination for the all-hosts packets. The two are the subnet’s identity, and the computation is the arithmetic.
The number of the usable hosts
The number of the usable hosts is the total addresses minus two. The total is 2^(32−N) for the IPv4, where N is the prefix length.
The formula. The host bits are 32 − N, and the addresses are 2^(32−N). The usable hosts are 2^(32−N) − 2.
The table.
| CIDR | Host bits | Total addresses | Usable hosts |
|---|---|---|---|
/8 | 24 | 16,777,216 | 16,777,214 |
/16 | 16 | 65,536 | 65,534 |
/22 | 10 | 1,024 | 1,022 |
/23 | 9 | 512 | 510 |
/24 | 8 | 256 | 254 |
/25 | 7 | 128 | 126 |
/26 | 6 | 64 | 62 |
/27 | 5 | 32 | 30 |
/28 | 4 | 16 | 14 |
/29 | 3 | 8 | 6 |
/30 | 2 | 4 | 2 |
/31 | 1 | 2 | 2 (point-to-point) |
/32 | 0 | 1 | 1 (host route) |
Why the doubling and halving. Each bit removed from the prefix doubles the number of the addresses. The /24 has 256, the /23 has 512, and the /22 has 1024. The pattern is the binary, and the table is the memory.
Why the smaller subnets are the point-to-point. The /30 has four addresses and two usable, which is the right size for a link between two routers. The /31 has two addresses and both usable (RFC 3021), which is the modern point-to-point. The /32 is a single host route, which is used for the host-specific routes.
Why the larger subnets are the LANs. The /24 and the /23 are the common LAN sizes. The /24 has 254 hosts, and the /23 has 510. The choice is the site’s size, and the prefix is the expression.
Why the waste matters. A network with 10 hosts on a /24 wastes 244 addresses. A network with 10 hosts on a /28 wastes 4 addresses. The CIDR allows the right-sized subnet, and the waste is the cost of the choice.
Why the subnetting is the division. A large network is divided into the smaller subnets, and each subnet is a prefix. The /16 is divided into 256 /24s, or into 64 /22s. The division is the subnetting, and the prefix is the piece.
Why the supernetting is the aggregation. The smaller networks are summarized into a larger prefix. The four /24s 192.168.0.0/24, 192.168.1.0/24, 192.168.2.0/24, and 192.168.3.0/24 are summarized into the 192.168.0.0/22. The aggregation is the supernetting, and the prefix is the summary.
Why the table should be memorized. The table is the arithmetic, and the fluency is the speed. The
/24is the most common, the/30is the point-to-point, and the powers of two are the pattern. The memorization is the skill, and theipcalcis the check.
Subnetting a network
Subnetting is the division of a network into the smaller subnets. It is done by extending the prefix — using more bits for the network and fewer for the host.
The division of a /24 into two /25s. The /24 is 192.168.1.0/24, which is 256 addresses. The /25 uses 25 bits for the network, which leaves 7 bits for the host, which is 128 addresses. The two /25s are 192.168.1.0/25 and 192.168.1.128/25.
192.168.1.0/25 192.168.1.0 – 192.168.1.127
192.168.1.128/25 192.168.1.128 – 192.168.1.255
Each has 128 addresses and 126 usable hosts.
The division of a /24 into four /26s. The /26 uses 26 bits for the network, which leaves 6 bits for the host, which is 64 addresses.
192.168.1.0/26 192.168.1.0 – 192.168.1.63
192.168.1.64/26 192.168.1.64 – 192.168.1.127
192.168.1.128/26 192.168.1.128 – 192.168.1.191
192.168.1.192/26 192.168.1.192 – 192.168.1.255
Each has 64 addresses and 62 usable hosts.
Why the boundaries are at the multiples of the block size. The block size is 2^(32−N), and the subnets start at the multiples of the block. The /26 has the block size 64, and the subnets start at 0, 64, 128, and 192. The alignment is the requirement, and the misaligned subnets are the error.
Why the subnets must not overlap. The two subnets with the overlapping ranges create the ambiguity — the same address belongs to the two subnets. The overlap is the error, and the alignment is the prevention.
Why the subnetting is useful. The division allows the separate the departments, the separate the security zones, and the separate the functional areas. Each subnet has its own broadcast domain, its own routing entry, and its own policy. The division is the organization, and the prefix is the piece.
The subnetting of a /16 into the /24s. The /16 has 65,536 addresses, and the /24 has 256. The division produces 256 /24s, from 192.168.0.0/24 to 192.168.255.0/24. The list is the subnetting, and the pattern is the arithmetic.
Why the subnetting can be hierarchical. A /16 can be divided into the /20s, and each /20 can be divided into the /24s. The hierarchy is the organization, and the summary is the aggregation. The two are the design, and the prefixes are the pieces.
Why the subnetting should be planned. The plan determines the growth, the routing, and the policies. An unplanned subnetting produces the overlap, the waste, and the routing complexity. The plan is the design, and the execution is the commands.
The tools
The subnet arithmetic is the binary, and the tools are the checks. The ipcalc is the common tool, and the sipcalc is the alternative.
The ipcalc command.
ipcalc 192.168.1.100/24
# Address: 192.168.1.100 11000000.10101000.00000001. 01100100
# Netmask: 255.255.255.0 = 24 11111111.11111111.11111111. 00000000
# Wildcard: 0.0.0.255 00000000.00000000.00000000. 11111111
# =>
# Network: 192.168.1.0/24 11000000.10101000.00000001. 00000000
# HostMin: 192.168.1.1 11000000.10101000.00000001. 00000001
# HostMax: 192.168.1.254 11000000.10101000.00000001. 11111110
# Broadcast: 192.168.1.255 11000000.10101000.00000001. 11111111
# Hosts/Net: 254 Class C, Private Internet
The output shows the address, the mask, the wildcard, the network, the host range, the broadcast, and the host count. The binary is the arithmetic, and the summary is the check.
The ipcalc with the -n option. The -n shows the network only, and the -b shows the broadcast only. The options are the filter.
ipcalc -n 192.168.1.100/24
ipcalc -b 192.168.1.100/24
The sipcalc command. The sipcalc is the alternative with more options.
sipcalc 192.168.1.100/24
The ip route output. The route table shows the subnets the device can reach.
ip route
# default via 192.168.1.1 dev eth0
# 192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.100
The 192.168.1.0/24 is the local subnet, and the default is the gateway. The two are the essential routing.
The ip addr output. The address output shows the interface’s address and prefix.
ip addr show eth0
# inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic eth0
The 192.168.1.100/24 is the address and the prefix, and the brd 192.168.1.255 is the broadcast.
Why the tools are the check. The arithmetic is the binary, and the tools are the verification. The manual computation is the skill, and the tools are the speed. The two are the pair, and the check is the confidence.
Why the tools should be used in the design. The subnetting plan is the design, and the tools verify the plan. The ipcalc shows the network, the broadcast, and the host count, and the plan is the check. The design without the check is the risk.
Why the ipcalc is not always installed. The ipcalc is a separate package on some distributions, and the sipcalc is the alternative. The manual computation is the fallback, and the binary is the arithmetic. The tools are the convenience, and the skill is the foundation.
Complete Example Session
# ============================================
# PART 1: THE BASIC SUBNET
# ============================================
ipcalc 192.168.1.100/24
# Network: 192.168.1.0/24
# HostMin: 192.168.1.1
# HostMax: 192.168.1.254
# Broadcast: 192.168.1.255
# Hosts/Net: 254
# ============================================
# PART 2: THE /25 SUBNET
# ============================================
ipcalc 192.168.1.100/25
# Network: 192.168.1.0/25
# HostMin: 192.168.1.1
# HostMax: 192.168.1.126
# Broadcast: 192.168.1.127
# Hosts/Net: 126
# ============================================
# PART 3: THE /26 SUBNET
# ============================================
ipcalc 192.168.1.100/26
# Network: 192.168.1.64/26
# HostMin: 192.168.1.65
# HostMax: 192.168.1.126
# Broadcast: 192.168.1.127
# Hosts/Net: 62
# ============================================
# PART 4: THE /30 POINT-TO-POINT
# ============================================
ipcalc 10.0.0.1/30
# Network: 10.0.0.0/30
# HostMin: 10.0.0.1
# HostMax: 10.0.0.2
# Broadcast: 10.0.0.3
# Hosts/Net: 2
# ============================================
# PART 5: THE SUBNETTING TABLE
# ============================================
# /24 → 256 addresses, 254 hosts
# /25 → 128 addresses, 126 hosts
# /26 → 64 addresses, 62 hosts
# /27 → 32 addresses, 30 hosts
# /28 → 16 addresses, 14 hosts
# /29 → 8 addresses, 6 hosts
# /30 → 4 addresses, 2 hosts
# ============================================
# PART 6: THE SPLIT OF A /24
# ============================================
# Two /25:
# 192.168.1.0/25 → 0 – 127
# 192.168.1.128/25 → 128 – 255
#
# Four /26:
# 192.168.1.0/26 → 0 – 63
# 192.168.1.64/26 → 64 – 127
# 192.168.1.128/26 → 128 – 191
# 192.168.1.192/26 → 192 – 255
# ============================================
# PART 7: THE ROUTES
# ============================================
ip route
# default via 192.168.1.1 dev eth0
# 192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.100
# ============================================
# PART 8: THE ADDRESS
# ============================================
ip addr show eth0
# inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic eth0
# ============================================
# PART 9: THE WRONG PREFIX
# ============================================
# The device with 192.168.1.100/24
# The destination 192.168.1.50 is in the same subnet → direct (ARP)
# The destination 192.168.2.50 is outside → gateway
#
# The device with 192.168.1.100/16 (wrong)
# The destination 192.168.2.50 is classified as in the same subnet
# → the packet is sent to the local network
# → no host answers, the packet is dropped
#
# The symptom: some destinations work, others do not.
# ============================================
# PART 10: THE MANUAL COMPUTATION
# ============================================
# Address: 192.168.1.100
# Prefix: /26
#
# The last octet: 100 = 01100100
# The host bits: 6 (32 - 26)
# The network bits in the last octet: 2
#
# The block size: 2^6 = 64
# The network: 100 & 11000000 = 64
# The broadcast: 64 + 63 = 127
#
# The network: 192.168.1.64/26
# The broadcast: 192.168.1.127
# The hosts: 192.168.1.65 – 192.168.1.126
# ============================================
# PART 11: WHAT NOT TO DO
# ============================================
# Don't assume the /24 is the only prefix
# The /25, /26, and /30 are common.
# Don't ignore the network and broadcast addresses
# They are not assignable.
# Don't misalign the subnets
# The /26 subnets start at the multiples of 64.
# Don't overlap the subnets
# The overlap is the ambiguity.
# Don't skip the plan
# The unplanned subnetting produces the waste and the complexity.
# Don't compute by hand without checking
# The ipcalc is the verification.
The eleven parts cover the basic subnet, the /25, the /26, the /30, the table, the split, the routes, the address, the wrong prefix, the manual computation, and the anti-patterns.
Quick Reference
The Prefix Table
| CIDR | Mask | Total | Usable |
|---|---|---|---|
/8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
/16 | 255.255.0.0 | 65,536 | 65,534 |
/22 | 255.255.252.0 | 1,024 | 1,022 |
/23 | 255.255.254.0 | 512 | 510 |
/24 | 255.255.255.0 | 256 | 254 |
/25 | 255.255.255.128 | 128 | 126 |
/26 | 255.255.255.192 | 64 | 62 |
/27 | 255.255.255.224 | 32 | 30 |
/28 | 255.255.255.240 | 16 | 14 |
/29 | 255.255.255.248 | 8 | 6 |
/30 | 255.255.255.252 | 4 | 2 |
/31 | 255.255.255.254 | 2 | 2 (P2P) |
/32 | 255.255.255.255 | 1 | 1 |
The Formula
| Value | Formula |
|---|---|
| Host bits | 32 − N |
| Total addresses | 2^(32−N) |
| Usable hosts | 2^(32−N) − 2 |
| Block size | 2^(32−N) |
| Network | address AND mask |
| Broadcast | network OR wildcard |
The Special Prefixes
| CIDR | Use |
|---|---|
/30 | Point-to-point (2 hosts) |
/31 | Point-to-point (RFC 3021) |
/32 | Host route (1 address) |
/24 | Common LAN |
/16 | Large network |
The Tools
| Command | Purpose |
|---|---|
ipcalc <addr>/<N> | The full computation |
ipcalc -n <addr>/<N> | The network only |
ipcalc -b <addr>/<N> | The broadcast only |
ip route | The routes |
ip addr show <if> | The address and prefix |
The Subnetting
| Division | Subnets |
|---|---|
/24 → two /25 | 0, 128 |
/24 → four /26 | 0, 64, 128, 192 |
/24 → eight /27 | 0, 32, 64, 96, 128, 160, 192, 224 |
/16 → 256 /24 | 192.168.0.0 – 192.168.255.0 |
Best Practices
✅ Do This:
# Compute the subnet with ipcalc
ipcalc 192.168.1.100/24 # ✅
# Check the network and broadcast
ipcalc -n 192.168.1.100/24 # ✅
# Plan the subnetting before the configuration
# The /26 subnets start at the multiples of 64. # ✅
# Use the /30 for the point-to-point links
ipcalc 10.0.0.1/30 # ✅
# Check the routes
ip route # ✅
# Check the address and prefix
ip addr show eth0 # ✅
# Verify the manual computation with ipcalc
ipcalc 192.168.1.100/26 # ✅
❌ Don’t Do This:
# Don't assume the /24 is the only prefix
192.168.1.100/24 # the /25, /26, /30 are common # ⚠️
# Don't assign the network or broadcast addresses
192.168.1.0/24 # the network address # ⚠️
192.168.1.255/24 # the broadcast address # ⚠️
# Don't misalign the subnets
# The /26 subnets start at 0, 64, 128, 192. # ⚠️
# Don't overlap the subnets
# The overlap is the ambiguity. # ⚠️
# Don't skip the plan
# The unplanned subnetting produces the waste. # ⚠️
# Don't compute by hand without checking
# The ipcalc is the verification. # ⚠️
Common Pitfalls
| Pitfall | Problem | Solution |
|---|---|---|
| Wrong prefix | Wrong local/remote | Check with ipcalc |
| Network assigned | Not assignable | Use the host range |
| Broadcast assigned | Not assignable | Use the host range |
| Misaligned subnet | Overlap or gap | Start at the multiples |
| Overlapping subnets | Ambiguity | Plan the ranges |
/24 assumed | The smaller subnets exist | Use the right prefix |
| Hand computation error | Wrong values | Check with ipcalc |
| No plan | Waste and complexity | Plan the subnetting |
Real-World Examples
1. The basic subnet
ipcalc 192.168.1.100/24
2. The /25
ipcalc 192.168.1.100/25
3. The /26
ipcalc 192.168.1.100/26
4. The /30 point-to-point
ipcalc 10.0.0.1/30
5. The network only
ipcalc -n 192.168.1.100/24
6. The broadcast only
ipcalc -b 192.168.1.100/24
7. The routes
ip route
8. The address
ip addr show eth0
9. The split of a /24
192.168.1.0/25 → 0 – 127
192.168.1.128/25 → 128 – 255
10. The subnetting of a /16
192.168.0.0/24
192.168.1.0/24
...
192.168.255.0/24
Visual: The Subnet Split
┌──────────────────────────────────────────────────────────┐
│ 192.168.1.100/24 │
│ Network: 192.168.1.0 │
│ Hosts: 192.168.1.1 – 192.168.1.254 │
│ Broadcast: 192.168.1.255 │
│ │
├──────────────────────────────────────────────────────────┤
│ DIVIDED INTO TWO /25 │
│ │
│ 192.168.1.0/25 │
│ Network: 192.168.1.0 │
│ Hosts: 192.168.1.1 – 192.168.1.126 │
│ Broadcast: 192.168.1.127 │
│ │
│ 192.168.1.128/25 │
│ Network: 192.168.1.128 │
│ Hosts: 192.168.1.129 – 192.168.1.254 │
│ Broadcast: 192.168.1.255 │
│ │
├──────────────────────────────────────────────────────────┤
│ DIVIDED INTO FOUR /26 │
│ │
│ 192.168.1.0/26 0 – 63 │
│ 192.168.1.64/26 64 – 127 │
│ 192.168.1.128/26 128 – 191 │
│ 192.168.1.192/26 192 – 255 │
│ │
│ Each /26 has 64 addresses and 62 usable hosts. │
│ │
└──────────────────────────────────────────────────────────┘
Visual: The Mask
┌──────────────────────────────────────────────────────────┐
│ 192.168.1.100/26 │
│ │
│ Address: 11000000.10101000.00000001.01100100 │
│ Mask: 11111111.11111111.11111111.11000000 │
│ └── 26 bits ──┘ │
│ │
│ Network: 11000000.10101000.00000001.01000000 = .64 │
│ Broadcast:11000000.10101000.00000001.01111111 = .127 │
│ │
│ The host bits: the last 6 bits of the last octet. │
│ The block size: 2^6 = 64. │
│ │
└──────────────────────────────────────────────────────────┘
Visual: The Local and Remote Decision
┌──────────────────────────────────────────────────────────┐
│ The device: 192.168.1.100/24 │
│ The subnet: 192.168.1.0/24 │
│ │
│ Destination: 192.168.1.50 │
│ Same subnet? YES │
│ → ARP for the MAC, deliver directly │
│ │
│ Destination: 192.168.2.50 │
│ Same subnet? NO │
│ → Send to the gateway (192.168.1.1) │
│ │
│ Destination: 8.8.8.8 │
│ Same subnet? NO │
│ → Send to the gateway │
│ │
│ The prefix determines the decision. │
│ │
└──────────────────────────────────────────────────────────┘
Visual: The Wrong Prefix
┌──────────────────────────────────────────────────────────┐
│ CORRECT: 192.168.1.100/24 │
│ │
│ 192.168.1.50 → same subnet → direct │
│ 192.168.2.50 → different → gateway │
│ │
│ Both destinations work. │
│ │
├──────────────────────────────────────────────────────────┤
│ WRONG: 192.168.1.100/16 │
│ │
│ 192.168.1.50 → same subnet → direct │
│ 192.168.2.50 → same subnet (192.168.x.x) → direct │
│ → no host answers, packet dropped │
│ │
│ The 192.168.1.50 works, and the 192.168.2.50 fails. │
│ The symptom: some destinations work, others do not. │
│ │
└──────────────────────────────────────────────────────────┘
Visual: The Prefix and the Hosts
┌──────────────────────────────────────────────────────────┐
│ /24 → 256 addresses → 254 hosts │
│ /25 → 128 addresses → 126 hosts │
│ /26 → 64 addresses → 62 hosts │
│ /27 → 32 addresses → 30 hosts │
│ /28 → 16 addresses → 14 hosts │
│ /29 → 8 addresses → 6 hosts │
│ /30 → 4 addresses → 2 hosts (point-to-point) │
│ /31 → 2 addresses → 2 hosts (RFC 3021) │
│ /32 → 1 address → 1 host (host route) │
│ │
│ Each bit added to the prefix halves the addresses. │
│ The two reserved: network and broadcast. │
│ │
└──────────────────────────────────────────────────────────┘
Summary
| Item | Value |
|---|---|
| Subnet | A range of addresses |
| CIDR prefix | The network bit count |
| Mask | The prefix in dotted decimal |
| Network address | All host bits = 0 |
| Broadcast address | All host bits = 1 |
| Usable hosts | 2^(32−N) − 2 |
| Block size | 2^(32−N) |
| Prefix | Usable Hosts |
|---|---|
/24 | 254 |
/25 | 126 |
/26 | 62 |
/27 | 30 |
/30 | 2 |
Key takeaways:
- A subnet is a range of IP addresses defined by a network address and a prefix length — the prefix says how many bits are the network, and the rest are the host
- The CIDR prefix and the subnet mask are the same information — the
/24is255.255.255.0, and the two are the notations - The network address has all the host bits set to
0and the broadcast has them set to1— the two are reserved and cannot be assigned to a host - The usable hosts are the total minus two — the
2^(32−N) − 2formula, and the/24has 254 usable hosts - The CIDR replaced the class system — the class A, B, and C had only three sizes, and the CIDR allows any prefix
- The prefix determines the local versus the remote — the device compares the destination with its own subnet, and the result is the direct delivery or the gateway
- The wrong prefix breaks the network — the destination that is misclassified is delivered to the wrong place, and the symptom is “some destinations work, others do not”
- The subnetting is the division of a network into the smaller subnets — the
/24divides into the two/25s, the four/26s, and the eight/27s - The subnets must be aligned and must not overlap — the
/26subnets start at the multiples of 64, and the overlap is the ambiguity - The
ipcalcis the check — the manual computation is the skill, and the tool is the verification
Remember: The subnet is the range, the prefix is the size, and the split between the network and the host is the routing. The network and the broadcast are the two reserved, the usable hosts are the total minus two, and the CIDR is the modern notation. The wrong prefix is the common mistake, and the symptom is the partial connectivity. Compute with the ipcalc, plan the subnetting, and check the alignment. The subnet is the foundation, and the routing builds on it.
Stop using slow, ad-bloated tool sites! 🤮
🔎 Search “KandZ Tools” on Google to use many professional utilities for free.
KandZ.me is the ultimate minimalist hub for:
✅ Finance (Mortgage, Interest, Inflation)
✅ Tech (Base64, JSON, Dev Suite, IP)
✅ Health (BMI, BMR, TDEE)
✅ Productivity (Timer, Workspace, QR)
⚡️ Fast & Private
🔒 No data leaves your device
💎 100% Free
🔗 Use it now: https://tools.kandz.me
🔖 Bookmark it—you’ll need it later!