subnets beginner hosts or subnets 1st?
macca1980
Registered Users Posts: 4 ■□□□□□□□□□
in CCNA & CCENT
ok, easy question.
Say I had to subnet an address in to 2 different subnets with 30 hosts in each subnet.
for example
192.168.1.0
255.255.255.0
What do i work out 1st how many subnets or how many hosts?
is it 2 to the power of 22 to work out how many bits to borrow for the subnets?
in this eg is my new mask 255.255.255.192 192.168.1.0/26?
How do i work out how many hosts i have now?
sorry if this is super easy but I thought i had it yesterday but today its vanished from my mind.
EDIT ** is it 64 hosts???
192.168.1.0  64 192.168.1.65 128 hmmm....
Say I had to subnet an address in to 2 different subnets with 30 hosts in each subnet.
for example
192.168.1.0
255.255.255.0
What do i work out 1st how many subnets or how many hosts?
is it 2 to the power of 22 to work out how many bits to borrow for the subnets?
in this eg is my new mask 255.255.255.192 192.168.1.0/26?
How do i work out how many hosts i have now?
sorry if this is super easy but I thought i had it yesterday but today its vanished from my mind.
EDIT ** is it 64 hosts???
192.168.1.0  64 192.168.1.65 128 hmmm....
Comments

phantasm Member Posts: 995Well if you wanted to have just 30 hosts per subnet then a /27 would suffice. With a /27 you would have the following:
Subnet 1:
Network: 192.168.1.0
Usable: 192.168.1.1 to 192.168.1.30
Broadcast: 192.168.1.31
Subnet 2:
Network: 192.168.1.32
Usable: 192.168.1.65 to 192.168.62.
Broadcast: 192.168.1.63
Of course it is better to have more hosts than you would need to allow for expansion. In that case I would use a /26 which would allow for 62 usable hosts per subnet."No man ever steps in the same river twice, for it's not the same river and he's not the same man." Heraclitus 
ajmatson Member Posts: 289Well if you wanted to have just 30 hosts per subnet then a /27 would suffice. With a /27 you would have the following:
Subnet 1:
Network: 192.168.1.0
Usable: 192.168.1.1 to 192.168.1.30
Broadcast: 192.168.1.31
Subnet 2:
Network: 192.168.1.32
Usable: 192.168.1.65 to 192.168.62.
Broadcast: 192.168.1.63
Of course it is better to have more hosts than you would need to allow for expansion. In that case I would use a /26 which would allow for 62 usable hosts per subnet.
Phantasm hit it right on the nail. If you are specified to plan for only 30 hosts with no needs for expansion, the /27 will give you exactly the 30 hosts needed (/27 is the first three bits turned on, which is the 32 spot. 322=30 hosts) so you would do the hosts first. If you need 2 networks with at least 30 hosts then the /26 is the wiser choice because it leaves the room for expansion.
I have missed questions on practice exams by not paying attention to the wording which is important.Working on currently:
Masters Degree Information Security and Assurance (WGU) / Estimated 06/01/2016
Next Up: CCNP Routing Exam  Certified Ethical Hacker Exam
Cisco Lab: ASA 5506X, GNS3, 1x 2801 Router, 1x 2650XM, 1x 375048TSE switch, 2x 3550 EMI Switches and 1x 2950T swtich.
Juniper Lab: 1x SRX100H2, 1x J2320 (1GB Flash/1GB RAM, JunOS 11.4R7.5), and 4 JunOS Firefly vSRX Routers in VMWare ESXi 5.1 
macca1980 Registered Users Posts: 4 ■□□□□□□□□□Thanks for replies folks.
another question... forgetting about hosts just now what if i needed say 4 subnets? What is the way to initially split the network into 4?
Sorry if these questions are a bit simple but i need to get a handle on it, starting Uni soon & want to have the a rough outline of the cisco stuff before i get there so i can concentrate more on learning instead of getting stuck at subnets for ages.
thanks 
brewd Member Posts: 56 ■■□□□□□□□□If you want four subnets, for a class C network address you would want to use a /26 subnet mask (2^2=4) 255.255.255.192.
Subnet 1
Network: 192.168.1.0
Broadcast: 192.168.1.63
Usable: 192.168.1.1  192.168.1.62
Subnet 2
Network: 192.168.1.64
Broadcast: 192.168.1.127
Usable: 192.168.1.65  192.168.1.126
Subnet 3
Network: 192.168.1.128
Broadcast: 192.168.1.191
Usable: 192.168.1.129  192.168.1.190
Subnet 4
Network: 192.168.1.192
Broadcast: 192.168.1.255
Usable: 192.168.1.193  192.168.1.254
If you next wanted to have 8 networks, simply turn on another bit of the subnet mask, /27 aka 255.255.255.224. This would give you 2^3=8 networks. Each time you enable another bit you double the networks and essentially cut in half (2^22) the number of available hosts on the subnetted networks.
Check out this link to Linglom's Blog: IP Subnetting if you still feel unclear. I had a tough time with subnetting until I read this article and it suddenly opened my eyes to the process. Once you've got it subnetting is not that bad. Hope this helps. 
sxzaq1 Member Posts: 20 ■□□□□□□□□□Okay, I'm learning too, but I'll try. For now, each time is sit down to attempt subnetting problems, the first thing I do is write the following chart from memory:
.128 .192 .224 .240 .248 .252 .254 .255
1 2 3 4 5 6 7 8
9 10 11 12 13 14 15 16
17 18 19 20 21 22 23 24
25 26 27 28 29 30 31 32
128 64 32 16 8 4 2 1 BLOCK SIZE
0
64
128
192
.192 = /26 means: [after 0, the blocks increase by 64]:
.0 is the 1st subnet,
.64 is the 2nd subnet,
.128 is the 3rd subnet,
.192 is the 4th subnet and last.
After doing it this way for a while, I've caught myself using a mental shortcut: example: if the prefix is /28, you know that's 4 more than 24, so it's the fourth value in the last line of the chart. That is: 16, the blocks go up in multiples of 16, don't forget 0!
Memorizing the first and last lines of the chart (and learning what they mean) is the key, or at least it was for me. 
sxzaq1 Member Posts: 20 ■□□□□□□□□□rows still don't align properly, even after edit, hope you can figure it out

