How Do You Determine the Subnet Ranges for Class B IP Address

Jabad96

Distinguished
Jan 25, 2013
53
2
18,535
I need help understanding how to determine the ranges for each subnet for a class B IP address. I followed a particular method from a textbook which has shown example for a class C IP address.
I have a public IP address of 192.168.89.50/20 and want 4 subnets. The subnet mask is 255.255.240.0/20. So the network ID is 192.168.80.0/20. So far I determined the number of bits needed to be borrowed from the host portion to create 4 subnets, I used the formula 2^n = Y ( Y represents the number of subnets and n represents the number of bits to borrow) so 2^2=4. Now the modified subnet mask is 255.255.254.0/22. Im not sure if i would need to modify my network ID after having borrowed 2 bits from the host portion. but for now I will keep it at 192.168.80.0
I then needed to determine the network ID for each of the 4 subnets, and to do that I used what is called the magic number. I would subtract 256 - 254 ( the unusual octet from the modified subnet mask) = 2. I would use this number to add to the base Network ID to create the 2nd subnet network ID and so forth.
so..
Subnet 1 Network ID: 192.168.80.0
Subnet 2 Network ID: 192.168.80.2 +2
Subnet 3 Network ID: 192.168.80.4 +2
Subnet 4 Network ID: 192.168.80.6 +2
(I am not sure If calculating the network ID for each of the subnets were done correctly).
From here I am trying to determine the IP address range for each of the subnets above. I used the formula 2^h-2 = Z ( h represents the number oh host bits remaining) to determine the number of hosts available for each subnet. I have 10 bits remaining in the host portion since I borrowed 2 for the Network portion. This leaves me with 2 bits from octet 3 and 8 from octet 4. so 2^10-2 = 1022. Therefore the number of hosts available for each subnet is 1022. But how do I use this number to create the IP address ranges for each of the 4 subnets?

 
Solution
There are a ton of subnet calculators online. For example: http://www.subnet-calculator.com/

192.168.x.x are private Class C IP addresses. Your public IP addresses will be different. Reference: https://en.wikipedia.org/wiki/Private_network

Also, 192.168.89.50 is an IP address, not a subnet ID. The closest it comes to being a subnet id is with a /28, 192.168.89.48.

Maybe you need to verify your address information?

Given what you've provided, here's a couple of subnetting examples.

Ex 1: Subnet 192.168.80.0/24 into four subnets.

A /24 has 256 addresses. Dividing by four gives you four subnets with 64 addresses per subnet.

You want four subnets, so you need two subnet bits, so your mask is /26, 255.255.255.192.

1st Subnet...
There are a ton of subnet calculators online. For example: http://www.subnet-calculator.com/

192.168.x.x are private Class C IP addresses. Your public IP addresses will be different. Reference: https://en.wikipedia.org/wiki/Private_network

Also, 192.168.89.50 is an IP address, not a subnet ID. The closest it comes to being a subnet id is with a /28, 192.168.89.48.

Maybe you need to verify your address information?

Given what you've provided, here's a couple of subnetting examples.

Ex 1: Subnet 192.168.80.0/24 into four subnets.

A /24 has 256 addresses. Dividing by four gives you four subnets with 64 addresses per subnet.

You want four subnets, so you need two subnet bits, so your mask is /26, 255.255.255.192.

1st Subnet: ID = 192.168.80.0; B'cast = 192.168.80.63; Address range = 192.168.80.1 to 192.168.80.62
2nd Subnet: ID = 192.168.80.64; B'cast = 192.168.80.127; Address range = 129.168.80.65 to 192.168.80.127
3rd & 4th: add 64 and repeat.


Ex 2: Subnet the 172.16.80.0 Class B network with a /20

A Class B is a /16 (255.255.0.0) with 65536 addresses. Subnetting to a /20 (255.255.240.0) gives you sixteen subnets with 4096 addresses per subnet.

1st subnet: ID = 172.16.80.0; B'cast = 172.16.95.255; Address range = 172.16.80.1 to 172.16.95.254
2nd subnet: ID = 17.16.96.0; B'cast = 172.16.111.255; Address range = 172.16.96.1 to 172.16.111.254
3rd to 16th: Add sixteen & repeat.


Ex 3: You have a /20, you want four subnets, a /22.

Following on from Example 2. FYI, 172.16.x.x is a private, not public, address, but the pattern for public addresses would be the same.

You have 172.16.80.0/20. You want four subnets. So divide the /20 subnet into four.

Your mask is now a /22, 255.255.252.0. You'll have four subnets with 1024 addresses per subnet (4096/4).

1st subnet: ID = 172.16.80.0; B'cast = 172.16.83.255; Address range = 172.16.80.1 to 172.16.83.254
2nd subnet: ID = 172.16.84.0; B'cast = 172.16.27.255; Address range = 172.16.84.1 to 172.16.87.255
3rd & 4th: Add four and repeat.


I picked the first /20 from Ex 2 to make the example easy. However, you can see the pattern and do the math as needed for the other /20s - 172.16.96.0, 172.16.112.0, etc.

Use the IP subnet calculator I referenced to help (or one of the myriad of others). It makes the math a lot easier.
 
Solution
Thanks that solved my answer for Class B IP address Subnetting. But I also need help understanding how to determine the subnet address ranges for Class A IP address. I have an IP address this time of 172.0.0.0/8. How would you determine the range of the IP address for the same 4 subnets? If its same method as class b, I just want to confirm.
 

TRENDING THREADS