1
00:00:00,000 --> 00:00:18,400
Hey everyone and welcome back. Now previously throughout this skill we have been primarily

2
00:00:18,400 --> 00:00:25,320
focused on DHCP from the point of view of assigning addresses from a particular range.

3
00:00:25,320 --> 00:00:29,960
That is if someone happens to request an IP address they get it from that range but it

4
00:00:29,960 --> 00:00:35,679
could be anyone from within that range. No one is guaranteed a particular IP address.

5
00:00:35,679 --> 00:00:42,320
Now I did hint at the start of this skill with respect to things like servers on a network

6
00:00:42,320 --> 00:00:48,359
or maybe things like printers. These external devices which are used by other clients within

7
00:00:48,359 --> 00:00:55,799
the network very often we want to have some type of predictability about these IP addresses.

8
00:00:55,799 --> 00:01:01,759
So in this case it does actually make sense that we do have some type of static configuration

9
00:01:01,759 --> 00:01:07,000
such that when these devices come back online they just reach out with a broadcast address

10
00:01:07,000 --> 00:01:13,560
and they can get the same IP address no problem at all. So let's dive in and see how we can

11
00:01:13,560 --> 00:01:20,560
actually do this configuration directly within our DHCP.configuration file. So what we'll do

12
00:01:20,560 --> 00:01:29,840
here is we will go directly back to that file and I will say sudo nano xa dhcp dhcpd.conf

13
00:01:29,840 --> 00:01:36,520
and in we go. Okay so let's scroll on down then. So under our subnets what I'm going to do here is

14
00:01:36,520 --> 00:01:42,760
not use the subnet keyword I'm going to use the host keyword so I'll say host and now I'm going to

15
00:01:42,760 --> 00:01:49,439
give this host a particular name. So let's just imagine that my other Ubuntu machine was acting

16
00:01:49,519 --> 00:01:56,079
as a web server as well okay. I'll just say web server and now what I will do is I will open my

17
00:01:56,079 --> 00:02:02,400
curly brace and then what I'm going to say here is I'm going to say the word hardware and now I'm

18
00:02:02,400 --> 00:02:09,039
going to specify the actual layer 2 MAC address for that particular device because you may recall

19
00:02:09,039 --> 00:02:15,039
the layer 2 address is a physical address that is actually on the network interface card for that

20
00:02:15,039 --> 00:02:22,000
device whereas an IP address is a logical address which is assigned and not particular to the machine.

21
00:02:22,000 --> 00:02:28,560
So if we go back to this machine that we want to give a static IP address to so I can say IP link

22
00:02:28,560 --> 00:02:35,840
to show all my layer 2 information. So let's say we wanted to give this interface here the same IP

23
00:02:35,840 --> 00:02:42,239
address what we would do would take note of its MAC address which is this right here meaning that if

24
00:02:42,240 --> 00:02:49,040
we get a broadcast from this interface the DHCP server will note the MAC address here

25
00:02:49,040 --> 00:02:56,159
and it's going to give it the exact same IP address every single time. So let's try that out then.

26
00:02:56,159 --> 00:03:01,680
So I'm going to say hardware ethernet and now what I'm going to do is to specify that MAC address

27
00:03:02,080 --> 00:03:14,240
I just saw there so that will be 80 colon 00 colon 27 colon D0 colon FE colon E2. So what we're saying

28
00:03:14,240 --> 00:03:20,560
here is if we get a request from an interface which has this particular MAC address we're going

29
00:03:20,560 --> 00:03:27,840
to give that interface a fixed address okay so remember this keyword here and now we specify

30
00:03:27,920 --> 00:03:35,439
what is the fixed IP address so we could just maybe say 172 16 1 dot I don't know 4 let's just

31
00:03:35,439 --> 00:03:42,240
say whatever it may be and I will do my semicolon and then my curly brace so there we have it.

32
00:03:42,240 --> 00:03:48,960
So that would mean if that computer went offline and it suddenly came back online and it sent a DHCP

33
00:03:48,960 --> 00:03:55,920
discover request from that interface we would match on its MAC address and send this particular IP

34
00:03:55,919 --> 00:04:00,959
address now we could shut the machine off we could restart it multiple multiple times every

35
00:04:00,959 --> 00:04:07,359
single time that machine comes back online that interface is going to get this IP address so really

36
00:04:07,359 --> 00:04:12,399
once we've done that we can just save our configuration and all we would have to do would be to restart

37
00:04:12,399 --> 00:04:20,560
our server so those systems CTL restart isc DHCP server and to enter and those new configurations

38
00:04:20,560 --> 00:04:25,519
would take place so now one final thing which I just want to briefly draw your attention to that

39
00:04:25,519 --> 00:04:31,199
you should be aware of for the purposes of the examination is that with respect to our DHCP

40
00:04:31,199 --> 00:04:37,359
configurations much of what is going on is going to be logged now we have to know the location of

41
00:04:37,359 --> 00:04:43,599
where we can find our logging messages now this will vary depending on the system you happen to be on

42
00:04:43,599 --> 00:04:49,120
if you happen to be on a red hat based system this is going to be found very likely within the var

43
00:04:49,199 --> 00:04:56,240
directory and then within the log sub directory and then within here we should have a file called

44
00:04:56,240 --> 00:05:03,120
messages inside here you should find all that type of you know that Dora discover offer request

45
00:05:03,120 --> 00:05:10,560
acknowledge as well as a whole bunch of other DHCP related information however if you happen to be on

46
00:05:10,560 --> 00:05:17,360
an Ubuntu based machine that would be in the var directory within the log directory and it should

47
00:05:17,360 --> 00:05:24,400
actually be in something called daemon dot log for Ubuntu machines this should actually be where

48
00:05:24,400 --> 00:05:32,160
you find those DHCP log messages and that really is all we have to do with respect to our static

49
00:05:32,160 --> 00:05:39,040
host configuration via DHCP we take a note of the hardware address and then we specify that fixed

50
00:05:39,040 --> 00:05:44,879
address that we want to bind to that hardware address and suddenly those DHCP offer from the

51
00:05:44,879 --> 00:05:51,600
server are going to be very consistent offering out the same IP address to the same interface very

52
00:05:51,600 --> 00:05:57,199
very handy like I say when dealing with servers and printers in particular okay doc so I hope

53
00:05:57,199 --> 00:06:00,800
this has been informative for you and I'd like to thank you for viewing