macca1980 Registered Users Posts: 4 ■□□□□□□□□□Ok so to work out how many subnets its 2 to the power of X many subnets you need?
To get number of hosts do you you the last borrowed bit?
I have been mucking about with packet tracer trying to get this clear.
I will have a look at the links you provided.
Thanks for all your help folks much appreciated. 
sxzaq1 Member Posts: 20 ■□□□□□□□□□Ok so to work out how many subnets its 2 to the power of X many subnets you need?
To get number of hosts do you you the last borrowed bit?
I have been mucking about with packet tracer trying to get this clear.
I will have a look at the links you provided.
Thanks for all your help folks much appreciated.
See also:YouTube  Cisco Training CCNA IP Addressing  Part 5 of 5
I think there are 9 videos total, find video 1 and go from there, I must've watched the whole set 5 times till I cracked it. 
brewd Member Posts: 56 ■■□□□□□□□□That is the correct formula, yes, to determine the # of bits required for a desired number of subnets. To do this quickly, I just try to remember that 2^5=32, 2^8=256 and 2^10=1024. Knowing those makes it easy to fill in any holes in between and you hardly ever need a subnet with more networks or hosts.
Don't forget to determine the hosts it's the same formula, but you'll need to subtract 2 from the answer to account for the network and broadcast address. This is easy to forget when you're trying to do it quickly in your head.
Sxzaq1 also raises a good point about knowing your subnet mask octet ranges: 128, 192, 224, 240, 248, 252, 254 & 255. If you can remember these and your exponents of 2^x then you're very close to acing subnetting and being able to perform this all without writing it down.
One good thing to read about in that URL link I posted, to quickly determine block size, subtract the "interesting" byte value of the subnetting octet's mask from 256 and you'll know the number of addresses available for hosts. For an explanation of "interesting" check out the link.
For example:
192.168.1.82/26, Mask: 255.255.255.192
256192=64 (642=62, so 62 total usable host addresses)
Also
192.168.5.222/27, Mask: 255.255.255.224
256224=32 (322=30)
This gets a little more complicated when using a Class A or B network, but it's all described well in the article. Post any more questions and I'll be happy to help. This ends up helping me trying to construct the post in a manner that might actually be helpful, hopefully that's the case. 
sxzaq1 Member Posts: 20 ■□□□□□□□□□Also, get Wendell Odom's ICND 1, work all of the problems in the appendix. I created my own Excel workbook  sort of  templates, just to have a structured workspace, that is a neat place to write the numbers and not have clutter. Basically just grids of various sizes.

wbosher Member Posts: 422A good site to practice subnetting  subnettingquestions.com  Free Subnetting Questions and Answers Randomly Generated Online
Spend a little time every day doing these, and it will help you get the processes cemented in your brain. 
jojopramos Member Posts: 415Well if you wanted to have just 30 hosts per subnet then a /27 would suffice. With a /27 you would have the following:
Subnet 1:
Network: 192.168.1.0
Usable: 192.168.1.1 to 192.168.1.30
Broadcast: 192.168.1.31
Subnet 2:
Network: 192.168.1.32
Usable: 192.168.1.65 to 192.168.62.
Broadcast: 192.168.1.63
Of course it is better to have more hosts than you would need to allow for expansion. In that case I would use a /26 which would allow for 62 usable hosts per subnet.
phantasm is correct on this but I will just correct some typos for the benefit of subnetting newbies like me...it should be 33 instead of 65
on Subnet 2
Network: 192.168.1.32
Usable: 192.168.1.33 to 192.168.62.
Broadcast: 192.168.1.63 
froufrou123 Member Posts: 29 ■□□□□□□□□□First define the class of block you're given, in ur case its class C which has default sub mask of 255.255.255.0
128 64 32 16 8 4 2 1
1 1 1 0 0 0 0 0
gives u 224; so ur subnet mask is 255.255.255.224
now suppose u need 64 hosts
128 64 32 16 8 4 2 1
1 1 0 0 0 0 0 0
but we reserve 2 host addresses for broadcast and subnet. So, we cant use 255.255.255.192; we gotta step back a bit in our chart; ending up with 255.255.255.128 with a few excessive hosts we'll have to waste or keep for later growth.
hope it helps 
macca1980 Registered Users Posts: 4 ■□□□□□□□□□ok i think i got wrong end of stick somewhere....
is the 2 to the power of * which equals number of subnets.
eg i need 4 subnets.
Do I :
2 to the power of 4?
or
2 to the power of 2(borrowed bits also?) = 4 (required subnets)?
Thanks for your patience.:) 
MosGuy Member Posts: 195ok i think i got wrong end of stick somewhere....
is the 2 to the power of * which equals number of subnets.
eg i need 4 subnets.
Do I :
2 to the power of 4?
or
2 to the power of 2(borrowed bits also?) = 4 (required subnets)?
Thanks for your patience.:)
It would be the latter i.e based on borrowed bits. So you'd need two (2^2=4), mask of 192 / 64 block size.
XPS 15: i76700HQ, 256 pcie ssd, 32 GB RAM, 2 GB Nvidia GTX 960m, windows 10 Pro
Cert in progress: CCNA (2016 revision)