# Subnetting: Detrmining Subnet Mask based on Desired Hosts?

Kikode
Member Posts:

**74**■■□□□□□□□□
Hello,

Just finished the Subnetting section on CBT nuggets. Started searching for more subnetting exercises online and found a great practice sheet. However the practice work Im doing now Gives me the Class of the network (A,B,C) and wants me to determine the best subnet mask to use based on the desired amount of subnets.

The first question is if you have a Class A network and wish to have 50 subnets what should the subnet be if you want the most hosts per network as possible. The answer is already goven as 255.252.0.0 however it doesn't explain the math process to get to this number and I'm curious how to do it. If any of you subnetting Gurus know more about this please help.

Thanks.

Just finished the Subnetting section on CBT nuggets. Started searching for more subnetting exercises online and found a great practice sheet. However the practice work Im doing now Gives me the Class of the network (A,B,C) and wants me to determine the best subnet mask to use based on the desired amount of subnets.

The first question is if you have a Class A network and wish to have 50 subnets what should the subnet be if you want the most hosts per network as possible. The answer is already goven as 255.252.0.0 however it doesn't explain the math process to get to this number and I'm curious how to do it. If any of you subnetting Gurus know more about this please help.

Thanks.

#### Categories

- 111.9K All Categories
- 362 Welcome Center
- 75 Announcements
- 10 Forum Rules of Engagement
- 204 Introduce Yourself
- 56 TechExams Support
- 88.6K Certification Preparation
- 131 Check Point: CCSA & CCSE
- 32.9K Cisco
- 21.6K CCNA & CCENT
- 370 CCDA & CCDP
- 9K CCNP
- 7 Cisco CyberOps
- 1.7K CCIE
- 535 Cloud Certifications
- 197 Amazon Web Services (AWS)
- 38 Azure
- 119 CCSP
- 78 Cloud+ & Cloud Essentials
- 15.5K CompTIA
- 5K A+
- 245 CASP+
- 114 CySA+
- 974 Linux+
- 4.4K Network+
- 35 PenTest+
- 266 Project+
- 3.9K Security+
- 335 Server+
- 251 Other CompTIA Certifications
- 1.2K EC-Council
- 586 CHFI
- 627 CEH
- 1.4K GIAC
- 47 IAPP
- 1K ISACA
- 28 CRISC
- 284 CISA
- 706 CISM
- 4.3K (ISC)²
- 666 CISSP
- 35 CSSLP
- 3.6K SSCP
- 926 Juniper
- 737 LPI, Red Hat & Linux Foundation
- 18.6K Microsoft
- 150 MCSA 2016 / MCSE 2016
- 161 Windows 10 exams
- 139 Windows 8 exams
- 1.4K Windows 7 exams
- 1.6K MCSA / MCSE on Windows 2012 General
- 2.3K MCTS / MCITP on Windows 2008 General
- 828 Exchange Server & Office Communications Server Exams
- 537 Other Microsoft Electives
- 349 MCSA/MCSE: Security
- 300 Microsoft Developers Certifications
- 485 SQL Server exams
- 161 Offensive Security: OSCP & OSCE
- 2K Other Security Certifications
- 345 Virtualization Certifications
- 231 Citrix Certifications
- 104 VMware
- 1.9K Other Certifications
- 14 Business Analyst Certifications
- 391 CWNP Certifications
- 873 ITIL Certifications
- 220 Project Management Certifications
- 85 Apple Mac OS X Certifications
- 62 Novell Certification
- 81 Oracle Certifications
- 52 Sun Microsystems Java Certification
- 114 Storage Certifications
- 6.7K General Certification
- 18K Education & Development
- 64 Colleges & Schools
- 89 Educational Resources
- 17.7K IT Jobs / Degrees
- 74 Professional Development
- 374 Cybersecurity
- 19 Auditing & Compliance
- 16 Cloud Security & IoT
- 14 Cryptography & PKI
- 37 Cybersecurity Management
- 5 Data Science & Machine Learning
- 9 Forensics
- 8 ICS/SCADA Security
- 30 Incident Response
- 7 Linux Security
- 11 OWASP
- 33 Pentesting
- 42 Security Awareness & Training
- 52 Security News & Breaches
- 11 Windows Security
- 20.2K General
- 33 Conferences & Events
- 21 Computer Gaming
- 7 Data Center
- 84 Classifieds
- 51 For Sale
- 6 Wanted (ISO)
- 16 Help Wanted
- 17 Just for Fun
- 17 Networking
- 17.5K Off-Topic
- 20 Scripting
- Show Us Your Tech!
- 23 Troubleshooting
- 2.4K Virtualization

