Fundamentals 7 min read

Master IP Addressing and Subnetting: From Basics to Complex VLSM Examples

This article explains what IP addresses are, outlines IPv4 address classes and private ranges, describes network, broadcast, and host addresses, and provides step‑by‑step VLSM subnetting calculations with multiple practical examples for various network scenarios.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Master IP Addressing and Subnetting: From Basics to Complex VLSM Examples

What is an IP address

IP addresses are used in a network to identify a node.
They are also used for addressing IP packets within the network.
An IPv4 address consists of 32 bits.
IPv4 addresses are usually represented in dotted‑decimal notation.
Example:
192.168.10.1
11000000 10101000 00001010 00000001

IP address ranges

IP addresses are divided into five classes A, B, C, D, E; classes B and C are most commonly used.
Total IPv4 space: 2^32 addresses.
Class A: 1.0.0.1‑127.255.255.254
Class B: 128.1.0.1‑191.254.255.254
Class C: 192.0.1.1‑223.255.254.254
Class D: 224.0.0.1‑239.255.255.254
Class E: 240.0.0.0‑247.255.255.255

Private address ranges:
Class A: 10.0.0.0‑10.255.255.255
Class B: 172.16.0.0‑172.31.255.255
Class C: 192.168.0.0‑192.168.255.255

IP address types

Network address : the smallest address with all host bits set to 0.

Broadcast address : the largest address with all host bits set to 1.

Host address : address that can be assigned to end devices.

VLSM (Variable Length Subnet Mask)

Overview

Satisfies different network requirements for IP addresses.

Enables hierarchical network design.

Saves IP address space.

Achieved by borrowing bits from the host portion to create sub‑net bits.

Example

172.16.0.0/16 borrow 1 bit:
Subnet 1: 172.16.0.0/17 (mask 255.255.128.0)
Usable hosts: 172.16.0.1‑172.16.127.254
Broadcast: 172.16.127.255

Subnet 2: 172.16.128.0/17
Usable hosts: 172.16.128.1‑172.16.255.254
Broadcast: 172.16.255.255

Calculation formulas

Number of subnets = 2^m (m = number of borrowed bits)
Usable IPs per subnet = 2^n – 2 (n = remaining host bits)

Practical walkthrough

1. Subnetting 192.168.1.0/25

Subnet 1: 192.168.1.0/25
Usable IPs: 192.168.1.1‑192.168.1.126
Broadcast: 192.168.1.127

Subnet 2: 192.168.1.128/25
Usable IPs: 192.168.1.129‑192.168.1.254
Broadcast: 192.168.1.255

2. Subnet mask for 1000 hosts

Need 2^n‑2 ≥ 1000 → n = 10 host bits
Mask: 32‑10 = 22 → 255.255.252.0

3. Analyze 192.168.1.100/29

Block size: 2^(32‑29) = 8
Network address: 192.168.1.96/29
Broadcast address: 192.168.1.103
Usable IPs: 192.168.1.97‑192.168.1.102

4. Divide a Class C network for three departments

Dept A (30 hosts): 192.168.1.0/27 (mask 255.255.255.224)
Dept B (20 hosts): 192.168.1.32/27
Dept C (10 hosts): 192.168.1.64/28

5. Four departments (≤50 hosts each)

Subnet mask: /26 (255.255.255.192)
Production: 192.168.100.0/26
Sales: 192.168.100.64/26
Finance: 192.168.100.128/26
Customer Service: 192.168.100.192/26

6. Analyze 61.179.150.39/28

Block size: 16
Network address: 61.179.150.32/28
Broadcast address: 61.179.150.47
Usable IPs: 61.179.150.33‑61.179.150.46

7. Interface configuration for 19.224.17.0/17

Usable address range: 19.224.0.1‑19.224.127.254
Can be configured on a router interface.

8. Compare 37.95.221.16/5 and 41.222.221.16/5

Not in the same subnet (block size = 8; 37 and 41 fall in different blocks).

9. Analyze 37.95.221.16/5

Network address: 32.0.0.0/5
Broadcast address: 39.255.255.255

10. Complex multi‑department division

Production (100 hosts): 192.168.0.0/25
Sales (50 hosts): 192.168.0.128/26
Finance (25 hosts): 192.168.0.192/27
Customer Service (12 hosts): 192.168.0.224/28
IP subnetting diagram
IP subnetting diagram
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

IPv4network fundamentalsIP addressSubnettingVLSM
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.