In this Cisco CCNA training tutorial, we’re going to take on a stage by subnetting larger networks. We’re going to look at subnetting our Class A and our Class B networks. Scroll down for the video and also text tutorial.

#### Subnetting Class A and Class B Networks Video Tutorial

### Alex Hixson

Passed my exam, never had to touch my book! I tried 3 other trainers before you, you are the best. A special thanks to the only instructor that broke things down to where I could understand everything.

**Example 1 – Class B on 4**^{th} Octet

^{th}Octet

For our first example, we've been allocated a Class B network with an IP address of 135.15.0.0/16.

If we subnet that into /29 subnets, we're going to have 3 bits for host addressing. We've got 32 bits in the address, 32 minus 29 gives us our 3 bits.

This will allow us 6 hosts per network because 2 to the power of 3 is equal to 8 minus 2 gives us 6 hosts. So, a /29 will give us 6 available hosts per network even if we're using a Class A, B, or C. It will be the same.

In a Class B /16 range we're going to have 13 bits for the network address. If it was a Class C, we would only have 5 bits for the network address because 29 minus 24 has a difference of 5.

It would give us 5 bits but since it is Class B, we've got those extra 8 bits. 5 plus 8 gives us 13 bits and 2 to the power of 13 is going to allow a total of 8,192 subnets.

For the IP address, 135.15.10.138/29, what would be the network address, the broadcast address, and the range of valid IP addresses?

We've got the IP address and the subnet mask. We're putting a line after the /29 and the line is going in after the 8. In the top right, we've got ones under 128 and 8. We add those two together which is equal to 136.

So, the network address is 135.15.10.136. The line is after the 8, so we add 8 to 136 and that is 144. The next network address would be 135.15.10.144. Now, if the next network address is 144, then the broadcast address is 135.15.10.143.

The valid addresses for our hosts fall between the network address and the broadcast address. So that's 135.15.10.137 up to 135.15.10.142.

**The Magic Number Method – Example 1**

Another popular way of calculating the network address, the broadcast address, and the host addresses is by using the magic number method.

You'll see this being cited in quite a few places on the internet. This one is very handy if you've been given the subnet mask in dotted-decimal notation rather than with a slash.

So a /29, if we wrote that out in dotted decimal notation it's 255.255.255.248. What you do with the magic number is you take the value in the octet that is being subnetted, so 248 in this case, you take that away from 256. 256 minus 248 gives you 8, and now you know that the network addresses are going to go up in blocks of 8.

In that example, our address was 135.15.10.138. So we find which block of eight is closest to that which is 136. The network address must be 135.15.10.136. Then, we add 8 to the 136 to get the 144 and we know that that is the next address block.

**Example 2A – Class A on 4**^{th} Octet

^{th}Octet

In this example, we'll do a Class A where we're going to subnet on the fourth octet. We've been allocated 68.0.0.0/8. If we apply with the subnet mask 255.255.255.240, how many subnets do we have, and how many hosts per network?

We were given a dotted-decimal 255.255.255.240, which is the same as a subnet mask of /28. We put the line in after 16 and we can see that we've got 4 bits for our host addressing. So that's 2 to the power of 4 equals 16 minus 2 and it gives us 14 hosts per network.

We have 20 bits for the network addresses which is the difference between the default /8 and the /28 that we're using. 2 to the power of 20 works out a little over one million subnets.

**Example 2B – Class A on 4th Octet**

For the IP address, 60.15.10.75/28, what are the network address, the broadcast address, and the range of valid IP addresses?

For this example, the line is after the 16 when we draw it out. Therefore, the network address is going to go up in multiples of 16. The network address is going to be 60.15.10.64 and if I add 16 to that, the next network address will be 60.15.10.80.

Our broadcast address here must be 60.15.10.79. And the range of valid host addresses falls between the network address and a broadcast address, 60.15.10.65 up to 60.15.10.78.

**The Magic Number Method – Example 2B**

Another way you can do it is by using the magic number. In this is way, you can do it quite quickly in your head. Especially if you were given a subnet mask in dotted-decimal notation rather than in slash notation.

Even if you have been given a slash notation, you can convert it to dotted decimal first. Our example was a /28 which is 255.255.255.240. A /28 is going to use the first 4 bits in the last octet. So 4 bits is going to be 128 plus 64 is 192, plus 32 is 224, plus 16 is going to be 240.

Then what we do with the magic number is we take that number away from 256. So if the number we're subnetting at is 240, then 240 taken away from 256 is going to be 16. Now we know that the address blocks go up in multiples of 16 until we get to the closest subnet. The network address must be 60.15.10.64.

