Jeremy's IT Lab
Day 08Subnetting

IPv4 Addressing (Part 2)

31m7 chapters137 cues14 cards1 lab
Day 08YT: FiAatRd84XI
00:00 / 30:42

Synchronized Transcript

137 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. Also, remember to download and use the Anki flashcards with the link in the description, which will help you very much in remembering what you have learned.

Jeremy

Let’s get started. This is the 8th lecture in the series, and part 2 on IPv4 addresses. This should be a shorter video than the last one, just covering a few things we missed.

Jeremy

Let’s go over what we’ll cover in this video. I’ll do a quick review of IPv4 classes, and clarify some things I didn’t explain well in the previous video.

Jeremy

I’ll explain how to find... the maximum number of hosts, the network address, the broadcast address, the first usable address, and the last usable address of a particular network.

Jeremy

I introduced some of these in the previous video, but its worth explaining in more detail. Finally, I will outline how to configure IP addresses on Cisco devices, which we’ll then practice in packet tracer, in the next video.

Jeremy

So this is the chart of the IPv4 address classes I showed you in the last video. I taught you that the 127 range is reserved for loopback addresses, so its generally not considered part of the Class A range.

Jeremy

However, the 0 range is also reserved in class A, so some might say class A really begins at 1, making the range 1-126.

Jeremy

Different sources say different things, so I recommend that you remember class A as 0-127, but also keep in mind that 0 and 127 are reserved, so really the usable range is 1-126.

Jeremy

We also saw this chart from wikipedia in the last video. Leading bits of 0 for Class A, 1 0 for class B, and 1 1 0 for Class C.

Jeremy

A network number bit field size, also known as prefix length, of 8 for class A, 16 for class B, and 24 for class C.

Jeremy

a size of ‘rest bit field’ also known as the host portion of the address, of 24 bits for class A, 16 for class B, and 8 for class C.

Jeremy

The number of networks available in each class. and finally, the number of addresses per network. This is the maximum number of addresses, including the network address and broadcast address.

Jeremy

Notice how it’s calculated. 2, to the power of 8, 16, or 24, that being the length of the host portion. But let’s look at how to calculate the maximum number of USABLE addresses, the number of addresses that can be assigned to hosts.

Jeremy

So, let’s take this Class C network 192.168.1.0/24. Because it’s class C, it uses a /24 prefix length, and therefore the last octet, the last 8 bits, are the host portion.

Jeremy

That means that the host portion can be 0 to 255. So, 0 to 255 gives us a total of 256 addresses, which is 2 to the power of 8, because there are 8 bits.

Jeremy

But, remember those two special address types I mentioned in the last video? If the host portion is all 0s, it represents the network address, sometimes called the network ID.

Jeremy

It can't be assigned to a host. Also, if the host portion is all 1s, it is the network broadcast address, the address used to send a message to all hosts on the network.

Jeremy

It also can’t be assigned to a host. So, actually the maximum hosts per network is 2 to the power of 8, minus 2, which is 254 for a class C network like this.

Jeremy

Now let’s take a look at this class B network, 172.16.0.0/16, through 172.16.255.255.

Jeremy

The host portion is 16 bits, giving 65,536 possible addresses. However, this address with a host portion of all 0s is the network address, and this address with a host portion of all 1s is the broadcast address, so really

Jeremy

the maximum number of hosts in this network, or any class B network, is 65,534. Now let’s do one more example, with a class A address.

Jeremy

10.0.0.0/8, through 10.255.255.255. The host portion is 24 bits, so that gives 16,777,216 possible addresses.

Jeremy

This network address and this broadcast address can’t be assigned to hosts, however, so the maximum number of hosts in this network, or any class A network is really 16,777,214.

Jeremy

So, the formula for determing the number of hosts on a network is 2 to the power of N, minus 2.

Jeremy

N is equal to the number of host bits. Now let’s calculate the first and last usable addresses for this class C network, 192.168.1.0/24.

Jeremy

So, this address with a host portion of all 0s is the network address, or network ID. Add 1 by changing the last bit of the host portion to 1 and, you get 192.168.1.1, and that is the first usable address on the network.

Jeremy

