08-22-2012 10:02 AM - edited 03-07-2019 08:29 AM
Could someone explain me if the numbers mentioned below are on the same subnet or not.
172.16.100.1/ 21 and 172.16.100.2/ 21
/ 21 = 255.255.248.0
0---------7
8---------15
16
I know how to find the subnet mask, but in this particular case I have some doubt about how to know whether those numbers are located on the same subnet or not.
08-22-2012 10:31 AM
Hi Ealveesibm,
yes it is on the same subnet
this ip address range from 172.16.96.X - 172.16.103.255/21
Regards
Please rate if it helps.
08-22-2012 10:33 AM
Yes the are
172.16.100.1 and 172.16.100.2 are part of this subnet
172.16.96.0/21 which has the following
Network address: 172.16.96.0
Broadcast address: 172.16.103.255
Usable address range: 172.16.96.1 to 172.16.103.254
Total number of usable IP addresses is 2046
Hope this helps...remember to rate helpful post.
Mike
08-22-2012 12:28 PM
The trick to this or any subnetting question like this is to focus on the "interesting" octet. In your case, a /21 does indeed translate into a 255.255.248.0 subnet mask. The "interesting" part is the octet represented by the first part of the subnet mask that is NOT 255 starting from the left. In this case a .248 appears in the third octet of the subnet mask, so the interesting octet in the IP will also be the third octet.
IP 172.16.100.1 Third octet = 100. This is the interesting octect.
To determine what IP addresses are included in a given subnet, you would begin by finding the block size. The block size is simply the increment that the 'interesting' octect must be increased by to arrive at the next subnet network address beginning at 0. To find the block size, simply subtract the value in the interesting octect of the subnet mask from 256.
in this case... 256 - 248 = 8
Also worth noting, is that dividing this number (8) into 256 gives you the total number of networks of that size available to you with that subnet mask.
So 256/8=32, this means that 172.16.0.0 can be broken down into 32 /21 networks beginning with 172.16.0.0.
To figure out if your 2 IPs are in the same network, you have to list out all the networks by block size by first setting the "interesting" octet and any trailing octets to 0. In this case we begin with 172.16.0.0 and increase the 3rd octet by 8 until you get to the blocks that contain the IPs in question.
So...
172.16.0.x
172.16.8.x
172.16.16.x
...
...
...
172.16.96.x
<---- 172.16.100.1 and 172.16.100.2 fit here
172.16.104.x
So the IPs 172.16.100.1 and 172.16.100.2 are both in the 172.16.96.0/21 subnet which comprises IPs from 172.16.96.0 (network address) to 172.16.103.255 (broadcast address)
Hope this helps.
Rob
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide