Configuration and verification of IPv4 addressing and subnetting

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.

Configuration and verification of IPv4 addressing and subnetting
subnet
Network architecture with a large broadcast domain

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.

Configuration and verification of IPv4 addressing and subnetting
subnet
Architecture of several networks connected together

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?

Solutions:

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 addressUsable address rangeBroadcast address
192.168.1.0192.168.1.1 – 192.168.1.30192.168.1.31
192.168.1.32192.168.1.33 – 192.168.1.62192.168.1.63
192.168.1.64192.168.1.65 – 192.168.1.94192.168.1.95
192.168.1.96192.168.1.97 – 192.168.1.126192.168.1.127
192.168.1.128192.168.1.129 – 192.168.1.158192.168.1.159
192.168.1.160192.168.1.161 – 192.168.1.190192.168.1.191
192.168.1.192192.168.1.193 – 192.168.1.222192.168.1.223
192.168.1.224192.168.1.225 – 192.168.1.254192.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

CIDRSubnet maskGeneric maskNumber of addressesNumber of usable addresses
/32255.255.255.2550.0.0.011
/31255.255.255.2540.0.0.122
/30255.255.255.2520.0.0.342
/29255.255.255.2480.0.0.786
/28255.255.255.2400.0.0.151614
/27255.255.255.2240.0.0.313230
/26255.255.255.1920.0.0.636462
/25255.255.255.1280.0.0.127128126
/24255.255.255.00.0.0.255256254
/23255.255.254.00.0.1.255512510
/22255.255.252.00.0.3.2551,0241,022
/21255.255.248.00.0.7.2552,0482,046
/20255.255.240.00.0.15.2554,0964,094
/19255.255.224.00.0.31.2558,1928,190
/18255.255.192.00.0.63.25516,38416,382
/17255.255.128.00.0.127.25532,76832,766
/16255.255.0.00.0.255.25565,53665,534
/15255.254.0.00.1.255.255131,072131,070
/14255.252.0.00.3.255.255262,144262,142
/13255.248.0.00.7.255.255524,288524,286
/12255.240.0.00.15.255.2551,048,5761,048,574
/11255.224.0.00.31.255.2552,097,1522,097,150
/10255.192.0.00.63.255.2554,194,3044,194,302
/9255.128.0.00.127.255.2558,388,6088,388,606
/8255.0.0.00.255.255.25516,777,21616,777,214
/7254.0.0.01.255.255.25533,554,43233,554,430
/6252.0.0.03.255.255.25567,108,86467,108,862
/5248.0.0.07.255.255.255134,217,728134,217,726
/4240.0.0.015.255.255.255268,435,456268,435,454
/3224.0.0.031.255.255.255536,870,912536,870,910
/2192.0.0.063.255.255.2551,073,741,8241,073,741,822
/1128.0.0.0127.255.255.2552,147,483,6482,147,483,646
/00.0.0.0255.255.255.2554,294,967,2964,294,967,294

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.