So, that’s how you do it. Add one to the network address to get the first usable address. How about the last usable address?

Jeremy

Well, this address with a host portion of all 1s is the broadcast address. Subtract 1 from this address by switching the last bit to 0, and you get 192.168.1.254, which is the last usable address.

Jeremy

Next let’s do the same for this class B network, 172.16.0.0/16. This address with a host portion of all 0s is the network address.

Jeremy

Add 1 and, you get 172.16.0.1, and that is the first usable address on the network. How about the last usable address?

Jeremy

This address with a host portion of all 1s is the broadcast address. Subtract 1 from this address, and you get 172.16.255.254, and that is the last usable address.

Jeremy

Finally let’s do the same for this class A network, 10.0.0.0/8. This address is the network address. Add 1 and, you get 10.0.0.1, and that is the first usable address on the network.

Jeremy

Next let’s find the last usable address. This address with a host portion of all 1s is the broadcast address. Subtract 1, and you get 10.255.255.254, which is the last usable address.

Jeremy

Okay, so hopefully you understand both how to calculate the number of usable addresses in a network, and the first and last usable address in a network.

Jeremy

Really, we covered this material in the last video, but I wanted to make it clear. Now let’s move on to actually configuring a Cisco router with IP addresses!

Jeremy

So here’s a small network I put together in GNS3, with three small networks connected to a single router, R1. Keep in mind that it’s not really realistic to have only a single PC connected to each switch, in a real network there would many more hosts and possibly

Jeremy

more switches in each local area network. So, we have one class A network here, 10.0.0.0/8. PC1 has the first usable address in the network, 10.0.0.1, and we will assign the last usable address, 10.255.255.254,

Jeremy

to R1’s gigabit0/0 interface. We have this class B network, 172.16.0.0/16.

Jeremy

PC2 has the first usable IP address, 172.16.0.1, and we will assign the last usable address, 172.16.255.254, to R1’s Gigabit0/1 interface.

Jeremy

We also have a class C network, 192.168.0.0/24. PC3 has the first usable address, 192.168.0.1, and we will assign the last usable address, 192.168.0.254,

Jeremy

to R1’s Gigabit0/2 interface. Let’s go into the CLI of R1 and make the configurations. So, I logged on to the CLI of R1, and as you can see I used ‘EN’, the shortcut of the enable command, to enter privileged exec mode.

Jeremy

Now, let me show you a great command you can use to confirm the status of each interface on the device, as well as their IP addresses.

Jeremy

That is the ‘show ip interface brief’ command. Let’s check out the info this command gives us. First off, the interface column lists the network interfaces on the device.

Jeremy

As you can see, this router has four interfaces, gigabiterthernet 0/0, 0/1, 0/2, and 0/3.

Jeremy

The next column lists the IP address of each interface. As you can see, they are all unassigned at the moment, but we will soon assign IP addresses to the top three interfaces.

Jeremy

We’ll use this command again afterward to check. Next is the ‘OK?’ column. I think this is a legacy feature of the command, its not relevant anymore.

Jeremy

Basically, it says whether or not the IP address is valid or not. On modern devices, the device won’t let you assign invalid IP addresses, so you should never see ‘NO’ in this column.

Jeremy

The interfaces currently have no IP addresses assigned, and as you can see, that is considered a valid state. Next is the method column.

Jeremy

This indicates the method by which the interface was assigned an IP address. Currently the status is unset, but let’s check what it is after we assign IP addresses.

Jeremy

Next is the status column. Basically, you can consider this the Layer 1 status of the interface. If the interface is enabled, there is a cable connected, and the other end of the cable is properly connected to another device, you should see ‘up’ here.

Jeremy

However, here it displays ‘administratively down’. This means the interface has been disabled with the ‘shutdown’ command. However, I haven’t done any configuration on the interfaces yet.

Jeremy

So, this is the default status of Cisco router interfaces. We haven’t looked at switch interfaces yet, but Cisco switch interfaces are NOT administratively down by default.

Jeremy

They will either be up, if they are connected to another device, or down, if they are not connected. Notice that, even though gigabit ethernet 0/0, 0/1, and 0/2 on this router are connected to switches, the interfaces remain administratively down because the

