1
00:00:00,000 --> 00:00:17,559
Hey everyone and welcome back. So what we're going to be talking about and this skill right

2
00:00:17,559 --> 00:00:26,920
here is all around the concept of DHCP. Now DHCP stands for the Dynamic Host Configuration

3
00:00:26,920 --> 00:00:34,079
Protocol and it is not an exaggeration to say that DHCP is one of the most useful protocols

4
00:00:34,079 --> 00:00:39,800
in all of computer networking. So I suppose it does beg the question what is DHCP, why

5
00:00:39,800 --> 00:00:45,120
is it useful for us and what exactly do we need to know about this protocol to meet the

6
00:00:45,120 --> 00:00:50,920
criteria set about within the LPIC2 exam objectives. Well the good news is that that is what we're

7
00:00:50,920 --> 00:00:56,560
going to be digging into within this very skill. So the very first thing I should do I suppose

8
00:00:56,560 --> 00:01:03,480
is tell you what DHCP does and why we need it. So the first thing is if you can imagine

9
00:01:03,480 --> 00:01:09,600
that you happen to have a fairly large network. Let's maybe say this was some type of corporation

10
00:01:09,600 --> 00:01:15,560
or maybe perhaps you were administering the network for a university campus. Imagine you

11
00:01:15,560 --> 00:01:22,359
had thousands of people who needed to access thousands of computers. Now we understand

12
00:01:22,359 --> 00:01:28,319
that the very basics of computers rely upon IP addressing in order to actually communicate

13
00:01:28,319 --> 00:01:35,000
with one another. Now have you ever wondered how do we actually manage the IP addressing,

14
00:01:35,000 --> 00:01:41,319
i.e. how do we decide which IP address goes to which computer and when we're dealing with

15
00:01:41,319 --> 00:01:47,000
a lot of computers how is this even manageable because think about it. Imagine here that we

16
00:01:47,000 --> 00:01:53,079
had some type of network switch and let's just imagine we had a computer here and here

17
00:01:53,079 --> 00:01:58,840
and here and here and we just keep adding computers all around the network. Can you

18
00:01:58,840 --> 00:02:04,240
imagine how much fun it would be to have to run around the campus going across all the

19
00:02:04,240 --> 00:02:09,240
different floors or all the different floors within your company and sitting down at each

20
00:02:09,240 --> 00:02:16,039
desk and logging into each computer and manually typing in the IP address information for each

21
00:02:16,039 --> 00:02:21,959
of these clients. You can imagine that this is going to become pretty cumbersome and pretty

22
00:02:21,959 --> 00:02:29,319
laborious and inefficient really quite quickly. Not only that, imagine the headache of trying

23
00:02:29,319 --> 00:02:35,399
to keep the IP addressing straight in your head. Let's say maybe this device right here,

24
00:02:35,399 --> 00:02:43,680
you gave it the IP address of 192.168.1.49. You have to make sure that you don't inadvertently

25
00:02:43,680 --> 00:02:49,120
give say for example this device or for what it's worth any other device on the network

26
00:02:49,120 --> 00:02:55,120
that same IP address because then we would have IP address duplication and this is going to cause

27
00:02:55,120 --> 00:03:01,840
a lot of issues with respect to communication within our network. So as it stands, been able to

28
00:03:02,400 --> 00:03:09,760
manually configure each device statically whilst it is possible it is not desirable nor is it

29
00:03:09,759 --> 00:03:15,439
efficient and the good news is is that realistically we don't have to do such a thing in the real world.

30
00:03:15,439 --> 00:03:22,319
That's because the real world gets to enjoy all the glories of DHCP which is going to handle this

31
00:03:22,319 --> 00:03:30,079
process for us. So what DHCP is, it's kind of in the name. This is the dynamic host configuration

32
00:03:30,079 --> 00:03:38,079
protocol i.e for all of the hosts within our network they can dynamically be assigned their IP

33
00:03:38,560 --> 00:03:46,720
address information and the way this is done is via something called a DHCP server. Now what a DHCP

34
00:03:46,720 --> 00:03:54,160
server is going to do, it's going to ultimately be configured to have things such as DHCP pools.

35
00:03:54,160 --> 00:04:00,480
Now what a DHCP pool is, it's ultimately a range of addresses. So you could imagine if we were

36
00:04:00,560 --> 00:04:09,199
administering let's say the network of 192.168.0.0 slash 24 again if you remember you're subnetting

37
00:04:09,199 --> 00:04:17,199
from LPIC 1. This means that we can have around 254 computers using IP addresses within this

38
00:04:17,199 --> 00:04:22,560
particular address space. That is allowing for the network address and the broadcast address of

39
00:04:22,560 --> 00:04:29,920
course. So even in this relatively small network having to do the configuration 250 odd times is

40
00:04:29,920 --> 00:04:36,960
always a bad idea. Like I say with DHCP we can have this assigned automatically. All we do is

41
00:04:36,960 --> 00:04:43,439
we specify the range of particular IP addresses we want to give. So let's say we wanted to give out

