top of page

IP Subnetting

1 day ago
5 min read

IP Subnetting A Complete Beginner-to-Advanced Guide Suggested



1. What is an IP Address?

Imagine your city has millions of houses.

Every house needs a unique address so that:

A courier knows where to deliver a package.

A visitor knows where to go.

Emergency services know which house to reach.A computer network works similarly.

An IP address identifies a device on a network.

For example:

192.168.1.10

An IPv4 address contains 32 bits, divided into four groups called octets:

192 . 168 . 1 . 10

Each octet can contain a value from:

0 – 255

Simple analogy

City → Network

Street → Subnet

House → Device

House No. → Host IP


2. What is Subnetting?


Suppose you have a large apartment complex with 256 apartments.

Instead of managing all 256 apartments as one group, you divide them into four smaller blocks:

Block A → 64 apartments

Block B → 64 apartments

Block C → 64 apartments

Block D → 64 apartments

That's essentially what subnetting does.

Subnetting is the process of dividing one larger IP network into smaller logical networks called subnets.

For example:

192.168.1.0/24

can be divided into four smaller /26 networks.

192.168.1.0/26

192.168.1.64/26

192.168.1.128/26

192.168.1.192/26


3. Why Do We Need Subnetting?

Imagine a company with 500 computers.

Putting everything into one large network isn't always desirable.

You might want:

HR

IT

Finance

Management

Servers

Guest Network

Subnetting allows you to separate these networks.

Benefits

Better organization

Different departments can have different networks.

Better security

Network traffic can be controlled between subnets using routers and firewalls.

Better IP utilization

You don't have to allocate a huge network to a small department.

Reduced broadcast traffic

Smaller broadcast domains can improve network efficiency.

Easier troubleshooting

Problems can be isolated to a particular subnet.


4. What is a Subnet Mask?

This is one of the most important concepts.

Imagine an IP address has two parts:

Network Portion | Host Portion

The subnet mask tells us which part represents the network and which part represents the devices.

Example:

IP Address:

192.168.1.10

Subnet Mask:

255.255.255.0

The first three octets identify the network:

192.168.1

The last octet identifies the host:

10

Therefore:

Network = 192.168.1.0

Host = 10


5. Understanding Binary

To understand subnetting properly, you eventually need to understand binary.

An IPv4 address contains 32 bits:

11111111.11111111.11111111.00000000

Each group contains 8 bits.

Therefore:

8 + 8 + 8 + 8 = 32 bits

A subnet mask of:

255.255.255.0

in binary is:

11111111.11111111.11111111.00000000

The 1s represent the network portion.

The 0s represent the host portion.


6. What is CIDR?


CIDR stands for:

Classless Inter-Domain Routing

Instead of writing:

192.168.1.0

255.255.255.0

we can write:

192.168.1.0/24

The /24 means:

The first 24 bits are network bits.

That leaves:

32 - 24 = 8 host bits

Therefore:

2⁸ = 256 total addresses

For a traditional IPv4 subnet, two addresses are normally reserved:

Network address

Broadcast address

So:

256 - 2 = 254 usable host addresses


7. Common CIDR Values

Here is an important cheat sheet.

CIDR Subnet Mask Total Addresses Traditional Usable Hosts

/30 255.255.255.252 4 2

/29 255.255.255.248 8 6

/28 255.255.255.240 16 14

/27 255.255.255.224 32 30

/26 255.255.255.192 64 62

/25 255.255.255.128 128 126

/24 255.255.255.0 256 254

/23 255.255.254.0 512 510

/22 255.255.252.0 1,024 1,022

/21 255.255.248.0 2,048 2,046

/20 255.255.240.0 4,096 4,094

Important: the traditional "subtract 2" rule applies to ordinary IPv4 subnets where network and broadcast addresses are reserved. Special cases such as /31 point-to-point networks and /32 host routes are handled differently.


8. The Most Important Subnetting Formula


If you know the number of host bits:

Total addresses = 2^host bits

Traditional usable hosts:

Usable hosts = 2^host bits - 2

Example: /26

32 - 26 = 6 host bits

Therefore:

2⁶ = 64 addresses

Traditional usable hosts:

64 - 2 = 62

So:

A /26 subnet has 64 total IPv4 addresses and traditionally 62 assignable host addresses.


9. How to Calculate a Subnet

Let's use:

192.168.1.0/24

Suppose we need 4 subnets.

Step 1 — Determine how many bits to borrow

We need four subnets.

2² = 4

So we borrow 2 host bits.

Original:

/24

New:

/26

Step 2 — Calculate the subnet mask

/26 is:

255.255.255.192

Step 3 — Calculate the block size

Use:

256 - 192 = 64

Therefore, our subnet increments are:

0

64

128

192


10. Our Four Subnets

Subnet 1

Network:

192.168.1.0

Usable:

192.168.1.1 – 192.168.1.62

