RedTeam Nexus Labs
Module 06 · Lesson 04 // Subnetting

subnet calculation

Subnetting · Networking

Freereading · 10 min
On this page
LESSON

Overview

Subnetting is dividing a larger network into smaller subnetworks. This lesson brings the pieces together into a repeatable method for calculating subnets — a core networking skill used in design, troubleshooting, and security scoping.

Learning objectives

  • Explain why networks are subnetted.
  • Apply a step-by-step subnet calculation.
  • Work a concrete subnetting example.

Core concept

Subnetting takes a block of addresses and splits it into multiple smaller networks by "borrowing" bits from the host portion to create more network bits. Reasons to subnet:

  • Segmentation — separate departments or functions for security and performance.
  • Efficient address use — size each subnet to its need.
  • Reduced broadcast domains — smaller subnets mean smaller broadcast domains.

Borrowing more bits creates more subnets, each with fewer hosts — a fundamental trade-off.

How it works

A practical calculation method:

  1. Start with the base network and prefix (e.g. 192.168.1.0/24).
  2. Decide how many subnets or hosts-per-subnet you need.
  3. Borrow host bits to make subnets: borrowing b bits creates 2^b subnets, and the new prefix is old prefix + b.
  4. Compute hosts per subnet: 2^(remaining host bits) − 2.
  5. List the subnets by stepping through the address range in increments of the subnet size.

Practical example

Split 192.168.1.0/24 into 4 subnets. Borrow 2 bits (2^2 = 4 subnets); new prefix /26; host bits = 6 → 62 usable hosts each. The four subnets:

SubnetNetworkUsable rangeBroadcast
1192.168.1.0/26.1 – .62.63
2192.168.1.64/26.65 – .126.127
3192.168.1.128/26.129 – .190.191
4192.168.1.192/26.193 – .254.255

Each block is 64 addresses (62 usable), stepping by 64.

Cybersecurity relevance

Subnetting is the mechanism behind network segmentation — isolating sensitive systems (e.g. finance, servers, guests) into their own subnets so an attacker who breaches one cannot freely reach others. Correct subnet math is also needed to scope firewall rules, plan monitoring, and define scanning ranges accurately.

Common mistakes

  • Miscounting borrowed bits, producing the wrong number of subnets or hosts.
  • Overlapping or misaligned subnets from stepping by the wrong increment.
  • Subnetting too small, leaving no room for growth in each segment.

Key takeaways

  • Subnetting divides a network by borrowing host bits: borrowing b bits yields 2^b subnets with fewer hosts each.
  • Steps: start with the block, decide needs, borrow bits, compute hosts (2^remaining − 2), and list subnets by their increment.
  • Subnetting powers network segmentation and correct security scoping.

Check your understanding

  • To divide a /24 into 8 subnets, how many host bits must you borrow and what is the new prefix?
  • In the /26 example, why does each subnet step by 64 addresses?
FINISH THIS LESSON

Sign in to save your progress.