NetForge-AI
Networking CourseAI-ledLessonsCommunityFeaturesProtocolsPricing
Sign inSign up
NetForge-AI
Networking CourseAI-ledLessonsCommunityFeaturesProtocolsPricing
Sign inSign up
All lessons
Beginner·20 minute read

IPv4 Subnetting in 20 minutes

Subnetting is the act of dividing a single IPv4 network into smaller, non-overlapping subnetworks by extending the network mask. This lesson explains how prefix length controls subnet size, why /30 is standard for point-to-point links, and the math every networking learner must memorize.

Open this lab

What a subnet actually is

An IPv4 address is 32 bits long, conventionally written as four decimal octets such as 192.168.10.42. The address is split into two parts: a network portion that identifies which subnet the host lives in, and a host portion that identifies the host within that subnet. The boundary between the two is set by the subnet mask.

When the mask is written in CIDR notation — for example /24 — the number after the slash counts the network bits from the left. /24 means the first 24 bits are network and the last 8 bits are host. That leaves 2^8 − 2 = 254 usable host addresses (the network and broadcast addresses are reserved).

The masks you must memorize

Every networking learner internalizes a small table of common prefixes and their dotted-decimal masks. Here are the ones that show up constantly:

/24  255.255.255.0     254 hosts   typical user LAN
/25  255.255.255.128   126 hosts   half a /24
/26  255.255.255.192    62 hosts   small office
/27  255.255.255.224    30 hosts   small VLAN
/28  255.255.255.240    14 hosts   IoT segment
/29  255.255.255.248     6 hosts   tiny lab
/30  255.255.255.252     2 hosts   point-to-point WAN
/31  255.255.255.254     2 hosts   RFC 3021 PtP
/32  255.255.255.255     1 host    loopback / host route

Why /30 for serial links

A point-to-point WAN link has exactly two endpoints. A /30 gives you four addresses: one network, one broadcast, and two usable hosts. That is a perfect fit and wastes no IP space. Many large WAN designs sit on /30s by default; modern code paths increasingly use /31s (RFC 3021) which save one more address by repurposing the network and broadcast bits as hosts.

Calculating the network address

To find the network a given IP belongs to, perform a bitwise AND between the IP and the mask. For 192.168.10.42 with mask 255.255.255.224 (/27), the network is 192.168.10.32 and the broadcast is 192.168.10.63. Hosts .33 through .62 are usable.

NetForge-AI does this math for you under the hood — but doing it by hand once or twice cements the intuition.

Try it in the lab

Drop two PCs and one switch onto the canvas. Configure 192.168.1.10/24 on PC1 and 192.168.1.20/24 on PC2. Ping. It works. Now change PC2 to 192.168.2.20/24 and ping again — it fails because the destination is no longer in the same subnet, and there is no router to forward the packet. That single change is the entire reason routers exist.

Note: Subnet boundaries are about prefix length, not IP value. 10.0.0.1/8 and 10.255.255.254/8 are in the same /8. 10.0.0.1/24 and 10.0.1.1/24 are not.

Practice this in the lab

Reading helps. Wiring it up yourself and breaking it makes it stick.

Open the lab
NetForge-AI

A browser-native network lab and networking course, beginner to advanced. Free account opens Module 1 + a 3-device lab; Pro unlocks the rest.

Product

  • Lab
  • Networking Course
  • Lessons
  • Community
  • Features

Course modules

  • 1 · Fundamentals
  • 2 · Addressing
  • 3 · Access (L2)
  • 4 · Connectivity
  • Mock exam

Resources

  • FAQ
  • Privacy Policy
  • Terms of Service

NetForge-AI is an independent educational platform and is not affiliated with, endorsed by, or sponsored by any networking vendor or certification body. All product names, protocols, and standards referenced are the property of their respective owners and are used for descriptive, educational purposes only.

© 2026 NetForge-AI. All rights reserved.Built for networking learners worldwide.