Hey everyone and welcome back. So what we're going to be talking about and this skill right
here is all around the concept of DHCP. Now DHCP stands for the Dynamic Host Configuration
Protocol and it is not an exaggeration to say that DHCP is one of the most useful protocols
in all of computer networking. So I suppose it does beg the question what is DHCP, why
is it useful for us and what exactly do we need to know about this protocol to meet the
criteria set about within the LPIC2 exam objectives. Well the good news is that that is what we're
going to be digging into within this very skill. So the very first thing I should do I suppose
is tell you what DHCP does and why we need it. So the first thing is if you can imagine
that you happen to have a fairly large network. Let's maybe say this was some type of corporation
or maybe perhaps you were administering the network for a university campus. Imagine you
had thousands of people who needed to access thousands of computers. Now we understand
that the very basics of computers rely upon IP addressing in order to actually communicate
with one another. Now have you ever wondered how do we actually manage the IP addressing,
i.e. how do we decide which IP address goes to which computer and when we're dealing with
a lot of computers how is this even manageable because think about it. Imagine here that we
had some type of network switch and let's just imagine we had a computer here and here
and here and here and we just keep adding computers all around the network. Can you
imagine how much fun it would be to have to run around the campus going across all the
different floors or all the different floors within your company and sitting down at each
desk and logging into each computer and manually typing in the IP address information for each
of these clients. You can imagine that this is going to become pretty cumbersome and pretty
laborious and inefficient really quite quickly. Not only that, imagine the headache of trying
to keep the IP addressing straight in your head. Let's say maybe this device right here,
you gave it the IP address of 192.168.1.49. You have to make sure that you don't inadvertently
give say for example this device or for what it's worth any other device on the network
that same IP address because then we would have IP address duplication and this is going to cause
a lot of issues with respect to communication within our network. So as it stands, been able to
manually configure each device statically whilst it is possible it is not desirable nor is it
efficient and the good news is is that realistically we don't have to do such a thing in the real world.
That's because the real world gets to enjoy all the glories of DHCP which is going to handle this
process for us. So what DHCP is, it's kind of in the name. This is the dynamic host configuration
protocol i.e for all of the hosts within our network they can dynamically be assigned their IP
address information and the way this is done is via something called a DHCP server. Now what a DHCP
server is going to do, it's going to ultimately be configured to have things such as DHCP pools.
Now what a DHCP pool is, it's ultimately a range of addresses. So you could imagine if we were
administering let's say the network of 192.168.0.0 slash 24 again if you remember you're subnetting
from LPIC 1. This means that we can have around 254 computers using IP addresses within this
particular address space. That is allowing for the network address and the broadcast address of
course. So even in this relatively small network having to do the configuration 250 odd times is
always a bad idea. Like I say with DHCP we can have this assigned automatically. All we do is
we specify the range of particular IP addresses we want to give. So let's say we wanted to give out
an IP address between 192.168.0.2 all the way to 192.168.0.254. We could do such a thing. This could
be our range. Now you might be thinking why would we not start with .1 for example here. Well think
about this all these devices on this particular network would need to have a default gateway
so that they can actually reach remote networks i.e other networks or things like the internet. So
maybe it's an idea that we actually reserve an IP address and in this case here I've taken the very
first available address 192.168.0.1 and we will just configure that on our router. So we don't want
that address to be handed out to any of our clients that is going to be outside the range. So within
our pool we can specify which IP addresses we want to be available to our potential clients. Now this
is not the only thing that we can hand out with DHCP. In fact that router IP address I just specified
there we can also pass that on to our clients. Pretty much saying we can give a client an IP if
they happen to request it. We will also give them their subnet mask which again if you recall from
lpic 1 we talked about the subnet mask which is going to allow us to separate host and network
based information and also we can actually hand out that default gateway information to a host so
that when a host happens to make that request they get the IP, they get the mask and they also know
which address they should send to when they want to reach a remote network and not only that still
we can also use DHCP to hand out DNS information so we can just specify this is the DNS server
you want to use. So now let's imagine the same scenario this time with DHCP then. So let's say
we have our little network switch and we have all of these clients within the network. Now I'm not
going to draw quite as many clients but you can get the drift. So these are all connected to the
switch here okay but within the same network segment here imagine that we have this DHCP server.
Now what I will say is that the DHCP server does not actually have to be on the same network right
here i.e. on the same network segment we can actually have DHCP servers on remote networks
but we'll actually talk about that when we talk about DHCP relays very very shortly. Now imagine
this device right here suddenly comes online it doesn't have an IP address and in fact let me just
draw a router on our network which can be our default gateway. So this device here suddenly
comes online and it needs an IP address so what it does it's going to send a broadcast message.
Now you may recall how broadcasts operate from the LPIC1 certification this is ultimately a message
that is going to be communicated to all of the other devices within our network. So this broadcast
is going to go here into the switch and then it's going to be directed out here and out here
and out here and here and here and here. Now this broadcast message is going to have a very specific
name this is going to be known as a DHCP discover message. This is ultimately probing other devices
on the network trying to discover if any of them happen to be a DHCP server. So naturally all of
these ones here do not respond they just ultimately ignore this broadcast message but here the DHCP
server does respond. So the DHCP server says hey I'm a DHCP server how about I offer you an IP
address okay so from within the pool configured on the DHCP server an offer is made this is the
second step within the process. So this device here gets an offer of let's just maybe say the IP
address offered was 192.168.0.10 and this device says hey that's good enough for me I would like to
take that offer. So what happens and by the way I suppose I should actually mention here that the DHCP
offer is not sent as a broadcast to all the devices on the network it is a directed unicast
message just for this particular device targeting that particular device's MAC address. Now like I
say if this device here wants to take that offer it's going to send a request. So this device responds
with its own unicast message now directed to the DHCP server as a request and the request is pretty
much saying yes I would like to request that you actually do give me that IP address configuration
and finally the server will acknowledge this request and says okay that sounds good to me you
can have that IP address so we have that acknowledgement at the end. Now it should be noted is that
within that very basic transaction I did there all that was offered by the server was an IP
address but that was simplified in real terms that offer could contain IP address information as well
as default gateway information i.e. it could also be providing the IP address for that router that
was on the network and again it could also be providing the DNS information. So as a recap the
transaction was as follows we have this nice little acronym that we can use to memorize this this is
called DORA. So we first have our discover message which happens to be a broadcast to all devices
on the network segment trying to find a DHCP server. Once a DHCP server on the network receives
this discover message it's going to respond with an offer from its pool offering up the IP address
configuration to that particular client. If the client likes and wants to receive those configurations
the client will then send a request as a direct unicast now to that DHCP server and as the client
has asked to receive that information the server will acknowledge it with a direct unicast message
and that really is the basic process. Now this process is very useful for understanding when
you want to be looking at DHCP logs to understand what exactly is going on so it definitely is
worthwhile to familiarize yourself with this exact process. Now one thing to note about DHCP
is that we're going to be using things such as leases we're not just going to give someone an
IP address indefinitely i.e. they get some type of IP address and that means they will have it
forever instead we can specify a time frame so maybe we say to someone once they request an IP
address we say you know you can have this IP address information for one week and after that
you're going to have to renew that request because simply put think about if we just gave everyone
who requested an IP address an IP address that they could keep forever and that computer went
offline ultimately we would just have a lot of dormant and wasted IP address space so really we
want to be utilizing things such as leases to make sure that the IP address information is only
granted over a very specific time frame when it has to be renewed. Now it's important to note
that with DHCP we have the ability to not just grant random IP addresses from a particular
specified range we can actually have static IP addressing as well meaning that we can actually
bind an IP address request to a particular MAC address meaning that if the same computer comes
online with the same MAC address we can always just assign that computer the same address over and over
again this can be very helpful if we're dealing with things such as servers or printers whereby
we want to have a very consistent IP addressing scheme so that people can always find the same
server or the same printer using the same logical IP address as opposed to the server having to call
it every week or every two weeks or every two days and be assigned a new IP address understand
with DHCP we still can have that option so now we understand that with DHCP we have the concept of a
DHCP server as well as a DHCP client the first thing that I now want to dive into is the configuration
of that DHCP server itself the one that has those DHCP pools the ones that's going to be
assigning those IP addresses so how on earth do we actually configure DHCP for servers
well the good news is is that that is what we're going to be talking about in the very next nugget
so I hope this has been informative for you and I'd like to thank you for viewing