Jeremy

‘shutdown’ command is applied to them by default. The final field of the output is ‘protocol’. While the ‘status’ column referred to the Layer 1 status of the interface, this is the Layer 2 status.

Jeremy

Because the interfaces are down at Layer 1, layer 2 cant operate, so all of these interfaces are down at Layer 2. You’ll never see an interface with a ‘down’ in the status column and ‘up’ in the protocol column, although the reverse is possible.

Jeremy

Once we configure these interfaces and enable them, we should see up in both the status and protocol columns. So, remember these points, the ‘status’ column refers to the Layer 1 status, for example is the interface shutdown, is there

Jeremy

a cable attached, etc. The protocol column refers to the layer 2 status, for example is Ethernet functioning properly between this device and the device it's connected to.

Jeremy

Expect both of these columns to show up once we’re finished with our configurations! So, let’s configure the gigabitethernet0/0 interface first.

Jeremy

I use conf t, the shortcut of the ‘configure terminal’ command to enter global config mode. Next, to configure the interface itself, I have to enter interface config mode.

Jeremy

So, I use the command ‘interface’, followed by the name of the interface, gigabitethernet 0/0. As you can see, it now displays config-if beside the hostname of the device.

Jeremy

Now, before we move on, let me show you some other ways to enter interface configuration mode. First off, notice that you don’t need the space between ‘gigabitethernet’ and 0/0, you can connect them and the CLI will still understand and bring you to interface

Jeremy

configuration mode for that interface. Now, how about the shortcut version of the command? Well, as you can see, there are many possible commands beginning with ‘i’ from global config mode, so that’s too short.

Jeremy

However, there is only one option beginning with ‘in’, so that’s the shortest version of the command. Keep in mind, you don’t have to use or even remember what the shortest version of each command is.

Jeremy

For example I always type ‘int’ for interface, even though ‘in’ would work too. Just use whatever is comfortable for you. It may even help you remember the commands if you type the whole thing out every time.

Jeremy

Okay, now how about the short version of gigabitethernet? Well, as you can see there are multiple options with just G, so you might think that’s too short.

Jeremy

However, here’s something cool. If you type the 0/0 after the G, it works! The CLI will understand and bring you into interface configuration mode for gigabitethernet 0/0.

Jeremy

So, whether you prefer to use shortcuts to maximize efficiency, or take your time and type out the whole command, remember that the command to enter interface configuration mode is ‘interface’, followed by the interface name.

Jeremy

Now that we’re in interface configuration mode, let’s set the IP address. That is done with the command IP address, and then you type the IP address.

Jeremy

Notice I used the context-sensitive help, the question mark, to display the next option, and it is the ‘subnet mask’. This is another name for the ‘netmask’ I referred to in a previous video.

Jeremy

As opposed to writing /8 for this class A address, we will have to write out the subnet mask in dotted decimal. For those of you who have heard of the term ‘subnet’ or ‘subnetting’ before, don’t worry.

Jeremy

We’ll cover those topics in depth soon in separate videos. So, you may remember /8 is equivalent to 255.0.0.0.

Jeremy

/8 means that the first bits are all set to 1, and a binary octet of all 1s is written as 255 in decimal.

Jeremy

Next I enter the command ‘no shutdown’. This is the command we use to enable the interface. Remember I said that Cisco router interfaces have the ‘shutdown’ command applied to them by default?

Jeremy

Well, to cancel the command, type ‘no’ in front of the command like this. Now that we entered the no shutdown command on the interface, we get two messages on the device.

Jeremy

The first one says ‘Interface gigabitethernet0/0, changed state to up. This refers to the physical layer status of the interface, the ‘STATUS’ column of the show ip interface brief command we looked at.

Jeremy

The second message says ‘Line protocol on interface gigabitethernet0/0, changed state to up.’ This is the layer 2 status of the interface, the ‘protocol’ column of the show ip interface brief command.

Jeremy

So, now if we take a look at the show ip interface brief command, both of those columns should display up. Lets check.

Jeremy

Here I use ‘do’ to let me execute this privileged exec mode command from interface config mode, and notice I used shortcuts instead, SH ip INT BR, instead of show ip interface brief.