We know that the next block starts at 80, so the broadcast address must be 60.15.10.79, and the valid hosts would be 60.15.10.65 to 60.15.10.78.

**Example 3A – Class A on 3**^{rd} Octet

^{rd}Octet

This time we're going to do a Class A on the third octet. In our example, we've been allocated a Class A 60.0.0.0/8. If we subnet it into/19 networks, how many subnets do we have, and how many hosts per subnet?

In a /19, the line is going to be after 3 bits on the third octet. So that leaves us 13 bits for hosts. 8 in the last octet and then 5 on the right-hand side of the third octet.

To figure out how many hosts each network is going to support, it's 2 to the power of 13 minus 2 so that’s 8,190 hosts per network.

Since we were allocated a Class A /8 range, the difference between a /8 and a /19 is going to be 11 bits. So to figure out how many networks we have, it's 2 to the power of 11 that will give us 2048 subnets.

**Example 3B – Class A on 3**^{rd} Octet

^{rd}Octet

As usual, we've got the second part of the question. So for the IP address, 60.15.10.75/19, what's the network address to the broadcast address and the range of valid IP addresses?

For this example, we are subnetting on the third octet. The other examples we've been subnetting on the fourth octet. The line is after the 32 on the third octet. The network block addresses are still going to go up and multiples of 32, but it's just it's going to be on the third octet rather than the fourth octet now.

Our network address is 60.15.0.0. You can see it if you write out the whole IP address. Also, we're at 60.15.10, we're going up in multiples of 32, so obviously 10 is less than 32 so the network address must be 60.15.0.0. The next network address would be 60.15.32.0.

The broadcast address is going to be one less than that on the third octet, and 255 on the fourth octet. So the broadcast is 60.15.31.255. The valid host addresses will be between the network address and the broadcast address which is 60.15.0.1 up to 60.15.31.254.

So the value in the fourth octet, the lower range is going to be a one, the higher range is going to be the 254 for the hosts. The subnetting is done on the third octet if a subnet mask is anything between a 16 and a 24.

**The Magic Number Method – Example 3B**

We can use the magic number method for that example again. It was a /19, so /19 that's three bits on the third octet. That is 128, 192, and then 224. We subtract 224 from 256, which gives us 32. Now, we know that the address block is going up in values of 32.

Again, it's on the third octet rather than the fourth octet here. It must be a network address of 60.15.0.0 because our value in the third octet is 10.

The broadcast address is 60.15.31.255, and our valid hosts are 60.15.0.1 up to 60.15.31.254. The address block is figured out exactly the same way. Again, you just need to remember that on the fourth octet, your hosts are going to go from one on the low end, up to 254 on the high end.

**Subnetting Large Networks – Example 4**

You've been asked to subnet the 134.65.0.0 network into six different networks, what subnet mask are you going to use?

The network is 134.65.0.0, therefore, we know it's a Class B network. We need to split it into six networks, so we're going to need 3 bits. It's a Class B, the default subnet mask is a /16.

We need 6 networks, which were 3 bits. We add 3 to the /16 and it will give us a /19.

Some extra information that we weren't actually asked for it in the question are:

- A /19 in dotted-decimal was 255.255.224.0.
- The network addresses would be 134.65.0.0.
- We would have 8,190 hosts in each subnet.
- We've got 13 bits available for the host address.

**Subnetting Question Categories**

When you are on the exam, there are lots of different ways that they can ask you questions about subnetting. But it's all going to boil down to just a few things.

It could be a variation of given a network requirement of X amount of subnets and Y amount of hosts per subnet, what network address and subnet masks should you be using for each subnet?

The other basic question they can ask is if they give you a particular IP address and subnet mask, calculate that subnet's network address, the broadcast address, and the range of valid host IP addresses.

So again, it could be any variation in those questions. They may ask it differently, but as long as you can answer those questions, which you can now because we've done loads of practice examples of them. Then, you're going to be fine for anything that they throw at you on the exam.

**Additional Resources**

IP Addressing and Subnetting for New Users: https://www.cisco.com/c/en/us/support/docs/ip/routing-information-protocol-rip/13788-3.html

Host and Subnet Quantities: https://www.cisco.com/c/en/us/support/docs/ip/routing-information-protocol-rip/13790-8.html

Subnetting a Class C network address: https://www.techrepublic.com/article/subnetting-a-class-c-network-address/

### Libby Teofilo

Text by Libby Teofilo, Technical Writer at www.flackbox.com

With a mission to spread network awareness through writing, Libby consistently immerses herself into the unrelenting process of knowledge acquisition and dissemination. If not engrossed in technology, you might see her with a book in one hand and a coffee in the other.