Subnetting.html


* created: 2026-04-25T18:07
* modified: 2026-04-25T18:12

title

Title

description

Description

Subnetting yo

IP addresses are 32 bits (IPv4), written as four 8-bit octets: 192.168.1.42. Every address has two logical parts:

Subnetting is just the act of deciding where that boundary falls.

The subnet mask

A subnet mask is a 32-bit number where all the 1s mark the network portion and all the 0s mark the host portion. The 1s are always contiguous and left-aligned.

Address:  192.168.1.42   →  11000000.10101000.00000001.00101010
Mask:     255.255.255.0  →  11111111.11111111.11111111.00000000
                                     ^^^^^^^^^^^^^^^^ network ^^^^^^^^^^^^^^^^  ^^^^ host ^^^^

The mask 255.255.255.0 says: "the first 24 bits are the network, the last 8 are the host."

CIDR notation

Writing out 255.255.255.0 is verbose. CIDR (Classless Inter-Domain Routing) just appends a / and the count of network bits to the address:

192.168.1.42/24   ←  same as 255.255.255.0
10.0.0.0/8        ←  same as 255.0.0.0
172.16.0.0/12     ←  same as 255.240.0.0

The number after the slash is called the prefix length.