Subnetting can look intimidating when you first encounter addresses such as 192.168.1.0/24, subnet masks such as 255.255.255.0, or terms like network address, broadcast address, CIDR and default gateway.
The good news is that the basic idea is much simpler than the notation suggests.
Subnetting is the process of dividing one IP network into smaller logical networks called subnets.
Instead of placing every device in one large network, a network administrator can create smaller groups for employees, servers, cameras, guest devices, departments or different physical locations.
Before learning how to calculate subnets, however, you need to understand what an IP address represents, what a subnet mask does, how CIDR notation works and why networks are divided in the first place.
This guide explains those concepts from the beginning.
What Is an IP Address?
An IP address is a numerical address used to identify a device or network interface on an IP network.
A typical IPv4 address looks like this:
192.168.1.10
IPv4 addresses contain 32 bits.
For readability, those 32 bits are divided into four groups called octets:
8 bits . 8 bits . 8 bits . 8 bits
Each octet can represent a decimal value from 0 to 255.
That is why IPv4 addresses usually appear in a format such as:
192.168.1.10
Internally, computers work with binary values.
The same address can be represented as:
192 168 1 10
11000000 . 10101000 . 00000001 . 00001010
You do not need to become comfortable with binary immediately.
For now, remember one important fact:
An IPv4 address always contains 32 bits.
That fact becomes important when we later divide those bits between the network portion and the host portion.
The Network Portion and the Host Portion
An IPv4 address alone does not tell us everything about the network.
We also need to know which part of the address identifies the network and which part identifies an individual host inside that network.
Consider:
192.168.1.0/24
The /24 tells us that the first 24 bits belong to the network portion.
Because IPv4 contains 32 bits in total:
32 total bits
- 24 network bits
-----------------
8 host bits
Conceptually:
Network portion Host portion
11111111.11111111.11111111 | 00000000
24 bits | 8 bits
The network portion identifies the subnet.
The host portion is used to identify individual addresses inside that subnet.
This distinction is at the heart of subnetting.
When we create smaller subnets, we essentially use more bits for identifying networks and leave fewer bits available for hosts.
What Is CIDR?
CIDR stands for Classless Inter-Domain Routing.
For beginners, the most important part of CIDR is the prefix notation placed after an IP address:
/8
/16
/24
/27
The number tells us how many of the 32 IPv4 bits belong to the network prefix.
For example:
192.168.1.0/24
means:
24 network bits
8 host bits
While:
192.168.1.0/27
means:
27 network bits
5 host bits
Because:
32 - 27 = 5
The larger the CIDR prefix becomes, the fewer host bits remain.
That generally means the subnet becomes smaller.
For example:
| CIDR | Total IPv4 Addresses |
|---|---|
/24 |
256 |
/25 |
128 |
/26 |
64 |
/27 |
32 |
/28 |
16 |
You do not need to memorize this table yet. In the next guide, we will learn how these values are calculated.
What Is a Subnet Mask?
A subnet mask expresses the same basic network boundary as a CIDR prefix, but in dotted-decimal notation.
For example:
/24
corresponds to:
255.255.255.0
So these two descriptions refer to the same prefix length:
192.168.1.0/24
and:
IP network: 192.168.1.0
Subnet mask: 255.255.255.0
Another example is:
/27
which corresponds to:
255.255.255.224
Therefore:
192.168.1.0/27
uses:
255.255.255.224
as its subnet mask.
A subnet mask tells a device which bits identify the network and which bits are available for host addressing.
Later, when we calculate subnets manually, we will see exactly why /27 becomes 255.255.255.224.
For now, the important relationship is:
CIDR prefix
↓
Number of network bits
↓
Subnet mask
Why Do We Need Subnetting?
Imagine a small company using this network:
192.168.1.0/24
The company may have several different types of devices:
- Management computers
- Sales computers
- Developers
- Servers
- Guest Wi-Fi devices
- IP cameras
Technically, all of these devices could potentially exist inside the same IP subnet.
But as the network grows, that design can become harder to organize, control and troubleshoot.
Instead, the network can be divided into smaller subnets.
For example:
Management 192.168.1.0/27
Sales 192.168.1.32/27
Developers 192.168.1.64/27
Guests 192.168.1.96/27
The exact addressing plan would depend on how many devices each group actually needs, but the example demonstrates the idea.
We started with one larger network and divided part of its address space into smaller logical networks.
1. Better Network Organization
Subnetting gives network administrators a logical way to organize devices.
Instead of having printers, servers, employee computers, cameras and guest devices mixed into one address range, different groups can use different networks.
For example:
192.168.10.0/24 Employees
192.168.20.0/24 Servers
192.168.30.0/24 Cameras
192.168.40.0/24 Guest devices
This makes an addressing plan easier to understand.
When an administrator sees an address such as:
192.168.30.25
the addressing structure may immediately indicate that the device belongs to the camera network.
2. Better Security and Segmentation
Network segmentation can also support security.
For example, guest Wi-Fi users generally should not have direct access to internal company servers.
A network might therefore use separate subnets:
Guest network:
192.168.40.0/24
Server network:
192.168.20.0/24
Traffic moving between these networks passes through a Layer 3 device such as a router or firewall, where access policies can be applied.
There is an important distinction here:
Creating separate IP subnets does not by itself provide complete security.
The network design must also enforce the separation using appropriate routing, firewall, VLAN or access-control policies.
Subnetting creates the logical boundaries. Security controls determine what traffic is allowed to cross those boundaries.
3. Smaller Broadcast Domains
IPv4 networks use broadcast traffic for certain functions.
A broadcast is traffic intended for devices within the local broadcast domain rather than for one specific destination.
If a very large number of devices share one broadcast domain, unnecessary broadcast traffic can reach many devices.
Subnetting allows a large network to be separated into smaller broadcast domains.
For example, instead of hundreds of devices participating in one subnet, devices can be distributed across several smaller networks.
Routers normally do not forward ordinary Layer 2 broadcasts between IP subnets.
As a result, broadcasts from one subnet remain within that local network boundary.
4. Easier Network Management and Troubleshooting
A well-designed addressing structure can make network problems easier to locate.
Suppose an organization uses:
192.168.10.0/24 Office computers
192.168.20.0/24 Servers
192.168.30.0/24 Surveillance cameras
192.168.40.0/24 Guest Wi-Fi
If a problem involves the 192.168.30.0/24 network, the administrator already knows which group of devices should be investigated.
Subnetting can therefore make addressing, routing, firewall rules, monitoring and troubleshooting more structured.
5. More Appropriate IP Address Allocation
Different networks may require very different numbers of addresses.
A server network might need only a small number of addresses, while an employee network may need hundreds.
Subnetting makes it possible to allocate address blocks according to actual requirements instead of assigning unnecessarily large networks everywhere.
Later in this series, we will also look at Variable Length Subnet Masking (VLSM), which allows networks of different sizes to be created from a larger address block.
What Are Network, Host and Broadcast Addresses?
A normal IPv4 subnet contains several types of addresses.
Understanding them is essential before learning subnet calculations.
Consider:
192.168.1.0/24
This network contains the address range:
192.168.1.0
through
192.168.1.255
But not every address in that range is normally assigned to a device.
Network Address
The network address identifies the subnet itself.
For:
192.168.1.0/24
the network address is:
192.168.1.0
You would normally not assign this address to a computer, printer or server.
It represents the network.
Host Addresses
The addresses between the network address and broadcast address are normally available for hosts.
For this /24 example:
First usable address:
192.168.1.1
Last usable address:
192.168.1.254
These addresses can be assigned to devices such as computers, servers, printers, phones or network interfaces.
Broadcast Address
The final address in a traditional IPv4 subnet is the broadcast address.
For:
192.168.1.0/24
the broadcast address is:
192.168.1.255
It represents all hosts on that subnet for IPv4 broadcast communication.
So our /24 network can be summarized as:
| Address Type | Address |
|---|---|
| Network | 192.168.1.0 |
| First usable | 192.168.1.1 |
| Last usable | 192.168.1.254 |
| Broadcast | 192.168.1.255 |
A /24 therefore contains:
256 total addresses
254 traditionally usable host addresses
The network and broadcast addresses account for the other two.
There are special IPv4 cases, such as
/31point-to-point networks, where the traditional “subtract two” rule does not apply. For beginner LAN subnetting, however, the network/hosts/broadcast model above is the one you will encounter most often.
A Smaller Subnet Example: /27
Now consider:
192.168.1.0/27
Without calculating it yet, we can already describe the subnet:
Network:
192.168.1.0/27
First usable:
192.168.1.1
Last usable:
192.168.1.30
Broadcast:
192.168.1.31
The next /27 subnet begins at:
192.168.1.32/27
You might reasonably ask:
Why does the first subnet end at .31? Why does the next one start at .32?
That is exactly what subnet calculation answers.
In the next guide, we will calculate this example from beginning to end and learn how to determine the prefix, subnet mask, block size, network address, usable range and broadcast address ourselves.
Private vs Public IPv4 Addresses
You will frequently encounter addresses beginning with 192.168, 10, or certain parts of 172.
Many of these are private IP addresses.
Private IPv4 address space is reserved for use inside local networks and is not globally routed on the public Internet.
The three private IPv4 ranges are:
10.0.0.0/8
172.16.0.0/12
192.168.0.0/16
Therefore:
192.168.1.0/24
is part of the private range:
192.168.0.0/16
This is why addresses such as these are commonly used in home networks, offices, laboratories and internal infrastructure.
The Ultimate Guide to Fixing Cloudflare Error 521: Web Server Is Down
What Is a Public IP Address?
A public IP address is globally routable on the Internet and must be uniquely allocated within the public Internet addressing system.
A typical home or office network may therefore contain private addresses internally while using one or more public addresses to communicate with the Internet.
A router commonly performs Network Address Translation (NAT) between private internal addresses and public Internet connectivity.
For example, your computer might have:
192.168.1.10
inside your home network.
That does not mean websites on the Internet see 192.168.1.10 as your Internet-facing address.
Your router typically translates the internal communication through its public-facing connection.
What Is a Default Gateway?
When configuring a network device manually, you may see fields such as:
IP Address
Subnet Mask
Default Gateway
DNS Server
Each has a different purpose.
Imagine a computer configured as:
IP Address:
192.168.1.10
Subnet Mask:
255.255.255.0
Default Gateway:
192.168.1.1
The IP address identifies the computer’s network interface.
The subnet mask tells the computer which addresses belong to its local subnet.
The default gateway is normally the router or Layer 3 device the computer uses to reach destinations outside its local network.
For example, if:
Computer:
192.168.1.10/24
wants to communicate with:
192.168.1.50
both addresses are inside the same /24 subnet.
The devices can normally communicate through the local network without sending the traffic through the default gateway for routing.
But if the computer wants to reach:
192.168.2.50
that address belongs to another subnet.
The computer therefore needs a route toward that network. If no more specific route exists, it will usually send the traffic to its default gateway.
What Is DNS, and Is It Part of Subnetting?
DNS is related to network configuration but performs a different job.
A DNS server translates names such as:
example.com
into IP addresses.
For example, a device might have:
IP address:
192.168.1.10
Subnet mask:
255.255.255.0
Default gateway:
192.168.1.1
DNS server:
192.168.1.2
or use another DNS resolver.
The subnet mask determines which destinations are considered local.
The default gateway provides a route toward external networks.
DNS resolves human-readable names into IP addresses.
Keeping these roles separate will make troubleshooting much easier later.
Does a Subnet Need a Router?
Not necessarily.
Devices inside the same IP subnet can normally communicate with each other across the local Layer 2 network without a router routing the traffic between them.
For example:
PC A:
192.168.1.10/24
PC B:
192.168.1.20/24
Both belong to:
192.168.1.0/24
They therefore recognize each other as local destinations.
Now consider:
PC A:
192.168.1.10/24
Server:
192.168.2.20/24
PC A belongs to:
192.168.1.0/24
while the server belongs to:
192.168.2.0/24
These are different IP networks.
Communication between them requires Layer 3 routing, usually provided by a router, Layer 3 switch, firewall or another system capable of routing IP traffic.
This gives us an important rule:
Same subnet: communication can remain local.
Different subnets: a Layer 3 route is required.
Subnetting and VLANs Are Not the Same Thing
Beginners often encounter subnetting and VLANs at approximately the same time, so the two concepts can easily become confused.
A subnet is an IP Layer 3 concept.
A VLAN is primarily a Layer 2 segmentation concept.
In many real networks, administrators map one VLAN to one IP subnet.
For example:
VLAN 10 → 192.168.10.0/24
VLAN 20 → 192.168.20.0/24
VLAN 30 → 192.168.30.0/24
But a VLAN and an IP subnet are not technically the same thing.
This distinction becomes important when you begin configuring managed switches, routers and firewalls.
A Simple Mental Model for Subnetting
Before moving on to calculations, it helps to think about subnetting as dividing a large building.
Imagine that you initially have one large open office.
Everyone shares the same space.
As the company grows, you divide the office into separate rooms:
Management
Sales
Development
Servers
Guests
The entire building still belongs to the same organization, but each room has its own boundary.
Subnetting performs a similar job with IP address space.
You start with a network such as:
192.168.1.0/24
and divide its available address space into smaller networks.
The CIDR prefix determines where the network boundary exists.
Key Terms to Understand Before Calculating Subnets
Before continuing to practical subnetting, you should be comfortable with these concepts:
| Term | Simple Meaning |
|---|---|
| IPv4 address | A 32-bit address identifying an IP interface |
| Octet | One 8-bit section of an IPv4 address |
| Network portion | Bits that identify the network |
| Host portion | Bits available for addresses inside the network |
| CIDR prefix | Number such as /24 showing the network-prefix length |
| Subnet mask | Dotted-decimal representation of the network mask |
| Network address | Address representing the subnet |
| Usable host address | Address normally assignable to a device |
| Broadcast address | IPv4 address used to address the subnet’s broadcast domain |
| Default gateway | Layer 3 device used to reach other networks |
| Subnet | A smaller logical IP network |
| Router | Device or system that forwards packets between IP networks |
If these concepts make sense, you are ready for the mathematical part of subnetting.
What Happens When We Divide a Network?
Suppose we begin with:
192.168.1.0/24
A /24 has:
24 network bits
8 host bits
If we decide to divide it into smaller networks, some of the bits previously available for host addressing become part of the network prefix.
For example:
/24 → /27
The network prefix becomes longer:
24 network bits → 27 network bits
and the host portion becomes smaller:
8 host bits → 5 host bits
Those additional network bits allow us to identify multiple smaller subnets.
This process is often described as borrowing bits from the host portion.
You do not need to calculate how many bits to borrow yet.
That is the next step in the learning process.
Next: Learn How to Calculate Subnets Step by Step
You now know what subnetting actually does.
You also know the meaning of:
IPv4 addresses
CIDR prefixes
Subnet masks
Network addresses
Host addresses
Broadcast addresses
Default gateways
The next question is:
How do we calculate the subnet ranges ourselves?
In the next Hollands Web guide, we will take:
192.168.1.0/24
and divide it into:
8 subnets
step by step.
We will calculate:
Required subnet bits
New CIDR prefix
Subnet mask
Remaining host bits
Addresses per subnet
Usable hosts
Block size
Network addresses
First and last usable addresses
Broadcast addresses
By the end of that guide, the following result will no longer look like something you have to memorize:
192.168.1.0/27
192.168.1.32/27
192.168.1.64/27
192.168.1.96/27
...
You will understand exactly where those numbers come from and how to calculate them yourself.

