Subnetting in Decimal (Fast Way)

This is DOPE! Rene is a real beast!

1 Like

Hi Rene,

I see that you have mentioned that 192.168.1.0 is the first subnet and 192.168.1.128 is the second subnet. I am confused as to why we didn’t we use 192.168.0.0 as first subnet. Why is the ZERO subnet missing?? Please help.

Hello Ajeet

When doing subnetting, the first thing you define is the full range of addresses that you begin with. This is typically what the ISP will give you or what you have to work with within your network. From this range of addresses, you begin subnetting into smaller subnets.

In Rene’s example, the original network range that you are given is the 192.168.1.0 subnet with a mask of 255.255.255.0. This is provided by definition. You are then asked to subnet this range. In the lesson, the you are initially asked to use a subnet mask of 255.255.255.128. So by definition again, the very first subnet will be 192.168.1.0 because that is what you have been given and the second will be 192.168.1.128.

Now if you were given the initial range of 192.168.2.0/23 and asked for example to use a subnet mask of 255.255.255.192, then the first subnet would be 192.168.2.0, again because that’s what you are given to start with. The next would be 192.168.2.64, then 192.168.2.128 etc…

I hope this has been helpful!

Laz

Thank you for replying Lazaros.

In your second paragraph, you have mentioned that if we were to subnet 192.168.1.0/24 to subnet mask /25, then the first subnet should be 192.168.1.0. Why can’t we take the first subnet as 192.168.1.128 - This can be the network address and the broadcast address can be 192.168.1.255.
Also, I think in the first line of 3rd paragraph, it should be 192.168.2.0/26. Please correct me if I am wrong.
Adding to it, I would also like to know if VLSM is enabled on all the routers by default or we have to enable it. Because, I guess the router will assume fixed size subnets if we don’t enable VLSM.

Thanks

Hello Ajeet

If you are originally given a range of 192.168.1.0/24, and you begin dividing it into smaller subnets, the first subnet is always the lowest. So if we begin dividing this into /28 subnets for example, the first subnet will be 192.168.1.0/28. The second will be 192.168.1.16/28, then 192.168.1.32 and so on. Of course, each subnet has its network address, first, last and broadcast addresses as well…

Actually, I meant /23. 192.168.2.0/23 gives us a range of addresses from 192.168.2.0 to 192.168.3.255.
If we subdivide this into smaller subnets using the 255.255.255.192, then we get the following subnets:

192.168.2.0/26
192.168.2.64/26
192.168.2.128/26
192.168.2.192/26
192.168.3.0/26
192.168.3.64/26
192.168.3.128/26
192.168.3.192/26

The example I used was to show that you start with an original range, and depending on the sizes of the subnets you want to make, you can divide that into smaller pieces.

I hope this has been helpful!

Laz

I think there is a small mistake in the class A part. Broadcast address of subnet 3 should be 10.191.255.255 instead of 10.192.255.255 (a bit further up it is indeed typed as ‘10.191.255.255’).

image

Very good lesson btw! I did Cisco courses at a uni and up to today did not understand how to calculate the IP address range with large subnetworks, but now I really do understand. Thank you!

1 Like

Hello Marit

Thanks for pointing this out as well. Will let @ReneMolenaar know.

Laz

Thanks Marit, fixed this!

Hi,
I just want to no if i do well for the exercise it’s possible to have
Subnet16 on classC 192.168.1.262144??
Thx,
Raoul,

Hello Raoul

Yes, it is possible to have a /16 subnet on a network like 192.168.1.144 (I’m assuming the 262144 you wrote was a typo). Actually, you can have any subnet size on any range of IP addresses if you are working in a classless environment. So 192.168.1.144/16 simply means that you have the following:

192.168.0.0 is the network address
192.168.0.1 is the first host address
192.168.255.254 is the last host address
192.168.255.255 is the broadcast address.

Using Cisco equipment, you have no problem in configuring something like this. However, some other vendors, especially commercial grade routers, access points, switches, IP cameras, and other devices may have a restriction on the size of the subnet. Many of these devices have a classless networking behaviour hardwired into their circuitry. In such cases you will have to conform to whatever limitations you have.

I hope this has been helpful!

Laz

Oh yeah!! This method is rocking Andrew!! Much obliged. Rene’s method helped me understand the fundamentals and this really tops it off. Thanks fellas!!

1 Like

