1

Trying to learn how to subnet but having hard time understanding. Trying to subnet 10.20.0.0/16. So I understand the subnet mask is default for class A 255.0.0.0 but it has been subnetted to 255.255.0.0.

I am trying to add 300 hosts but They don't fit as 10.20.0.1-300.. So does that mean I fit as many hosts into 10.20.0.255 and then the rest into 10.20.1.45?

2 Answers2

1

Classful addressing was deprecated more than 20 years ago. Subnetting is done in prefixes these days.

The prefix length is the number of bits at the start of the address that stay the same. Subnet mask 255.255.255.0 in binary is 11111111.11111111.11111111.00000000 correspond to prefix length 24 (count the 1s), 255.255.0.0 corresponds to 16 etc. For 300 hosts you need a network with prefix length 23Blues (or shorter): 23 bits fixed leaves 9 bits for numbering hosts, which gives you 512 addresses. The first and the last address are reserved, the rest you can use.

If we take 10.20.0.0/23 as example:

Network address and mask are:

00001010.00010100.00000000.00000000
11111111.11111111.11111110.00000000

We don't change the bits marked as fixed by the prefix. That gives us this range of addresses:

00001010.00010100.00000000.00000000
00001010.00010100.00000001.11111111

Which is 10.20.0.0 to 10.20.1.255. The first and last address are reserved for network and broadcast address, the rest (including 10.20.0.255 and 10.20.1.0) are normal addresses available to be used.

Sander Steffann
  • 6,670
  • 22
  • 33
1

as you said class A 255.0.0.0 but it has been subnetted to 255.255.0.0 so what you post is not class A it is simply classless network . usual subneting method in classless network is as following .

                              NETWORK | SUBNET | HOST 
  • for the network part (which is the part won't change ever) -> 10.20.X.X
  • for the part of SUBNET it can take any number -> here we need to ask a question . it is mandatory to but all of the 300 users in single network or it can be divided into two subnets or more ???
  • for the part of host (the most important) -> we need to ask very impotent question . in how many bits we can represent 300 host ???
    in 7 bits maximum we can represent 126 host in 8 bits maximum we can represent 254 host . in 9 bits we can represent 510 host .

so you may use one subnet with 9 bit representing the host in form of 10.20.0.0/23 , so you will obtain (510-300=210 extra IP)

or may you use 3 subnets with 7 bits represent the users in form of
10.20.0.0/25 ->126 host
10.20.0.1/25 ->126 host
10.20.1.0/25 ->126 host
and here you will get (3*126-300=78 extra IP)

Gadeliow
  • 3,434
  • 10
  • 23
  • Alright I am trying to understand a little more. Say i had 4 VLANS. Students, teachers, servers, admins.. Could I set them up as 10.20.1.1-255 (students, 10.20.2.1-255(teachers), 10.20.3.1-255(servers), etc? Or would this be wrong? Each one would have a mask appropriate for the amount of hosts for each network. So for students if I had 140 devices I could use a /26 mask giving myself up to 254 IPs. But if I only needed 10 servers I would do a /28 mask? – Jack Hammer Sep 21 '15 at 10:41
  • totally right ,why not, once you turn to classless you are free of subnet what you want as you want . the concern here is you will never obtain the exact number of host as you need by adjust the subnet , because you deal with binary not decimal – Gadeliow Sep 21 '15 at 11:21