In this course we will see the configuration and verification of IPv4 addressing and subnetting. We will take an example of the practical cases for the understanding.
The bases of sub-networks.
Previously in a course we have seen IPv4 and subnet addressing. We learned about the different IPv4 address classes and their ranges and subnetting. In this part, we will see the practical cases.
Let’s take for example the LAN network of a company and you probably already know that companies employ many people. So they must have a large LAN. A large network thus implies a large area of distribution.
A network with a large broadcast domain is not optimal to manage and often causes security problems in case of an attack on the network.
The problem with a wide area network is that if one machine is attacked, the attack can spread quickly to other machines. It should also be noted that the quality of the network bandwidth will not be good and the management will not be optimal for the network administrator. Hence, the importance of having several subnets in an enterprise.
The question we have to ask ourselves here is how to create these subnetworks?
How to create subnets?
If you want to become a network administrator in a large company, you must know how to create subnets.
Creating subnets is essentially taking bits from the host part of the IP address and reserving them to define the subnet address. To have exactly the number of sub-networks, it is necessary to take into account the needs of the company.
To create a subnet, we will follow these three steps:
- Determine the number of network IDs required:
- One for each LAN subnet
- Determine the number of host IDs required per subnet:
- One for each host that needs an IP address
- Based on the above requirements, create the following:
- A single subnet mask for your entire network
We will take an example of a practical case to better understand.
Case study: creation of the sub-networks of a company.
A company has five (5) departments as follows:
- Human Resources Management with at least 15 users;
- Marketing with at least 18 users;
- Sale with at least 28 users;
- Engineering with at least 25 users;
- Directions with at least 14 users.
You are a network administrator and you are asked to design an optimal network for the company while taking into account the company’s evolution. How many subnets will you need for this business?
Already, we have five (5) departments, so we will have at least five sub-networks, one for each department. Now you have to take into account the number of users in each department. The sum of the company’s users is at least 100.
So we need at least 100 usable IP addresses for the subnets. And for this, a network with a CIDR of /24 can be more than enough to have over 100 usable IP addresses.
So we will take the network 192.168.1.0/24 with a total of 254 usable IP addresses.
Calculation of sub-networks of an enterprise
To have the 5 subnets, we will proceed as follows:
Step 1: Convert the network mask 192.168.1.0/24 to binary
/24 = 255.255.255.0 in binary :11111111.11111111.11111111.00000000
Step 2: Convert 5 to binary
We need 5 subnets, so we will convert 5 to binary.
5 in binary = 101, so 5 in binary counts in total 3 bits. This means that we have to borrow 3 bits on the host part of the mask of our network 192.168.1.0, the bits on the left. Remember that the first part of an IP address is used as a network address, the last part as a host address. Read more here.
We have: 11111111.11111111.11111111.11100000
In decimal: 255.255.255.224 or /27 in CIDR
Each subnet will have as mask 255.255.255.224 or /27.
Step 3: Find the ranges for each subnet
To find the number of usable IP addresses, use this formula:
2NS– 2 (With NS = Number of Subnets).
Our NS = 5, so 25 – 2 = 30
Each subnet will have 32 IP addresses. (i.e. one address for the network and one broadcast address, and 30 IP addresses usable by the clients).
So here are the ranges for each subnet:
|Network address||Usable address range||Broadcast address|
|192.168.1.0||192.168.1.1 – 192.168.1.30||192.168.1.31|
|192.168.1.32||192.168.1.33 – 192.168.1.62||192.168.1.63|
|192.168.1.64||192.168.1.65 – 192.168.1.94||192.168.1.95|
|192.168.1.96||192.168.1.97 – 192.168.1.126||192.168.1.127|
|192.168.1.128||192.168.1.129 – 192.168.1.158||192.168.1.159|
|192.168.1.160||192.168.1.161 – 192.168.1.190||192.168.1.191|
|192.168.1.192||192.168.1.193 – 192.168.1.222||192.168.1.223|
|192.168.1.224||192.168.1.225 – 192.168.1.254||192.168.1.255|
We had a total of 8 sub-networks, which is more than enough for our company.
Each department in our company will have a subnet. And each subnet will have a maximum of 30 users.
The calculation is done in the same way for all addresses (class A, B, C). To get through the calculations quickly, you can use the subnet checklist below.
Subnet checklist Subnet mask 24, 30, 26, 27, 29 and others
|CIDR||Subnet mask||Generic mask||Number of addresses||Number of usable addresses|