Hello Rene’
I seem to have run across an interesting problem. We have a customer who wants to use 172.16.20.0/25. According to my quick calculations and online calculators we should get 512 subnets with 126 hosts per subnet. But I’m having an issue coming up with 512 subnets. I’m starting from zero and going up by a block size of 128 which I’m seeing as only 2 networks. What in the world am I doing wrong?

Thanks.

Hello Willie

The 172.16.20.0/24 subnet will give you 128 IP addresses (126 host addresses) as you correctly stated. How many of these subnets you will have depends on the original address space that you are working with. That has not been defined, at least not in your post, so there’s no way to answer the question. However we can work backwards, and in order to get 512 subnets of 126 host addresses each, you would need to have the following original address space:

172.16.0.0/16 which is the range of 172.16.0.0 - 172.16.255.255

And the subnets you would get are the following:

1] 172.16.0.0/25
2] 172.16.0.128/25
3] 172.16.1.0/25
4] 172.16.1.128/25
5] 172.16.2.0/25
6] 172.16.2.128/25
7] 172.16.3.0/25


41] 172.16.19.128/25
42] 172.16.20.0/25
43] 172.16.20.128/25


511] 172.16.255.0/25
512] 172.16.255.128/25

How was this calculated? Lets look at the original address space, but with the last two octets in binary:

172.16.00000000.00000000 /16

Now by creating subnets of /25, you’re taking the last 7 bits (32-25) and using them as host bits:

172.16.00000000.00000000 /16

Now in order to get 512 of these subnets, we need 9 bits (2^9 = 512). So we use the next nine bits over for each subnet:

172.16.00000000.00000000 /16

Remember that in order to determine the total number of subnets you will get, you must first define your original address space.

I hope this has been helpful!

Laz

Thank you so much for your speedy reply. Sorry for asking an incomplete question but working backwards, you explained it completely.
Thanks.

1 Like

This topics teach us to divide the block 256 by the number of subnets to have the minor blocks, example 256 I want two subnets, so starts at 0 and next network will be 128… but what happens if I need 6 subnets, like the exercise below?
“Your manager would like you to subnet the 129.65.0.0 network into six different networks.
What is your new subnet mask?”

I tried to get the third octect (256) divide by 6, but is not an integer number. Maybe should add an example like this in the lesson.

thanks you so much, waiting for the answer

Hello Victor

A network of 129.65.0.0/24 has a range of 256 addresses. Now if you want to subnet this network into six smaller networks, then you can do one of two things. Ether create equal size subnets or create subnets of different sizes. In the second case, you can choose your sizes so that all IP addresses in the original network are being used. In the first case, you will have some unused subnets left over.

Now because this particular question doesn’t state that you must use all the original address space, nor does it say to use different sizes, I assume it means “create as many equal size subnets as are necessary to accommodate the six that you need”.

Now a range of 256 addresses can only be subnetted equally using particular numbers. Specifically:

  • 2 subnets of 128 addresses each
  • 4 subnets of 64 addresses each
  • 8 subnets of 32 addresses each
  • 16 subnets of 16 addresses each
  • 32 subnets of 8 addresses each
  • 64 subnets of 4 addresses each

Now which option gives you the largest number of addresses per subnet and can accommodate 6 networks? The 8 subnets of 32 addresses each is the correct answer, but you will have two unused subnets of 32 addresses each left over .

Consequently, you must divide by 8 in order to get enough networks to accommodate your needs.

I hope this has been helpful!

Laz

Hi Lazaros,

Great answer, thank you so much for your clear explanation!!!

1 Like

Hi Rene
For class A address , the subnet mask is 255.0.0.0 . But I have seen for class A address , they use /24 which is 255.255.255.0. Can u pls explain this?

Hello Ananth

Classful IP addressing is the method for subnetting that was initially used when IPv4 was initially created. This simplified subnetting since each specific range of addresses could only have a specific subnet size. So you knew that the 15.22.5.5 address must have a subnet mask of 255.0.0.0 and 201.56.89.89 must have a subnet mask of 255.255.255.0.

However, this scheme was not scalable, as many millions of addresses were wasted especially within class A subnets.

For this reason, classless subnetting was introduced. This is where the Variable Length Subnet Mask or VLSM comes in. This essentially means that the “rule” that states that class A addresses can only have a class A subnet is relaxed. You are allowed to further subnet a class A address.

This has allowed a more efficient usage of the IPv4 address space. That’s why you see class A address spaces with subnet masks other than /8. In a classless network environment, the terms Class A, Class B, and so on are now used only as a reference and not as a concept that constrains the subnet mask size.

I hope this has been helpful!

Laz