Jeremy

As you can see, we can now see the IP address, the method is displayed as manual instead of unset, and both the status and protocol display up.

Jeremy

Seems like our interface configuration was a success! Let’s do the configurations for the G0/1 interface next. I’ll give it an address of 172.16.255.254.

Jeremy

The prefix length is /16, so what will the subnet mask be? So, I use the int g0/1 command to enter interface config mode for the interface.

Jeremy

Notice that I didn’t type ‘exit’ to return to global config mode and then type int g0/1. You can directly switch from one interface to the other.

Jeremy

Next I configure the IP address, using the shortcut ‘add’ for address. Notice the subnet mask of 255.255.0.0, which indicates a prefix length of /16.

Jeremy

Then I enable the interface with ‘no shut’, which is a short version of the no shutdown command. Once again, I get two messages saying the interface has come up.

Jeremy

Then I check the interfaces again with show ip interface brief, and you can see that gigabitethernet0/1 has an IP address, and its status is UP UP.

Jeremy

Finally, let’s configure R1’s g0/2 interface with an IP address of 192.168.0.254.

Jeremy

The prefix length is /24, so what do you think the subnet mask will be? So, I use ‘int g0/2’ to enter interface config mode for gigabitethernet 0/2.

Jeremy

Then I configure an IP address of 192.168.0.254, and the subnet mask is 255.255.255.0, which is equivalent to a prefix length of /24.

Jeremy

I enable the interface with ‘no shut’, and once again I get the two messages indicating the interface has come up, and then once more I check the status of the interfaces with show ip interface brief.

Jeremy

Looks like all of the interfaces have been properly configured. Their IP addresses are displayed, their method column displays ‘manual’, since I manually configured their IP addresses, and their status and protocol columns show up and up.

Jeremy

Before finishing, I want to introduce some more ‘show’ commands that can be used to check out the interfaces on a Cisco device.

Jeremy

First up is the ‘show interfaces’ command. You can enter just ‘show interfaces’, but it shows a lot of information for each interface, so I recommend specifying which interface you want to check, in this case I specified G0/0.

Jeremy

This command shows primarily Layer 1 and Layer 2 information about the interface, but also some Layer 3. Gigabitethernet0/0 is up, that means that Layer 1 is working.

Jeremy

Line protocol is up, that refers to the Layer 2 status of the interface. This line is like the status and protocol columns of the ‘show ip interface brief’ command.

Jeremy

Hardware is 1GBE, meaning 1 gigabit ethernet, address is 0c1b.8444.f000. That’s the MAC address of this interface.

Jeremy

Notice it says BIA, followed by the MAC address again. I mentioned in a previous video that the MAC address can also be called the burned in address.

Jeremy

Well, thats what BIA stands for. Why is it listed twice? Well, BIA refers to the actual physical address of the interface. However, you can actually configure a different MAC address in the CLI, although usually you won’t configure a different MAC address.

Jeremy

Internet address is 10.255.255.254/8. This is the IP address, of course. Feel free to take a look at the rest of this information if you want, but I’ll explain more of it in detail in a later video.

Jeremy

It’s all detailed Layer 1 and Layer 2 information about the interface. Now let’s look at one more valuable command. ‘show interfaces description’.

Jeremy

Well, as you can see it has status and protocol columns like the show ip interface brief command. But it also has this ‘description’ column.

Jeremy

Interface descriptions are optional, but can be very helpful in identifying the purpose of each interface. Let’s quickly go back and configure descriptions on each of these interfaces.

Jeremy

So, from global config mode I once again entered interface config mode for G0/0. The command to configure an interface description is simply ‘description’, followed by the description.

Jeremy

Now, there aren’t any rules regarding how to describe your interfaces. I use hashtags to make the descriptions more noticeable, and then I indicate which device the interface is connected to.

Jeremy

I do the same for G0/1 and G0/2, using ‘D E S C’ instead of the full description command. I then use the show interfaces description command again, and now you can see the description of each interface.

Jeremy

Now, there are many more ‘show’ commands you can use to obtain information about a device’s interfaces. We’ll take a look at a few more throughout this course, but for now remember ‘show ip interface brief’, ‘show interfaces’, and ‘show interfaces description’.

