Visit complete Cyber Security roadmap

← Back to Topics List

Basics of Subnetting

Subnetting is the process of dividing an IP network into smaller sub-networks called subnets. It allows better allocation of IP addresses and provides better organization, control, and security for the network. Here we go through some of the basic concepts of subnetting and why it’s crucial for cybersecurity.

IP Addresses and Subnet Masks

An IP address is a unique identifier for devices on a network. It consists of two parts: the network address and the host address. The network address indicates the network to which a device belongs, while the host address identifies the specific device within that network.

Subnet masks are used to define which portion of an IP address is the network address and which is the host address. For example, in the IP address, and subnet mask, the network address is, and the host address is 5.

Why Subnetting?

Subnetting has several advantages, including:

  • Improved Network Performance: Breaking a large network into smaller subnets helps reduce congestion and improve overall performance.
  • Enhanced Security: By isolating different parts of a network, you can control access and limit the spread of potential threats.
  • Easier Administration: Smaller networks are easier to manage and maintain, as it’s simpler to track issues and allocate resources.

Subnetting Process

The process of subnetting involves the following steps:

  • Choose the Appropriate Subnet Mask: Determine the right subnet mask for your network based on the number of required subnets and hosts. The more subnets you need, the more bits you will “borrow” from the host portion of the IP address.

  • Divide the Network into Subnets: Calculate the subnet addresses by incrementing the network portion of the IP address by the value of the borrowed bits.

  • Determine Host Ranges: Calculate the valid host addresses within each subnet by identifying the first and last usable IP addresses. Remember that the first address in a subnet is the network address, and the last address is used for broadcasting.

  • Assign IP Addresses: Allocate IP addresses to devices within their respective subnets, and configure devices with the correct subnet mask.


Let’s suppose we have the network with a subnet mask of We want to create four smaller subnets. Here’s how we can do it:

  • in binary is 11111111.11111111.11111111.00000000. We can borrow 2 bits from the host portion to create four subnets: 11111111.11111111.11111111.11000000, which is in decimal format.

  • Our subnets will have the following network addresses:

  • The valid host ranges within each subnet are:

    • -
    • -
    • -
    • -
  • Allocate IP addresses from these host ranges to devices within their respective subnets, and configure devices with the correct subnet mask (

Understanding the basics of subnetting is essential to properly configuring and securing your network. By efficiently dividing your network into smaller subnets, you can optimize performance, organization, and security.

Community is the 6th most starred project on GitHub and is visited by hundreds of thousands of developers every month.

Roadmaps Best Practices Guides Videos Store YouTube by Kamran Ahmed

Community created roadmaps, articles, resources and journeys to help you choose your path and grow in your career.

© · FAQs · Terms · Privacy


The leading DevOps resource for Kubernetes, cloud-native computing, and the latest in at-scale development, deployment, and management.