42
00:04:43,439 --> 00:04:56,240
an IP address between 192.168.0.2 all the way to 192.168.0.254. We could do such a thing. This could

43
00:04:56,240 --> 00:05:03,360
be our range. Now you might be thinking why would we not start with .1 for example here. Well think

44
00:05:03,360 --> 00:05:09,840
about this all these devices on this particular network would need to have a default gateway

45
00:05:09,840 --> 00:05:16,319
so that they can actually reach remote networks i.e other networks or things like the internet. So

46
00:05:16,319 --> 00:05:22,240
maybe it's an idea that we actually reserve an IP address and in this case here I've taken the very

47
00:05:22,240 --> 00:05:30,079
first available address 192.168.0.1 and we will just configure that on our router. So we don't want

48
00:05:30,079 --> 00:05:36,319
that address to be handed out to any of our clients that is going to be outside the range. So within

49
00:05:36,319 --> 00:05:44,720
our pool we can specify which IP addresses we want to be available to our potential clients. Now this

50
00:05:44,720 --> 00:05:52,079
is not the only thing that we can hand out with DHCP. In fact that router IP address I just specified

51
00:05:52,079 --> 00:05:59,359
there we can also pass that on to our clients. Pretty much saying we can give a client an IP if

52
00:05:59,359 --> 00:06:05,680
they happen to request it. We will also give them their subnet mask which again if you recall from

53
00:06:05,680 --> 00:06:11,439
lpic 1 we talked about the subnet mask which is going to allow us to separate host and network

54
00:06:11,439 --> 00:06:18,399
based information and also we can actually hand out that default gateway information to a host so

55
00:06:18,399 --> 00:06:25,599
that when a host happens to make that request they get the IP, they get the mask and they also know

56
00:06:25,599 --> 00:06:32,879
which address they should send to when they want to reach a remote network and not only that still

57
00:06:32,879 --> 00:06:41,039
we can also use DHCP to hand out DNS information so we can just specify this is the DNS server

58
00:06:41,040 --> 00:06:48,560
you want to use. So now let's imagine the same scenario this time with DHCP then. So let's say

59
00:06:48,560 --> 00:06:54,720
we have our little network switch and we have all of these clients within the network. Now I'm not

60
00:06:54,720 --> 00:06:58,800
going to draw quite as many clients but you can get the drift. So these are all connected to the

61
00:06:58,800 --> 00:07:07,360
switch here okay but within the same network segment here imagine that we have this DHCP server.

62
00:07:07,360 --> 00:07:13,360
Now what I will say is that the DHCP server does not actually have to be on the same network right

63
00:07:13,360 --> 00:07:19,199
here i.e. on the same network segment we can actually have DHCP servers on remote networks

64
00:07:19,199 --> 00:07:26,560
but we'll actually talk about that when we talk about DHCP relays very very shortly. Now imagine

65
00:07:26,560 --> 00:07:32,879
this device right here suddenly comes online it doesn't have an IP address and in fact let me just

66
00:07:32,879 --> 00:07:38,560
draw a router on our network which can be our default gateway. So this device here suddenly

67
00:07:38,560 --> 00:07:46,000
comes online and it needs an IP address so what it does it's going to send a broadcast message.

68
00:07:46,000 --> 00:07:53,199
Now you may recall how broadcasts operate from the LPIC1 certification this is ultimately a message

69
00:07:53,199 --> 00:07:59,759
that is going to be communicated to all of the other devices within our network. So this broadcast

70
00:07:59,759 --> 00:08:06,319
is going to go here into the switch and then it's going to be directed out here and out here

71
00:08:06,319 --> 00:08:14,480
and out here and here and here and here. Now this broadcast message is going to have a very specific

72
00:08:14,480 --> 00:08:21,680
name this is going to be known as a DHCP discover message. This is ultimately probing other devices

73
00:08:21,680 --> 00:08:28,159
on the network trying to discover if any of them happen to be a DHCP server. So naturally all of

74
00:08:28,240 --> 00:08:35,920
these ones here do not respond they just ultimately ignore this broadcast message but here the DHCP

75
00:08:35,920 --> 00:08:44,320
server does respond. So the DHCP server says hey I'm a DHCP server how about I offer you an IP

76
00:08:44,320 --> 00:08:52,800
address okay so from within the pool configured on the DHCP server an offer is made this is the

77
00:08:52,879 --> 00:08:59,199
second step within the process. So this device here gets an offer of let's just maybe say the IP

78
00:08:59,199 --> 00:09:07,919
address offered was 192.168.0.10 and this device says hey that's good enough for me I would like to

79
00:09:07,919 --> 00:09:14,319
take that offer. So what happens and by the way I suppose I should actually mention here that the DHCP

80
00:09:14,319 --> 00:09:21,199
offer is not sent as a broadcast to all the devices on the network it is a directed unicast

81
00:09:21,200 --> 00:09:28,320
message just for this particular device targeting that particular device's MAC address. Now like I

