CIDR Subnetting: Understanding the Basics and Beyond
Lovely Kumari
DevOps & Cloud Engineer | Freelancer | AWS | Azure | Terraform | Kubernetes | Docker | CI/CD | GitLab | From Crowd to Cloud????
Subnetting is the process of dividing a large network into smaller, more manageable subnetworks. CIDR, which stands for Classless Inter-Domain Routing, is a popular subnetting technique that allows network administrators to create flexible and efficient networks. In this blog, we will explore the basics of CIDR subnetting, from easy concepts to advanced techniques.
What is CIDR Subnetting?
CIDR subnetting is a method of dividing an IP address space into smaller subnetworks, without the limitations of traditional subnetting methods. Traditional subnetting is based on classes of IP addresses, such as Class A, Class B, and Class C. CIDR, on the other hand, allows for a more flexible and efficient allocation of IP addresses.
To subnet a network, you need to understand the following basic concepts:
Network ID: The network ID is the portion of an IP address that identifies the network.
Host ID: The host ID is the portion of an IP address that identifies the device on the network.
Subnet mask: The subnet mask is a 32-bit number that divides an IP address into network and host portions. It determines which part of an IP address is the network ID and which part is the host ID.
Subnet: A subnet is a smaller network within a larger network that has its own unique network ID and host range.
How does CIDR work?
CIDR subnetting uses a subnet mask to determine which part of an IP address is used for the network ID and which part is used for the host ID. The subnet mask is represented in binary notation and is used to perform bitwise operations with the IP address to determine the network ID.
领英推荐
What is a CIDR Notation?
CIDR notation is a shorthand method for representing the subnet mask in IP addresses. It is represented by appending a forward slash (/) followed by a number that indicates the number of bits used for the network ID. For example, the CIDR notation for a subnet mask of 255.255.255.0 is /24, as there are 24 bits used for the network ID.
CIDR notation makes it easier to represent IP address ranges and subnets. For example, a network with an IP address range of 192.168.0.0 - 192.168.255.255 can be represented as 192.168.0.0/16, indicating that the first 16 bits are used for the network ID.
Let's look at some examples to illustrate CIDR subnetting.
Example 1: Subnetting a Class C network
Suppose we have a Class C network with an IP address of 192.168.10.0 and a subnet mask of 255.255.255.0. We want to divide this network into four subnets.
Step 1: Determine the number of bits needed for the subnets. Four subnets require two bits, as 2^2 = 4.
Step 2: Create a subnet mask with the required number of bits. In this case, we need a subnet mask of 255.255.255.192, which has the first 26 bits set to 1.
Step 3: Assign the subnets.?
The first subnet has a network ID of 192.168.10.0/26
The second subnet has a network ID of 192.168.10.64/26
The third subnet has a network ID of 192.168.10.128/26
The fourth subnet has a network ID of 192.168.10.192/26.
DevOps Engineer | AWS | Azure | 3+ Years of Experience in CI/CD & Cloud Automation | K8s | IaC(Terraform) | Python Scripting
2 年Explained Easily ??
Sr Manager
2 年Cheers Lovely Kumari
Securing Application | Shifting Left | DevSecOps
2 年Thank you for sharing this