IPv4 Subnetting: CIDR, Masks and Worked Examples

Subnetting turns one IP network into smaller, easier-to-manage networks. This guide explains CIDR, masks, block sizes, host counts, and VLSM planning for labs and troubleshooting.

IPv4 CIDR VLSM CCNA
Subnetting Made Simple: CIDR, Masks, and Practice Examples cheat sheet: use the flow as a quick reference before reading the detailed sections.

Subnetting Made Simple: CIDR, Masks, and Practice: Table of Contents

  1. Why Subnetting Matters
  2. CIDR and Masks
  3. Block Size Shortcut
  4. VLSM Planning
  5. Practice Workflow
  6. Frequently Asked Questions

1. Why Subnetting Matters

Subnetting creates smaller broadcast domains, cleaner security boundaries, and better address management.

One VLAN usually maps to one subnet.ACLs and NAT rules depend on correct ranges.Routing summaries need clean addressing.

2. CIDR and Masks

CIDR notation tells you how many bits are network bits. A /24 leaves 8 host bits, while a /27 leaves 5 host bits.

  • 255.255.255.0 is /24.
  • 255.255.255.192 is /26.
  • 255.255.255.224 is /27.

3. Block Size Shortcut

Find the interesting octet and subtract the mask value from 256 to get the subnet increment.

  • For /27, 256 - 224 = 32.
  • Subnets are 0, 32, 64, 96, and so on.

4. VLSM Planning

Allocate the largest networks first, then assign smaller networks so the address space stays contiguous.

  • 100 hosts need /25.
  • 50 hosts need /26.
  • 25 hosts need /27.
  • Point-to-point often uses /30 or /31.

5. Practice Workflow

Convert prefix to mask, find block size, list boundaries, then identify network, first host, last host, and broadcast.

  • Do the math by hand first.
  • Use a calculator to confirm.
  • Practice until boundaries feel automatic.

Subnetting Made Simple: CIDR, Masks, and Practice: Frequently Asked Questions

What is a subnet mask?

A subnet mask separates the network portion from the host portion of an IPv4 address.

How do I find block size?

Subtract the interesting octet mask value from 256.

What is VLSM?

VLSM lets you use different subnet sizes in one larger network.

A Practical Subnetting Workflow

Start by identifying whether the requirement is based on a number of networks or a number of usable hosts. Select a prefix that provides enough addresses, remembering that a traditional IPv4 subnet reserves the network and broadcast addresses. A /26 contains 64 total addresses and normally 62 usable host addresses. A /27 contains 32 total addresses and normally 30 usable addresses.

Next, find the interesting octet—the first mask octet that is not 255 or 0. Subtract that mask value from 256 to get the block size. For 255.255.255.192, the block size is 64, so network boundaries in the fourth octet are 0, 64, 128 and 192. An address such as 192.0.2.77/26 belongs to network 192.0.2.64; its broadcast is 192.0.2.127, and the usable range is 192.0.2.65 through 192.0.2.126.

Use VLSM from Largest to Smallest

Variable Length Subnet Masking avoids assigning the same subnet size to every segment. Sort requirements by host count, allocate the largest subnet first, and place each following subnet on the next valid boundary. Keep a table containing purpose, VLAN, prefix, network, usable range, gateway and broadcast. This prevents overlap and makes route summarization easier later.

Point-to-point links often need very few addresses, while user VLANs, wireless networks and server segments may need room for growth. Do not size a subnet only for today’s active devices. Include gateways, infrastructure, reserved addresses and reasonable expansion, but avoid making every segment unnecessarily large because that increases broadcast scope and wastes address space.

Verification and Common Errors

  • Do not treat the first address as a usable host; it identifies the network.
  • Do not assign the last address to a host; it is the directed broadcast address in a conventional subnet.
  • Check that both ends of a link use compatible masks.
  • Verify that DHCP scopes, SVI addresses and routing statements describe the same network.
  • When using wildcard masks, remember that the wildcard is the inverse of the subnet mask.

When reviewing an address plan, sort networks numerically and compare every broadcast address with the next network boundary. This quick check exposes overlapping allocations before they become duplicate-IP, routing, or DHCP problems.

Use the subnet calculator to verify manual work, not replace the method. Continue with the wildcard mask calculator, IP versus MAC address guide, and OSPF labs to apply the resulting networks in routing configurations.

Subnetting Made Simple: CIDR, Masks, and Practice: Tags and Keywords

subnetting, CIDR, subnet mask, IPv4 subnetting, VLSM, block size, usable hosts, CCNA subnetting

Continue learning

Use these related resources to apply or verify the concepts on this page: