Jeremy's IT Lab
Day 14Subnetting

Subnetting (Part 2)

25m7 chapters117 cues14 cards
Day 14YT: IGhd-0di0Qo
00:00 / 24:47

Synchronized Transcript

117 cues indexed • Click dialogue or words to jump
Jeremy

Welcome to Jeremy’s IT Lab. This is a free, complete course for the CCNA. If you like these videos, please subscribe to follow along with the series.

Jeremy

Also, please like and leave a comment, and share the video to help spread this free series of videos. Thanks for your help. In this video, we’ll continue to learn about subnetting.

Jeremy

Last video I introduced why subnetting is necessary, and walked through a few examples. In this video, I’ll try to give some more clear steps for solving subnetting problems.

Jeremy

I’ve also decided to make one more video on subnetting, so this will be a three-video series. So, what exactly will we cover in this video?

Jeremy

We’ll start with some subnetting practice questions, specifically for class C networks, like last video. We’ll start, of course, with the solution to last video’s quiz question.

Jeremy

After that we’ll look at subnetting class B networks. The process is exactly the same, no matter what class of address you’re subnetting, but it can be a little bit more difficult with larger networks.

Jeremy

Class A networks will be covered in the next video, by the way. So let’s take a look at how to solve last video’s quiz question. I asked you to divide the 192.168.1.0/24 network into four subnets that can accommodate

Jeremy

45 hosts each. We found that a /26 subnet is the right size to fit 45 hosts, so we assigned the block 192.168.1.0/26 to subnet 1.

Jeremy

If you don’t remember how we determined that /26 is the correct size, take a minute to review the end of the last video. So, I asked you to find the remaining subnets.

Jeremy

I also gave you this hint. If you find the broadcast address of subnet 1, the next address after that will be the network address of subnet 2.

Jeremy

So the network address for subnet 1 is 192.168.1.0/26. Here’s 192.168.1.0 written in binary.

Jeremy

Blue is the network portion, red is the host portion, and purple is the part we ‘BORROWED’ from the host portion to add to the network portion.

Jeremy

This allows us to divide the larger /24 network into multiple, smaller, subnets. To find the broadcast address for this subnet, which is the highest address in the subnet’s address range, set all of the bits in the host portion to 1.

Jeremy

Next let’s convert this to dotted decimal. It becomes 192.168.1.63. That’s the broadcast address.

Jeremy

So, the address range for subnet 1 is 192.168.1.0 through 192.168.1.63.

Jeremy

The network address of subnet 2 will be 1 higher than the broadcast address. So, that means that subnet 2 will be 192.168.1.64/26.

Jeremy

That’s the network address, and here it is in binary. Notice that we changed one of the bits we borrowed from the host portion to a 1. So, the network address is now 192.168.1.64, with all of the host bits set to 0.

Jeremy

Now lets find the broadcast address. Change all of the host bits to 1, and now let’s convert it to dotted decimal. So, the broadcast address is 192.168.1.127.

Jeremy

So, that’s the range for subnet 2. Add 1 to the broadcast address and we’ll get the network address for subnet 3. So, that means subnet 3 is 192.168.1.128/26.

Jeremy

Here is the network address in binary, again notice we changed one of the borrowed purple bits to 1, but the host bits are all 0. Change them to 1, and here’s the broadcast address.

Jeremy

So, the address range for this subnet is 192.168.1.128 through 192.168.1.191.

Jeremy

Now we can find the last subnet, subnet 4. Subnet 4 is 192.168.1.192/26.

Jeremy

Here is the network address in binary, this time the borrowed bits are all 1, so this is our last subnet, we don’t have any room for more.

Jeremy

Change the host bits to 1, and here’s the broadcast address. So, the address range for subnet 4 is 192.168.1.192 through 192.168.1.255.

Jeremy

Okay, we’ve found the answer to the quiz. You may notice something about these numbers. 0 plus 64 equals 64.

Jeremy

64 plus 64 equals 128, and 128 plus 64 equals 192. I said last video that I would just show you the basics of subnetting, not any special subnetting tricks, but let me show you just one that can help you figure things out faster.

Jeremy

So, we found that a /26 subnet mask is appropriate. That’s because there are 6 host bits, which allows 62 hosts. Let’s draw this line here.

Jeremy

On the left side is the network portion, and on the right side is the host portion. Since we’re just looking at the last octet, let me make it bigger.

Jeremy

Okay, so I’ve put the binary for just the last octet down here. Again, the red part is the host portion, and the purple part is the bits we borrowed to expand the network portion.

Jeremy

You should remember the value of each binary bit, but let me put them up here anyway. From the right, 1, 2, 4, 8, 16, 32, 64, and 128.

