Published on

6,437 Points

In this article I will be showing you how to subnet the easiest way possible for IPv4 (Internet Protocol version 4). This article does not cover IPv6.

Keep in mind that subnetting requires lots of practice and time.

Keep in mind that subnetting requires lots of practice and time.

**How to subnet in a detailed way without any type of introduction that makes you feel bored.**

**I know I have promised you not to read too much, but let's be familiar with some concept before move on.**

**What is a subnet?**

Subnetting is basically just a way of splitting a TCP/IP network into smaller, more manageable pieces.

**What its purpose?**

The main purpose of subnetting is to help relieve network congestion such as traffic.

**What's the benefit?**

Prevents Unnecessary Broadcasts, Increases Security Options, Simplifies Administration and last but not least Controls Growth.

**What is binary?**

Binary describes a numbering scheme in which there are only two possible values for each digit: 0 and 1

In computer electrical terms 1 means ON 0 mean OFF.

**IPv4 Address Classes?**

**Class A** addresses are used for **very large networks **and always start with a leftmost bit being a zero.

A class A network can hold as many as 16,777,214 hosts.

Class | Private IP Address Range | Subnet Mask |
---|---|---|

A | 10.0.0.0 to 10.255.255.255 | 255.0.0.0 |

**Class B** These addresses are used for **medium sized networks** and always start with the leftmost 10 bits. lass B network can hold as many as 65,534 hosts.

Class | Private IP Address Range | Subnet Mask |
---|---|---|

B | 172.16.0.0 to 172.31.255.255 | 255.240.0.0 |

**Class C **These addresses are used for **smaller networks, **the one you have at home and always start with the leftmost bits 110. Each class C network can only hold up to 254 hosts.

Class | Private IP Address Range | Subnet Mask |
---|---|---|

C | 192.168.0.0 to 192.168.255.255 | 255.255.0.0 |

**What's VLMS?**

Variable Length Subnet Masking "**VLSM**" is a technique that allows network administrators to divide an IP address space into subnets of different sizes, unlike simple same-size Subnetting. In a way, means subnetting a subnet

****End of the introduction****

Now, looking at the diagram, we have **three LANs** connected to each other with** t****wo WAN** links. The first thing to look out for, is the number of** subnets** and number of **hosts**. In this case, an ISP allocated **192.168.1.0/24.** Class C

**R1** = 50 host**R2 **= 20 host

**R3** = 90 host

**2** WAN links.

We will try and subnet **192.168.1.0 /24** to sooth this network which allows a total number of 254 hosts I recommend you get familiar with this table below. Or at least learn the binary values.

**NOTE:** As a first rule we need to start using the network that require the more hosts until we reach the lowest.

**Let's begin with R3 with 90**** hosts. **

We are borrowing **1** bit to the value **128**** **on the table above, **why**? Remember, we need **90** **hosts **therefore **128** fits in the range. Now, our subnet is **192.168.1.0 /24** but after we've found an extra Bit we can do the follows:

**1- Convert to binary our old subnet mask adding the new borrowed bit.**

(**Bits**) 11111111.11111111.11111111.**1**000000 = 255.255.255.**128 **

Our new subnet is 192.168.1.0 **/25,** why **25?** If you count the **B****its** you will notice that you have a total of **25**.

So here is the outcome of what we did.

**R3 subnet****: **192.168.1.0 /25

**Network:** 192.168.1.0

**First IP:** 192.168.1.1

**Last IP:** 192.168.1.126

**Broadcast:** 192.168.1.127

Easy right? now keep in mind that **128** it's our next network for the following subnet below.

**R3 has been completed.**

**Let's work with R1 50 hosts:**

As we were working on **R3** we know for fact that our next network for **R1** is **128** and therefore we have our network ID and first IP.**Network:** 192.168.1.**128****First IP:** 192.168.1.129

Now, we need to find where this network ends. **R1** require **50 hosts**. If we look at the table above we know that **64** will give us the right range for the mentioned hosts, therefore we need to borrow 2 bits. so let's add more bits to our old subnet mask.

**1- Convert to binary our old subnet mask adding the new borrowed bit.**

(**Bits**) 11111111.11111111.11111111.**11**00000 = 255.255.255.**192**

Our new subnet is 192.168.1.128 **/26,** why **26?** If you count the **B****its** you will notice that you have a total of **26**.**So what's next?** we need to find our incremental.