82
00:09:28,320 --> 00:09:36,480
say if this device here wants to take that offer it's going to send a request. So this device responds

83
00:09:36,480 --> 00:09:43,680
with its own unicast message now directed to the DHCP server as a request and the request is pretty

84
00:09:43,680 --> 00:09:50,000
much saying yes I would like to request that you actually do give me that IP address configuration

85
00:09:50,000 --> 00:09:56,240
and finally the server will acknowledge this request and says okay that sounds good to me you

86
00:09:56,240 --> 00:10:01,840
can have that IP address so we have that acknowledgement at the end. Now it should be noted is that

87
00:10:01,840 --> 00:10:08,000
within that very basic transaction I did there all that was offered by the server was an IP

88
00:10:08,000 --> 00:10:14,480
address but that was simplified in real terms that offer could contain IP address information as well

89
00:10:14,480 --> 00:10:21,519
as default gateway information i.e. it could also be providing the IP address for that router that

90
00:10:21,519 --> 00:10:27,440
was on the network and again it could also be providing the DNS information. So as a recap the

91
00:10:27,440 --> 00:10:33,759
transaction was as follows we have this nice little acronym that we can use to memorize this this is

92
00:10:33,759 --> 00:10:41,039
called DORA. So we first have our discover message which happens to be a broadcast to all devices

93
00:10:41,039 --> 00:10:48,240
on the network segment trying to find a DHCP server. Once a DHCP server on the network receives

94
00:10:48,240 --> 00:10:54,319
this discover message it's going to respond with an offer from its pool offering up the IP address

95
00:10:54,319 --> 00:11:01,919
configuration to that particular client. If the client likes and wants to receive those configurations

96
00:11:01,919 --> 00:11:08,639
the client will then send a request as a direct unicast now to that DHCP server and as the client

97
00:11:08,639 --> 00:11:15,519
has asked to receive that information the server will acknowledge it with a direct unicast message

98
00:11:15,519 --> 00:11:20,639
and that really is the basic process. Now this process is very useful for understanding when

99
00:11:20,639 --> 00:11:26,399
you want to be looking at DHCP logs to understand what exactly is going on so it definitely is

100
00:11:26,399 --> 00:11:33,600
worthwhile to familiarize yourself with this exact process. Now one thing to note about DHCP

101
00:11:33,600 --> 00:11:38,319
is that we're going to be using things such as leases we're not just going to give someone an

102
00:11:38,400 --> 00:11:44,400
IP address indefinitely i.e. they get some type of IP address and that means they will have it

103
00:11:44,400 --> 00:11:51,040
forever instead we can specify a time frame so maybe we say to someone once they request an IP

104
00:11:51,040 --> 00:11:57,520
address we say you know you can have this IP address information for one week and after that

105
00:11:57,520 --> 00:12:03,760
you're going to have to renew that request because simply put think about if we just gave everyone

106
00:12:03,840 --> 00:12:09,519
who requested an IP address an IP address that they could keep forever and that computer went

107
00:12:09,519 --> 00:12:16,639
offline ultimately we would just have a lot of dormant and wasted IP address space so really we

108
00:12:16,639 --> 00:12:22,799
want to be utilizing things such as leases to make sure that the IP address information is only

109
00:12:22,799 --> 00:12:28,799
granted over a very specific time frame when it has to be renewed. Now it's important to note

110
00:12:28,799 --> 00:12:36,639
that with DHCP we have the ability to not just grant random IP addresses from a particular

111
00:12:36,639 --> 00:12:43,919
specified range we can actually have static IP addressing as well meaning that we can actually

112
00:12:43,919 --> 00:12:50,159
bind an IP address request to a particular MAC address meaning that if the same computer comes

113
00:12:50,159 --> 00:12:56,319
online with the same MAC address we can always just assign that computer the same address over and over

114
00:12:56,400 --> 00:13:02,400
again this can be very helpful if we're dealing with things such as servers or printers whereby

115
00:13:02,400 --> 00:13:07,840
we want to have a very consistent IP addressing scheme so that people can always find the same

116
00:13:07,840 --> 00:13:14,160
server or the same printer using the same logical IP address as opposed to the server having to call

117
00:13:14,160 --> 00:13:19,600
it every week or every two weeks or every two days and be assigned a new IP address understand

118
00:13:19,680 --> 00:13:26,879
with DHCP we still can have that option so now we understand that with DHCP we have the concept of a

119
00:13:26,879 --> 00:13:34,800
DHCP server as well as a DHCP client the first thing that I now want to dive into is the configuration

120
00:13:34,800 --> 00:13:41,279
of that DHCP server itself the one that has those DHCP pools the ones that's going to be

121
00:13:41,279 --> 00:13:46,480
assigning those IP addresses so how on earth do we actually configure DHCP for servers

122
00:13:46,480 --> 00:13:50,639
well the good news is is that that is what we're going to be talking about in the very next nugget

123
00:13:50,639 --> 00:14:02,399
so I hope this has been informative for you and I'd like to thank you for viewing

