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. 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. 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.
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. 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. 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. 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.
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. 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. 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. 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.
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. 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.
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. 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.
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. 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. 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.
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. Now let’s take a look at this class B network,
172.16.0.0/16, through 172.16.255.255. 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 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. 10.0.0.0/8, through 10.255.255.255. The host portion is 24 bits, so that gives
16,777,216 possible addresses.
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. So, the formula for determing the number of hosts on a network
is 2 to the power of N, minus 2. 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. 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.
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? 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. 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.
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? 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. 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.
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. 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. 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! 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 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, to
R1’s gigabit0/0 interface.
We have this class B network, 172.16.0.0/16. 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. 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,
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.
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.
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. As you can see, this router has four interfaces,
gigabiterthernet 0/0, 0/1, 0/2, and 0/3. 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. 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.
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.
The interfaces currently have no IP addresses assigned, and as you can see, that is considered
a valid state.
Next is the method column. 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. 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. 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. 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.
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 ‘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. 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. Once we configure these interfaces
and enable them, we should see up in both the status and protocol columns.
these points, the ‘status’ column refers to the Layer 1 status, for example is the interface
shutdown, is there 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. Expect both of these columns to show up once we’re finished with our configurations! So, let’s configure the gigabitethernet0/0
interface first. 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. So, I use the command ‘interface’, followed by the name of the interface, gigabitethernet
As you can see, it now displays config-if beside the hostname of the device. 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 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
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. 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.
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. 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. 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. 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. 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.
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. We’ll cover those
topics in depth soon in separate videos. So, you may remember /8 is equivalent to 255.0.0.0.
/8 means that the first bits are all set to 1, and a binary octet of all 1s is written
as 255 in decimal. 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? 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. 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. 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.
So, now if we take a look at the show ip interface brief command, both of those columns should
Lets check. 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. 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. 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. 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.
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. 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. 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. 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.
Finally, let’s configure R1’s g0/2 interface
with an IP address of 192.168.0.254. 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. 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. 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.
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. Before
finishing, I want to introduce some more ‘show’ commands that can be used to check
out the interfaces on a Cisco device. 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. 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.
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. Hardware is
1GBE, meaning 1 gigabit ethernet, address is 0c1b.8444.f000. That’s the MAC address
of this interface. 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. 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. 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.
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’. 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.
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. 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. 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. 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. 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’. 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. 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. 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.
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. 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. First up, question 1: PC1 has an IP address of 18.104.22.168/8.
Find the following: The network address, the maximum number of hosts in the network, the
network broadcast address, the first usable address of the network, and the last usable
address of the network.
Pause the video to find the answers. Okay, let’s
check. The network address is 22.214.171.124, since only the first octet is the network portion.
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. The
first usable address is 126.96.36.199, which is the network address plus 1, and then the last
usable address is 188.8.131.52, which is the broadcast address minus 1. Let’s go
to question 2. PC4 has an IP address of 184.108.40.206/16.
Find the same five values. Pause the video to find the answer. Okay,
so the network address is 220.127.116.11. The maximum number of hosts is 65,534, which is
2 to the power of 16, minus 2. The network broadcast address is 18.104.22.168. The
first usable address is 22.214.171.124, and the last usable address is 126.96.36.199. Let’s
go to question 3. PC8 has an IP address of 188.8.131.52/24 Find
the same five values. Pause the video to find the answer. Okay, so the
network address is 184.108.40.206.
The maximum number of hosts is 254, which is 2 to the
power of 8, minus 2. The network broadcast address is 220.127.116.11. The first usable
address is 18.104.22.168, and the last usable address is 22.214.171.124. Let’s go to question
4. PC5 has an IP address of 126.96.36.199/8 Find
the same five values. Pause the video to find the answer. Okay, so the
network address is 188.8.131.52 The maximum number of hosts is 16,777,214, which is 2 to the
power of 24, minus 2. The network broadcast address is 184.108.40.206. The first usable
address is 220.127.116.11, and the last usable address is 18.104.22.168. Let’s go to question 5. PC6 has an IP address of 22.214.171.124/16
Find the same five values. Pause the video to find the answer.
so the network address is 126.96.36.199 The maximum number of hosts is 65,534 which is
2 to the power of 16, minus 2. The network broadcast address is 188.8.131.52. The
first usable address is 184.108.40.206, and the last usable address is 220.127.116.11. 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. 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. 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. 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.
a Brave verified publisher and accept BAT, or Basic Attention Token, tips via the Brave
browser. That's all for now..