Subnetting Guide

1. What is an IP Address?

An IP address is a unique identifier for a device on a network. It is written in IPv4 as four octets (8 bits each), e.g., 192.168.1.5. Each octet ranges from 0 to 255.

2. What is a Subnet?

A subnet divides a network into smaller segments to organize and optimize traffic. The subnet is represented with a subnet mask or /prefix (CIDR notation).

Example: 192.168.1.5/24 → /24 means the first 24 bits are the network portion, leaving 8 bits for hosts.

3. How to Read an IP with Subnet

Given IP/Subnet, you can calculate:

4. Tricks to Calculate Subnet Items

Subnet Mask

Convert the prefix length to 32-bit mask:

Network Address

Perform a bitwise AND between IP and subnet mask. Example:

IP     : 192.168.1.5     → 11000000.10101000.00000001.00000101
Mask   : 255.255.255.0   → 11111111.11111111.11111111.00000000
Bitwise AND:               -----------------------------------
Network: 192.168.1.0     → 11000000.10101000.00000001.00000000

Wildcard Mask

Wildcard mask = Inverse of subnet mask. Example:

255.255.255.0 → 0.0.0.255

First and Last Host

Broadcast Address

Set all host bits to 1. Example /24:

Network: 192.168.1.0Broadcast: 192.168.1.255

Block Size & Next Subnet


Back to Subnet Trainer.