"** Always remember that our incremental is the last Bit you have taken borrowed**". In this case

So let's do the math** 128+64=192**

**R1 subnet****: **192.168.1.128 /26

**Network:** 192.168.1.128

**First IP:** 192.168.1.129

**Last IP:** 192.168.1.190

**Broadcast:** 192.168.1.191

Getting in there right? now, keep in mind that **192** it's our next network for the following subnet below.

**R1 has been completed.**

**Let's work with R2 20 hosts:**

Again, as we were working on **R1** we know for fact that our next network for **R2** is **192** and therefore we have our network ID and first IP.**Network:** 192.168.1.192**First IP:** 192.168.1.193

Now, we need to find where this network ends. **R2** require **2****0 hosts**. If we look at the table above we know that **32** will give us the right range for the mentioned hosts, therefore we need to borrow 3 bits. So let's add more bits to our old subnet mask.

**1- Convert to binary our old subnet mask adding the new borrowed bit.**

(**Bits**) 11111111.11111111.11111111.**111**0000 = 255.255.255.**224**

Our new subnet is 192.168.1.192 **/27,** why **27?** If you count the **B****its** you will notice that you have a total of **27**.**So what's next?** we need to find our incremental.

"** Always remember that our incremental is the last Bit you have taken borrowed**". In this case

So let's do the math** 192+32=224**

**R1 subnet****: **192.168.1.192 /27

**Network:** 192.168.1.192

**First IP:** 192.168.1.193

**Last IP:** 192.168.1.1.222

**Broadcast:** 192.168.1.223

Even easier right? now keep in mind that **224** it's our next network for the following subnet below.

**R2 has been completed.**

**Let's move onto WAN 1 (2 hosts)**

Same methodology, my old subnet is **192.168.1.0 /24**, we need **2** host for each wan link right?. So our magic number will be **4 **and we need to borrow** 6 bits.**

**1- Convert to binary our old subnet mask adding the new borrowed bit.**

(**Bits**) 11111111.11111111.11111111.**111111**00 = 255.255.255.**252**

Our new subnet is 192.168.1.224 **/30,** why** 30****?** If you count the **B****its** you will notice that you have a total of **30**.**So what's next?** we need to find our incremental.

"** Always remember that our incremental is the last Bit you have taken borrowed**". In this case

So let's do the math** 224+4=228**

**WAN link subnet****: **192.168.1.224 /30**Network:** 192.168.1.224

**First IP:** 192.168.1.1225

**Last IP:** 192.168.1.1.226

**Broadcast:** 192.168.1.227

**Let's move onto WAN 2 (2 hosts)**

Same methodology, my old subnet is **192.168.1.0 /24**, we need **2** host for each wan link right?. So our magic number will be **4 **and we need to borrow** 6 bits.**

**1- Convert to binary our old subnet mask adding the new borrowed bit.**

(**Bits**) 11111111.11111111.11111111.**111111**00 = 255.255.255.**252**

Our new subnet is 192.168.1.228 **/30,** why** 30****?** If you count the **B****its** you will notice that you have a total of **30**.**So what's next?** we need to find our incremental.

"** Always remember that our incremental is the last Bit you have taken borrowed**". In this case

So let's do the math** 228+4= 232**

**WAN link subnet****: **192.168.1.228 /30**Network:** 192.168.1.228

**First IP:** 192.168.1.1229

**Last IP:** 192.168.1.1.230

**Broadcast:** 192.168.1.231

Phew! That was all. Now we know what subnet need each router we can start using it's respective IP addresses.**R3: **192.168.1.0 **/25 **

**R1:** 192.168.1.128 **/26**

**R2:** 192.168.1.192 **/27**

**WAN1:** 192.168.1.224 **/30**

**WAN2:** 192.168.1.228 **/30**

I hope this is been informative for all who wants to know how to subnet.

Later in the future I will be adding more post with class A and B, stay tuned

If you want to practice more I 100% recommend this website https://www.subnetting.net/Tutorial.aspx

This website will help you to practice subnet until you learn. Also they can teach you CCNA and CCNP for a minimum cost of 5 bucks a month what a deal right?

I learned a lot with this website and if you have any question they'd help you with your question to reach your goals.

Thank you for reading and if you enjoyed my article please endorse!

Ask questions about what you read

If you have a question about something within an article, you can receive help directly from the article author. Experts Exchange article authors are available to answer questions and further the discussion.