## Comments

1,506128 (1 additional bit)

192 (2 additional bits)

224 (3 additional bits)

240 (4 additional bits)

248 (5 additional bits)

252 (6 additional bits)

254 (7 additional bits)

255 (8 additional bits)

Class A subnet mask is 255.0.0.0 (8bits); when subnetted to 255.252.0.0, you are adding 6 bits to be used for additional subnets, 2^6 = 64, this meets the requirements for 50 subnets, 5 bits (.248 ) won't work because 2^5 = 32 which is <50.

Also, you should know that IPv4 addresses are 32 bits, so 32-8-6=18 bits are available for addressing the hosts within each subnets. In other words, 255.252.0.0 will support 64 subnets each with 2^18 - 2 host addresses (You need to subtract 2 because of the network/broadcast addresses)

4,214■■■■■■■■□□To answer your question...

A class A address defaults to a 255.0.0.0 mask. The question is asking you to divide it so there is exactly 50 subnets. It doesn't say this directly, but if you divided it into 51 or more subnets, then you would no longer to have the maximum hosts possible.

2^x=50 is the equation that you need.

2^1=2 (not enough)

2^2=4 (not enough)

2^3=8 (not enough)

2^4=16 (not enough)

2^5=32 (not enough)

2^6=64 (more than enough, we only needed 50 subnet, but we are going to get 64)

So we must give 6 more bits to the network address.

Default mask: 11111111.00000000.00000000.00000000

New mask: 11111111.11111100.00000000.00000000

Convert the new mask into decimal, and you have 255.252.0.0

Decide what to be and go be it.4,214■■■■■■■■□□I should say that 2^x >= 50 is the equation that you are looking for. The reason being, if your boss asks for 50 subnets, and you give him 32, there is going to be trouble. If he asks for 50, and you give him 64, then you have an extra 14 subnets for if your company expands.

And yes, you could have borrowed 7 bits, and given him 128 subnets. But now you don't have the maximum number of hosts per subnet. As number of subnets increases, the number of potential hosts goes down. As the number of subnets decreases, the number of potential hosts go up.

Decide what to be and go be it.74■■□□□□□□□□I just remembered something I heard in the video. From 1995 and prior you had to subtract -2 from the subnets because of the routers. Perhaps this Question sheet wanted me to subtract two and therfore I would have had to go with 2^3=8 which would in fact give me 255.255.224.0

4,214■■■■■■■■□□There is probably the issue.

For me, I subtract 2 if I am given the number of hosts. But do not subtract 2 if given the number of subnets. You do not need to lose 2 subnets, but you will lose 2 possible addresses because of the network address and the broadcast address.

Just remember, that when a bit in the mask is a 1, it is used for the network and when it is a 0, it is used for the host. So when you are working on a problem that says you have a class B address and need to have 500 hosts per subnet you do the following.

2^x-2=500

2^x=502

x=9

Since you are working with hosts, this means that you need to have at least 9 0's.

So your mask could be anything from 255.255.0.0 to 255.255.254.0, but there will likely be a second part of the question to determine what the answer is, such as "while having the most number of subnets." (which would make the answer 255.255.254.0)

Just a note, I usually use shorthand to write subnet masks. 255.255.255.0 is the same as 11111111.11111111.11111111.00000000 but I will only usually write out the binary for the octet that the change occurs in. So for your initial problem, I would use something like 255.11111100.0.0 just to save time and space. I will only convert to full binary when I am finished with the problem. I'm not fluent enough with subnetting to look at 224 and instantly know that it is 11100000 so I work it out and write it down. If my way doesn't make sense to you, don't use it. There are a thousand ways to subnet, pick the one that works for you.

Decide what to be and go be it.74■■□□□□□□□□