Guide

How to Subnet a Network: A Practical /24 Walkthrough

A step-by-step guide to IPv4 subnetting — CIDR notation, masks, host counts, and VLSM — with worked examples you can follow on a real /24.

NextHop LLC · Updated 2026-06-07

Subnetting is the skill that separates engineers who understand IP networking from those who just configure it. This guide walks you through everything you need — CIDR notation, subnet masks, host counts, and VLSM — using a real /24 as a working example.

What CIDR Notation Actually Means

CIDR (Classless Inter-Domain Routing) notation writes an IP address and its prefix length together: 192.168.10.0/24. The prefix length (the number after the slash) tells you how many leading bits of the 32-bit IPv4 address are fixed — the network portion. The remaining bits are the host portion.

A /24 has 24 fixed bits, leaving 8 host bits: 28 = 256 total addresses. The equivalent dotted-decimal subnet mask is 255.255.255.0 — eight bits of ones followed by eight bits of zeros. The wildcard mask (used in ACLs and OSPF) is the bitwise inverse: 0.0.0.255.

Converting mentally: each octet that is all-ones is 255. A /25 means the first 25 bits are network bits — 24 bits fill the first three octets fully, and the 25th bit locks the first bit of the fourth octet, giving 255.255.255.128.

Network Address, Broadcast, and Usable Hosts

Every subnet has three reserved addresses you cannot assign to a host:

  • Network address — all host bits set to 0. For 192.168.10.0/24 this is 192.168.10.0. It identifies the subnet itself.
  • Broadcast address — all host bits set to 1. For the same /24 this is 192.168.10.255. Packets to this address are delivered to every host on the subnet.
  • Usable host range — everything between those two. The formula: 2^(32 − prefix) − 2. For /24: 256 − 2 = 254 usable hosts.

Two exceptions exist. A /31 (RFC 3021) has only two addresses and no broadcast; both are usable for point-to-point links (routers, WAN circuits). A /32 is a host route — one address, one device; used in loopbacks, BGP peering addresses, and firewall rules.

CIDR Cheat-Sheet Table

This table covers the most common prefix lengths. The "Usable" column applies the −2 rule except for /31 (RFC 3021) and /32.

PrefixSubnet MaskTotal AddressesUsable HostsCommon Use
/24255.255.255.0256254LAN segment
/25255.255.255.128128126Half a /24
/26255.255.255.1926462Floor / department
/27255.255.255.2243230Small team
/28255.255.255.2401614Server cluster
/29255.255.255.24886Small server block
/30255.255.255.25242Routed point-to-point
/31255.255.255.25422P2P link (RFC 3021)
/32255.255.255.25511Host route / loopback

Worked Example: Splitting a /24 into /26 Subnets

You have been allocated 10.10.10.0/24 and need to divide it into four equal subnets. Each /26 provides 62 usable hosts — enough for a typical floor or department. Borrowing 2 bits from the host portion of a /24 gives you 22 = 4 subnets, each a /26.

SubnetNetworkFirst HostLast HostBroadcast
110.10.10.0/2610.10.10.110.10.10.6210.10.10.63
210.10.10.64/2610.10.10.6510.10.10.12610.10.10.127
310.10.10.128/2610.10.10.12910.10.10.19010.10.10.191
410.10.10.192/2610.10.10.19310.10.10.25410.10.10.255

Notice that the fourth subnet's broadcast is still 10.10.10.255 — the space is fully consumed. Each /26 block is 64 addresses wide, so the network addresses increment by 64 each time (0, 64, 128, 192).

VLSM — Variable-Length Subnet Masking

Fixed-size subnets waste addresses. VLSM lets you carve up a block with different prefix lengths based on actual need. The rule: allocate the largest blocks first, then progressively smaller ones from the remaining space.

Example: you still have 10.10.10.0/24, but requirements are different per segment:

  • Data centre: 50 servers → needs at least /26 (62 hosts)
  • Office floor: 25 workstations → /27 (30 hosts)
  • Management: 10 devices → /28 (14 hosts)
  • WAN link A: 2 endpoints → /30 (2 hosts)
  • WAN link B: 2 endpoints → /30

Allocation from 10.10.10.0/24:

10.10.10.0/26    → Data centre   (62 hosts) 10.10.10.64/27   → Office floor  (30 hosts) 10.10.10.96/28   → Management    (14 hosts) 10.10.10.112/30  → WAN link A    ( 2 hosts) 10.10.10.116/30  → WAN link B    ( 2 hosts) 10.10.10.120/29  → Reserved / future growth

Total consumed: 64 + 32 + 16 + 4 + 4 = 120 addresses. The remainder (10.10.10.120–255) stays unallocated for future use.

Subnetting on Real Platforms

When you configure a subnet on a Cisco IOS router you use dotted-decimal masks; on Juniper and most Linux tools you use CIDR notation. Both describe the same boundary:

! Cisco IOS — interface with a /26 interface GigabitEthernet0/0 ip address 10.10.10.1 255.255.255.192 # Juniper Junos — same /26 set interfaces ge-0/0/0 unit 0 family inet address 10.10.10.1/26 # Linux — ip command ip addr add 10.10.10.1/26 dev eth0

For OSPF and EIGRP, the wildcard mask is common: 0.0.0.63 for a /26 (the bitwise inverse of 255.255.255.192).

When you need to verify your math quickly, the Subnet Calculator will expand any CIDR prefix to network, broadcast, mask, wildcard mask, and full host range in one step. If you work with BGP and need to understand how subnets aggregate into announced prefixes, see also the ASN and BGP prefix guide.

Common Mistakes and How to Avoid Them

  • Assigning the network or broadcast address to a host. Always check the boundaries. .0 is the network address; .255 (in a /24) is broadcast.
  • Overlapping subnets. When doing VLSM manually, track what you have consumed. A subnet calculator or address management tool will catch this instantly.
  • Confusing subnet mask with wildcard mask. OSPF and ACLs use wildcard masks (inverse of subnet mask). Swapping them is a classic misconfiguration.
  • Not accounting for the gateway. Your usable host count is 2^(32−prefix)−2, but one of those hosts will be consumed by the default gateway. Plan for N hosts + 1 gateway.
  • Ignoring /31 for point-to-point links. Using /30 wastes two addresses per link. In a large WAN with hundreds of P2P circuits, switching to /31 can recover a meaningful block of address space.

Subnetting fluency comes from practice. Work through the math manually at least once per design, then verify with the Subnet Calculator to confirm your boundaries before you commit addresses to a change request.

Try the tool

Subnet Calculator

Open Subnet Calculator