Broadcast:

192.168.1.63

Subnet 2

Network:

192.168.1.64

Usable:

192.168.1.65 – 192.168.1.126

Broadcast:

192.168.1.127

Subnet 3

Network:

192.168.1.128

Usable:

192.168.1.129 – 192.168.1.190

Broadcast:

192.168.1.191

Subnet 4

Network:

192.168.1.192

Usable:

192.168.1.193 – 192.168.1.254

Broadcast:

192.168.1.255


11. A Real Enterprise Example

Imagine a company has:

192.168.100.0/24

The network team wants four departments.

Department Subnet

HR 192.168.100.0/26

IT 192.168.100.64/26

Finance 192.168.100.128/26

Administration 192.168.100.192/26

Now each department has its own logical network.

A firewall or Layer-3 router can control communication between them.

For example:


HR ──────┐

IT ──────┤

├── Firewall/Router

Finance ─┤

Admin ───┘


This is how subnetting becomes useful in a real enterprise environment.


12. Finding Which Subnet an IP Belongs To

Suppose we have:

IP: 192.168.1.70

Mask: /26

We know the /26 block size is:

64

Therefore the ranges are:

0 – 63

64 – 127

128 – 191

192 – 255

Where does 70 fall?

64 – 127

Therefore:

Network Address:

192.168.1.64

Broadcast:

192.168.1.127

Usable:

192.168.1.65 – 192.168.1.126

So:

192.168.1.70 belongs to the 192.168.1.64/26 subnet.


13. Network Address vs Host Address vs Broadcast

This distinction is critical.

For:

192.168.1.64/26

Network Address

192.168.1.64

Identifies the subnet itself.

Host Addresses

192.168.1.65

through

192.168.1.126

These can normally be assigned to devices.

Broadcast Address

192.168.1.127

Used to communicate with all hosts in the subnet in traditional IPv4 broadcast-based networking.


14. What is VLSM?


VLSM stands for:

Variable Length Subnet Mask

Imagine a company has:

Engineering → 100 users

HR → 20 users

Management → 10 users

Point-to-point link → 2 addresses

Giving every department a /24 would waste many addresses.

Instead, use different subnet sizes.

For example:

Engineering → /25

HR → /27

Management → /28

Point-to-point → /30

This is VLSM.

VLSM allows different subnets to use different subnet sizes according to actual requirements.


15. Subnetting and VMware


This is particularly useful for your VMware audience.

A VMware datacenter may have separate networks for:

Management

vMotion

vSAN

VM Network

Backup

NSX

Storage

Replication


For example:


Management → 10.10.10.0/24

vMotion → 10.10.20.0/24

vSAN → 10.10.30.0/24

Backup → 10.10.40.0/24

The physical network infrastructure uses VLANs and routing to provide separation and connectivity.

Understanding subnetting is therefore fundamental for VMware administrators.


16. Subnetting and VLANs


A common beginner question is:

"Are VLAN and subnet the same thing?"

No.

A VLAN is a Layer 2 logical network segmentation mechanism.

A subnet is a Layer 3 IP addressing boundary.

They are commonly used together.

For example:

VLAN 100

└── 192.168.100.0/24


VLAN 200

└── 192.168.200.0/24


In many enterprise designs, one VLAN is associated with one IP subnet, but the concepts are not identical.


17. Common Subnetting Mistakes

Mistake 1: Confusing subnet mask and IP address

192.168.1.10

is an IP address.

255.255.255.0

is a subnet mask.

Mistake 2: Forgetting the network address

For:

192.168.1.64/26

192.168.1.64 isn't normally assigned to a host.

It's the network address.

Mistake 3: Forgetting the broadcast address

For the same subnet:

192.168.1.127

is the broadcast address.

Mistake 4: Memorizing instead of understanding

Don't memorize every subnet.

Understand:


CIDR

Subnet Mask

Block Size

Network Address

Host Range

Broadcast


Once you understand this sequence, subnetting becomes much easier.


18. Subnetting Cheat Sheet


CIDR Mask Block Size Traditional Usable Hosts

/30 255.255.255.252 4 2

/29 255.255.255.248 8 6

/28 255.255.255.240 16 14

/27 255.255.255.224 32 30

/26 255.255.255.192 64 62

/25 255.255.255.128 128 126

/24 255.255.255.0 256 254

/23 255.255.254.0 512 510

/22 255.255.252.0 1,024 1,022

/21 255.255.248.0 2,048 2,046

/20 255.255.240.0 4,096 4,094


19. The 5-Step Subnetting Method


Whenever you receive a subnetting question, follow this process:


Step 1


Identify the CIDR.


/24

Step 2


Convert it to a subnet mask.


255.255.255.0

Step 3


Calculate the block size.


Step 4


Find the network and broadcast addresses.


Step 5


Determine the usable host range.


That's it.


 
 
 

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page