Jeremy

Notice that the LAST bit of the network portion is 64. This means that, to find the next subnet, we just have to add 64.

Jeremy

Let’s see. Add 64, and we get 192.168.1.64, which is the network address of subnet 2. Add 64 again and we get 192.168.1.128, which is the network address of subnet 3.

Jeremy

Finally, add 64 again and we get 192.168.1.192, which is the network address of subnet 4.

Jeremy

So, as you can see, by adding 64 each time, we were able to find the network addresses of each subnet. Now let’s try another similar exercise.

Jeremy

We have been given the 192.168.255.0/24 network, and have been asked to divide the network into five subnets of equal size.

Jeremy

In this case, the number of hosts in each subnet hasn’t been specified, so let’s make five subnets that are as large as they can be. So, all we have to do to solve this problem is find how many bits we have to ‘borrow’ Currently, we are borrowing 0 bits from the host

Jeremy

portion. That means that we can’t make any subnets, we just have one network, 192.168.255.0/24.

Jeremy

If we borrow one bit, it now becomes a /25 network. Borrowing one bit also means we can make 2 subnets. Why is that?

Jeremy

Well, all of the original network bits, the blue bits, cannot be changed. That is the network we received. Howevever the purple bit, the bit we borrowed from the host portion, we can change, and it can be either 0 or 1.

Jeremy

If its 0 we have the 192.168.255.0/25 network, If its 1 we have the 192.168.255.128/25 network.

Jeremy

The formula for the number of subnets is 2 to the power of X, and X is the number of borrowed bits. This is similar to calculating the number of hosts in a subnet, which is 2 to the power of N -2 , and N is the number of host bits.

Jeremy

We subtract 2 for the network address and broadcast address, which cant be assigned to hosts. However, when calculating the number of subnets, we dont have to subtract 2, so its simply 2 to the power of X, the number of borrowed bits.

Jeremy

Anyway, we need 5 subnets, so borrowing 1 bit isnt enough. What if we borrow 2 bits, like this? Well, 2 to the power of 2 is 4, so borrowing 2 bits allows us to make 4 subnets.

Jeremy

Still not enough, we need 5. So lets borrow another bit. If we borrow 3 bits, how many subnets can we make? 2 to the power of 3 is 8, so we can make 8 subnets.

Jeremy

So, this is our answer. It’s more subnets than we need, we need just 5, but if we borrow only 2 bits and use a /26 mask we won’t have enough.

Jeremy

As I said in the last video, you can’t always make the numbers exactly match the number of subnets or number of hosts you need. So, our first subnet will be 192.168.255.0/27.

Jeremy

Here it is written in binary. Here’s the network portion, and here’s the host portion. Let’s look at just the last octet once more. Here’s just the last octet.

Jeremy

What’s the value of the last bit of the network portion? It’s 32. So, using the trick I introduced before, we should be able to calculate the other subnets now.

Jeremy

As I said before, subnet 1 is 192.168.255.0/27. Add 32, and we get subnet 2, which is 192.168.255.32/27.

Jeremy

Add 32 again, and we get subnet 3, 192.168.255.64/27. Subnet 4 is 192.168.255.96/27, and subnet 5 is 192.168.255.128/27.

Jeremy

Okay, we’ve made up 5 subnets, as our requirements were to divide the network into 5 subnets. However, our /27 prefix length allows up to 8 subnets to be made from the address range.

Jeremy

These three remaining subnets are 192.168.255.160, .192, and .224,/27.

Jeremy

Here’s another type of subnetting question you might find. What subnet does host 192.168.5.57/27 belong to?

Jeremy

So, we have the IP address of a host, 192.168.5.57, and don’t know the network address of the subnet.

Jeremy

Let’s see how we can figure this out. It’s actually a fairly simple process. Here’s 192.168.5.57 in binary and dotted decimal.

Jeremy

However, it’s /27, so let’s show the borrowed bits. These three purple bits are borrowed and added to the network portion. Now, to find the network address we simply need to change all of the host bits to 0.

Jeremy

Now the last octet is 0010 0000. Change that back to dotted decimal, and you get 192.168.5.32.

Jeremy

So, that’s the answer. The host 192.168.5.57/27 belongs to the subnet 192.168.5.32/27.

Jeremy

Let’s do one more for practice. What subnet does host 192.168.29.219/29 belong to?

Jeremy

Pause the video now and try to figure out the answer for yourself…..okay, let’s check.

Jeremy

Write out the address in binary first. Identify where the network part ends. In this case, 5 bits are borrowed from the host portion and added to the network portion.

Jeremy

Set all of the host bits to 0. and then convert back to dotted decimal. There’s our answer. So, host 192.168.29.219/29 belongs to the subnet 192.168.29.216/29.

