IPv4 Subnetting for Beginners: How to Split a Network in 5 Simple Steps!

Important Comparison Table:

ComponentExampleFunctionBit Allocation (/24)
Network ID192.168.1.0Subnet identityThe first 24 bits
Host ID0.0.0.10Device identityLast 8 bits
Subnet Mask255.255.255.0Network/host limiter24 bit ‘1’

Warning: Two addresses in each subnet are always reserved:

  1. Network address (all host bits 0)
  2. Broadcast address (all host bits 1)

How IPv4 Subnetting Works: A Step-by-Step Guide with Practical Examples

Step 1: Determine Subnet Needs

Action Plan:

  1. Identify the number of subnets needed
  2. Specify the maximum number of hosts per subnet
  3. Add a 20-30% buffer for future expansion

Case Examples:

The company requires:

  • 4 subnets (HR, IT, Marketing, Guest WiFi)
  • Each subnet hosts ±50 hosts
  • Initial network: 192.168.1.0/24

Always calculate real needs + reserves. For 50 hosts, plan for ±64 hosts.

Step 2: Calculate the New Subnet Mask

Once we know the number of subnets, we need to determine how many bits of the host part should be borrowed to be part of the network. Use the formula:

Number of subnets = 2ⁿ (n = bits borrowed from host portion)

Available hosts = 2h – 2 (h = remaining host bits)

Account:

  1. Host requirement: 50 → 6 host bits (2⁶-2 = 62 hosts)
  2. Initial network /24 (8 host bits) → borrow 2 bits for subnets (2² = 4 subnets)
  3. New subnet mask: /26 (24+2) or 255.255.255.192

Bit Visualization:

Original: 11111111.1111111111111111111.0000000(/24)

New:  11111111.111111111.111111111.111100000 (/26)

    [Network]  [Sub][Host]

Step 3: Define Subnet Blocks

Once a new subnet mask is defined, the main network is divided into subnet blocks.

Magic Number Formula:

Block size = 256 -  last octet subnet mask

Example: 256 - 192 = 64

For example, from the initial network 192.168.1.0/24, you can create a new subnet as follows:

  1. Subnet 1: 192.168.1.0/26 (0-63)
  2. Subnet 2: 192.168.1.64/26 (64-127)
  3. Subnet 3: 192.168.1.128/26 (128-191)
  4. Subnet 4: 192.168.1.192/26 (192-255)

Note: Each subnet has 62 usable hosts (64 total – network – broadcast).

Step 4: Calculate Valid IP Range

For each subnet, you must specify a valid IP address for the device (host), a network address, and a broadcast address. For example, for subnet 192.168.1.0/26:

  • Network Address: 192.168.1.0
  • Valid Host:
    • First: 192.168.1.1
    • Latest: 192.168.1.62
    • Broadcast: 192.168.1.63

Quick Cheat Sheet:

SubnetNetwork AddressFirst HostLast HostBroadcast
1192.168.1.0192.168.1.1192.168.1.62192.168.1.63
2192.168.1.64192.168.1.65192.168.1.126192.168.1.127

Step 5: Verify with Real Case Studies

Scenario:

  • 3 departments (HR, IT, Marketing)
  • Maximum of 30 hosts per subnet
  • Network: 192.168.1.0/24

Solution:

  1. Count requirements: 30 hosts → 5 host bits (2⁵-2=30)
  2. Subnet mask: /27 (32-5) or 255.255.255.224
  3. Block size: 256-224=32
  4. Subnet Allocation:
    • HR: 192.168.1.0/27 (1-30)
    • IT: 192.168.1.32/27 (33-62)
    • Marketing: 192.168.1.64/27 (65-94)

Use diagrams for visualization:

[  HR ] 192.168.1.0/27  Host: 1-30

[  IT ] 192.168.1.32/27   Host: 33-62

[  MKT ] 19.168.1.64/27  Host: 65-94

Common Mistakes in Subnetting and Practical Solutions

1. Miscalculating Subnet Mask

  • Using subnet masks that don’t meet your needs
    Example: Need 60 hosts/subnet but use /27 (only 30 hosts)
  • Result: Network not functioning optimally, IP conflict

2. Forgot Network Allocation & Broadcast Address

  • Assume all IPs in the range are usable
    Example: In subnet 192.168.1.0/26, assume the range 0-63 is all usable

3. Overlapping Subnet Ranges

Overlapping subnets

Example:

  • Subnet A: 192.168.1.0/26 (0-63)
  • Subnet B: 192.168.1.32/27 (32-63) → Overlap occurred!

4. Leaving No Expansion Space

  • Allocate a mediocre IP
    Example: Need 30 hosts → Out-of-the-box /27 (30 hosts)

5. Convert CIDR to Subnet Mask

  • Misinterpreting CIDR notation
    Example: Calculating /25 = 255.255.255.5 (incorrect!)

 “Always test subnetting with ping tests and traceroutes before deploying to production. Use a lab simulator like Cisco Packet Tracer for practice!”

Tools to Make Subnetting Easier

Performing IPv4 subnetting calculations manually is indeed beneficial for basic practice and understanding. But in professional practice, especially when dealing with complex networks, the use of tools and visual aids goes a long way in speeding up and minimizing errors.

Here are some of the best tools you can use to simplify the subnetting process:

1. Subnet Calculator

The subnetting calculator helps you determine:

  • The number of subnets that can be created.
  • The number of hosts available per subnet.
  • Valid IP range, broadcast address, and network address.
  • CIDR and subnet mask notation are automatically.

Latest Articles