Determining the last address for a subnet mask (including number of hosts)
draught
Member Posts: 229 ■■■■□□□□□□
in CCNA & CCENT
I already know to subnet, but I have not seen this covered in any book (Odom,Lammle) and I can't even google an answer. This is apparently an obscure question possibly not covered on the CCNA.
What I'd like to know is how do I calculate what the last address for a given subnet mask.
For example
192.16.0.0 /17
192.16.0.0
192.16.0.128
192.16.1.0
....
192.16.127.254
How can I determine that the last address stops at 127 on the 3rd octet? Is there a formula or anything that can be used?
This is what's normally done in examples, this one is straight from Cisco
10.1.0.0 /20
10.1.255.254
and that is very wrong the actual end range is 10.1.15.254
I'd like to know find the actual last address. It could be figured out by doing many calculations but there must be a simple formula.
What I'd like to know is how do I calculate what the last address for a given subnet mask.
For example
192.16.0.0 /17
192.16.0.0
192.16.0.128
192.16.1.0
....
192.16.127.254
How can I determine that the last address stops at 127 on the 3rd octet? Is there a formula or anything that can be used?
This is what's normally done in examples, this one is straight from Cisco
10.1.0.0 /20
10.1.255.254
and that is very wrong the actual end range is 10.1.15.254
I'd like to know find the actual last address. It could be figured out by doing many calculations but there must be a simple formula.
Comments
-
Node Man Member Posts: 668 ■■■□□□□□□□For 10.1.0.0/20, the subnet mask is 255.255.240.0.
So the 3rd octet is the 'active' octet. The magic number is 16 (for 256-240)
the subnet ids are
0
16
32
48
64
80
96
.
.
.
the last ip in a range is that subnets broadcast ip. So subnet 10.1.0.0/20's broadcast is 10.1.15.255 because 10.1.16.0 begins the next subnet. So the last useable ip would be 10.1.15.254.
Its late, i hope this comes across clear. Good night
AFTERTHOUGHT - dont confuse the last useable ip, with the broadcast ip. -
draught Member Posts: 229 ■■■■□□□□□□This is hard for me to explain for me because I lack the vocabulary as we are all still learning.
the last ip in a range is that subnets broadcast ip. So subnet 10.1.0.0/20's broadcast is 10.1.15.255 because 10.1.16.0 begins the next subnet. So the last useable ip would be 10.1.15.254.
How do you determine that the last useable ip is 10.15.254? That is what I want to learn. Say you were just given a network ID, a subnet mask and then told to find that last usable ip how would you get the value?
Also tired and going to bed thanks, maybe I can explain this better in the morning. -
Xyro Member Posts: 62310.1.0.0/20
Steps:
1. Convert prefix to Subnet Mask ( = 255.255.240.0 )
2. Subtract the 240 from 256 (256 - 240 = 16)
3. The 16 gives you the next Subnet (10.1.16.0)
4. Subtract 1 ( = 10.1.15.255 ) to move back to end (Broadcast) of last Subnet
5. Subtract 1 again ( = 10.1.15.254 ) for last usable address
IMHO, it's better to learn to visualize where these ranges begin & end rather than to seek some type of working formula. -
draught Member Posts: 229 ■■■■□□□□□□Thanks I appreciate the help it really clears things up.
I don't know why I wasn't seeing that the increment/magic number is what determines the last usable address on the left octet. In other words I was making this much more complicated then it actually is!
Thanks! -
Xyro Member Posts: 623That's actually quite common.
As I've noted, 1 of the items that seems to make Subnetting difficult for so many is that they think it's more complex than it actually is.