Jeremy

Okay, let’s review some numbers. This is a table of the different subnet sizes for class C networks.

Jeremy

For example, with a /25 prefix length, you divide the network into 2, there are 2 subnets. Also, each subnet can contain 126 hosts.

Jeremy

I recommend that you memorize these numbers, it will help you perform subnetting faster and easier than if you have to calculate everything every single time.

Jeremy

Although, these are fairly simple to calculate. For the number of subnets, each additional bit that you borrow doubles the number of subnets.

Jeremy

For number of hosts, each host bits doubles the amount of hosts, except you have to subtract 2 for the network and broadcast addresses.

Jeremy

Take note of /31, the number of hosts is 0. I mentioned this in the last video, but it’s because there is only a single host bit, so there are only two possible addresses, which are taken by the network and broadcast address.

Jeremy

However, for a point-to-point connection, you can actually use a /31 and assign those two addresses to each end of the connection, and have no network or broadcast addresses.

Jeremy

Also /32 technically uses all bits for the network address, allowing no hosts, but you can assign a /32 mask to identify a specific host when writing routes and such, and in some other special cases.

Jeremy

Now let’s finally take a look at subnetting some larger networks, specifically Class B. Looking at this chart again, you can see that there are many more host bits, and therefore many more possible subnets, that can be created with a class B network than with a class C network.

Jeremy

However, the process of subnetting is EXACTLY THE SAME. So I’ll just walk you through a couple examples with class B networks, and then we’ll leave class A networks for the last video of this subnetting series.

Jeremy

You have been given the 172.16.0.0/16 network. You are asked to create 80 subnets for your company’s various LANs.

Jeremy

What prefix length should you use? Okay, this is really a simple question, and we can follow the exact same process as last time. Pause the video here if you want to try it by yourself….okay, let’s figure it out.

Jeremy

Again we can simply use the 2 to the power of X formula, where X is the number of borrowed bits. If we borrow no bits, we can’t make any subnets, we just have one large /16 network.

Jeremy

If we borrow one bit we can make 2 subnets, because 2 to the power of 1 is 2. This gives us a prefix length of /17, and if we write this subnet mask in dotted decimal it is 255.255.128.0.

Jeremy

Remember, when you enter commands in the Cisco CLI you can’t use the CIDR notation like /17, you have to enter dotted decimal like 255.255.128.0.

Jeremy

Anyway, 2 subnets isn’t enough for our needs, so let’s borrow another bit. Borrowing 2 bits allows for 4 subnets. This is a /18 prefix length, and the subnet mask is written as 255.255.192.0 in dotted decimal.

Jeremy

Let’s borrow another bit. Borrowing 3 bits gives us 8 subnets, and a /19 prefix length. The subnet mask is 255.255.224.0 in dotted decimal.

Jeremy

Still not enough subnets, so let’s borrow another bit. Borrowing 4 bits allows us to create 16 subnets, and uses a /20 prefix length.

Jeremy

/20 is 255.255.240.0 in dotted decimal, by the way. Borrowing 5 bits gives us 32 subnets, and the prefix length is /21, which is 255.255.248.0 in dotted decimal.

Jeremy

Borrowing 6 bits gives us 64 subnets. Getting close. The prefix length is /22, which is 255.255.252.0 in dotted decimal.

Jeremy

Let’s borrow one more bit, which should be enough. Borrowing 7 bits gives us 128 subnets.

Jeremy

The prefix length is /23, which is 255.255.254.0 in dotted decimal. So, this is the correct answer, we should use a /23 prefix length so we can create the 80 subnets we need.

Jeremy

128 subnets is more than we need, but /22 only allows for 64, which is not enough. I won’t show you all 80 subnets of course, but let’s look at some of the subnets that can be made, the first being 172.16.0.0/23 of course.

Jeremy

The next is 172.16.2.0/23, notice I changed the last bit of the network portion to 1.

Jeremy

Next is 172.16.4.0/23. then 172.16.6.0, 172.16.8.0, etc.

Jeremy

Let’s do another similar question. You have been given the 172.22.0.0/16 network.

Jeremy

You are required to divide the network into 500 separate subnets. What prefix length should you use? Pause the video and try to figure this one out for yourself, and I’ll show you the answer in the next slide…...okay, let’s go to the next slide.

Jeremy

So, the correct answer is /25. We need to divide this class B network into 500 subnets, so that means we have to borrow 9 bits, because 2 to the power of 9 equals 512.

Jeremy

Notice that you can borrow bits even from the last octet, so you can use /25, /26, /27, etc. even with a class B network.

Jeremy

Here’s another practice question. You have been given the 172.18.0.0/16 network. Your company requires 250 subnets with the same number of hosts per subnet.