Jeremy

Now let’s review what we covered. This is the same slide I showed at the beginning of the video, but let’s go through and make sure we covered everything.

Jeremy

We covered IPv4 address classes, which we also covered in Part 1, but reviewed in this video. We talked about how to find the maximum number of hosts, network address, broadcast address, first usable address, and last usable address of a particular network.

Jeremy

If you’re not sure about any of those, go back and listen to that part of the video once more before moving on to today’s quiz. Finally, I showed you how to configure IP addresses on Cisco devices, as well as some ‘show’ commands to gather information about interfaces.

Jeremy

Now let’s go on to the quiz for today’s video. If you want further help remembering what you’ve studied, remember to download and use the Anki flashcards from the link in the description.

Jeremy

For this quiz, I’ll focus on finding the maximum number of hosts, network address, broadcast address, and first and last usable addresses of a network.

Jeremy

First up, question 1: PC1 has an IP address of 43.109.23.12/8. Find the following: The network address, the maximum number of hosts in the network, the network broadcast address, the first usable address of

Jeremy

the network, and the last usable address of the network. Pause the video to find the answers. Okay, let’s check.

Jeremy

The network address is 43.0.0.0, since only the first octet is the network portion.

Jeremy

The maximum number of hosts is 16,777,214, which is 2 to the power of 24, because there are 24 host bits in the network, minus 2, for the network and broadcast addresses.

Jeremy

The first usable address is 43.0.0.1, which is the network address plus 1, and then the last usable address is 43.255.255.254, which is the broadcast address minus 1.

Jeremy

Let’s go to question 2. PC4 has an IP address of 129.221.23.13/16. Find the same five values.

Jeremy

Pause the video to find the answer. Okay, so the network address is 129.221.0.0.

Jeremy

The maximum number of hosts is 65,534, which is 2 to the power of 16, minus 2. The network broadcast address is 129.221.255.255.

Jeremy

The first usable address is 129.221.0.1, and the last usable address is 129.221.255.254.

Jeremy

Let’s go to question 3. PC8 has an IP address of 209.211.3.22/24 Find the same five values.

Jeremy

Pause the video to find the answer. Okay, so the network address is 209.211.3.0.

Jeremy

The maximum number of hosts is 254, which is 2 to the power of 8, minus 2. The network broadcast address is 209.211.3.255.

Jeremy

The first usable address is 209.211.3.1, and the last usable address is 209.211.3.254.

Jeremy

Let’s go to question 4. PC5 has an IP address of 2.71.209.233/8 Find the same five values.

Jeremy

Pause the video to find the answer. Okay, so the network address is 2.0.0.0 The maximum number of hosts is 16,777,214, which

Jeremy

is 2 to the power of 24, minus 2. The network broadcast address is 2.255.255.255.

Jeremy

The first usable address is 2.0.0.1, and the last usable address is 2.255.255.254.

Jeremy

Let’s go to question 5. PC6 has an IP address of 155.200.201.141/16 Find the same five values.

Jeremy

Pause the video to find the answer. Okay, so the network address is 155.200.0.0 The maximum number of hosts is 65,534

Jeremy

which is 2 to the power of 16, minus 2. The network broadcast address is 155.200.255.255.

Jeremy

The first usable address is 155.200.0.1, and the last usable address is 155.200.255.254.

Jeremy

Okay, that’s all for the quiz. Hopefully you feel confident in determining the network address, maximum hosts, broadcast address, and the first and last usable addresses of a network.

Jeremy

As usual, there will be supplementary materials to help you practice and remember what you’ve learned. There will be review flash cards using the Anki software, check the link in the description.

Jeremy

There will also be a practice lab using packet tracer, so you can try out the CLI commands we learned in this video. Good luck with your studies.

Jeremy

Thank you for watching. Please subscribe to the channel, like the video, leave a comment, and share the video with anyone else studying for the CCNA. If you want to leave a tip, check the links in the description.

Jeremy

I'm also a Brave verified publisher and accept BAT, or Basic Attention Token, tips via the Brave browser. 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