Jeremy

What prefix length should you use? This time you have to consider both the number of subnets and number of hosts. Once again, pause the video to solve this yourself, and then I’ll give you the answer in the next slide…..okay, let’s check out the next slide.

Jeremy

So, the answer is /24. We need 250 subnets, and borrowing 8 bits allows us to make 256 subnets.

Jeremy

We also need 250 hosts per subnet, and having 8 host bits allows for 254 hosts per subnet. Okay, before moving on to the quiz let’s do one more ‘identify the subnet’ problem, this time with a class B network.

Jeremy

What subnet does host 172.25.217.192/21 belong to? The process is exactly the same as with a Class C network.

Jeremy

Write out the address in binary, change all of the host bits to 0, and then change it back to dotted decimal. Pause the video if you want to try it on your own.

Jeremy

Okay, let’s check the answer. Here’s the address written in binary, as usual the red bits are the host bits and the purple bits are the borrowed bits which are now part of the network portion.

Jeremy

Change the host bits all to 0, convert it back to dotted decimal and you get 172.25.216.0. So, there’s the answer to the question.

Jeremy

172.25.217.192/21 belongs to the 172.25.216.0/21 subnet.

Jeremy

The process was exactly the same as for a Class C network, there are just more host bits. Here’s a chart like the one I showed you for Class C addresses, showing the number of available subnets, and the number of available host addresses for each prefix length when subnetting a class B network.

Jeremy

Don’t worry, it’s not necessary to memorize these numbers. That would simply be a waste of effort. Just know the patterns. For each borrowed bit, the number of subnets doubles, 2, 4 ,8, 16, 32, etc.

Jeremy

For each host bit, the number of addresses in each subnet doubles, however you have to subtract 2 to identify the number of usable host addresses.

Jeremy

As I said, don’t memorize this, just know the se patterns so you can calculate these when you need to. Okay let’s move on to today’s quiz. I will give you five questions following the same pattern as the ones we solved in today’s Please post your answers in the comment section of this video.

Jeremy

I will give the answers and explanations at the beginning of the next video. Let’s go to question 1. You have been given the 172.30.0.0/16 network.

Jeremy

Your company requires 100 subnets with at least 500 hosts per subnet. What prefix length should you use? Pause the video to find the answer.

Jeremy

Okay, let’s go to question 2. What subnet does host 172.21.111.201/20 belong to?

Jeremy

Pause the video to find answer. Okay, let’s go to question 3. What is the broadcast address of the network 192.168.91.78/26 belongs to?

Jeremy

Pause the video to find your answer. Okay let’s go to question 4. You divide the 172.16.0.0/16 network into 4 subnets of equal size.

Jeremy

Identify the network and broadcast addresses of the second subnet. Pause the video to find the answer.

Jeremy

Okay let’s go to the last question, question 5. You divide the 172.30.0.0/16 network into subnets of 1000 hosts each.

Jeremy

How many subnets are you able to make? Pause the video to find the answer. Okay, that’s all for the quiz. Remember to leave all of your answers in the comment section of this video, and then wait for the next video, where I’ll go over the answers and explanations.

Jeremy

Also, there won’t be any flashcards or practice lab for this video. After the next video I will make a practice lab so you can subnet a network and assign IP addresses to the devices in each subnet, so wait for that.

Jeremy

Before I wrap up this video, I want to give a shoutout to my JCNP-level channel members, Vance, Mike Yonatan, and Lito. Thank you so much for your support, I really appreciate it.

Jeremy

Also, thanks to all of my JCNA-level members as well. Thank you for watching. That's all for this video. If you want to show your support, please subscribe to the channel, like the video, leave a comment, and share the video with anyone else studying for the CCNA.

Jeremy

I accept donations via cryptocurrency or Patreon via the links in the description. I'm also a Brave verified publisher and accept BAT, or Basic Attention Token, tips via the Brave browser.

Jeremy

Click the link in the description to check out Brave, a fast and sleek browser that pays you to surf the Internet. That's all for now.

Keyboard shortcuts

Shortcuts are ignored while you are typing in a search box, note field, or the scratchpad.

Playback

SpaceK
Play or pause
←→
Seek 5 seconds
JL
Seek 10 seconds
C
Toggle in-video captions

Scrubber (when focused)

←→
Seek 5 seconds
Shift←/→
Seek 10 seconds
Page UpPage Down
Seek 30 seconds
HomeEnd
Jump to start or end

Flashcards

Space
Reveal the answer
1234
Grade Again / Hard / Good / Easy

Navigation

←→
Move between study-mode tabs
HomeEnd
First or last study-mode tab
?
Open or close this sheet