1
00:00:00,000 --> 00:00:18,039
Hey guys and welcome back. So what I want to talk to you about in this skill right here

2
00:00:18,039 --> 00:00:25,240
is revolving around the concept of troubleshooting, network issues and if you happen to be a

3
00:00:25,239 --> 00:00:30,439
network engineer or a systems administrator you will know that we do happen to get a lot

4
00:00:30,439 --> 00:00:35,759
of issues on the networks. We've been able to troubleshoot those issues is obviously

5
00:00:35,759 --> 00:00:41,679
going to be very very helpful. It's going to make your life much much easier. So definitely

6
00:00:41,679 --> 00:00:47,239
a very useful concept to have under your belt. So with that said let's get to it then. Now

7
00:00:47,239 --> 00:00:52,480
the very first thing that I want to talk to you about in this nugget right here specifically

8
00:00:52,479 --> 00:00:59,399
relates to network configuration files. Now you may be aware that with respect to Linux

9
00:00:59,399 --> 00:01:07,039
we can manage many of our configurations directly via such text files and this is exactly what

10
00:01:07,039 --> 00:01:11,679
I'm talking about right here. We're going to manipulate particular text files with

11
00:01:11,679 --> 00:01:19,039
respect to our network settings. Now for the purposes of the LPIC2 examination there are

12
00:01:19,120 --> 00:01:24,920
some particular configuration files that we do want to be aware of. So let me just highlight

13
00:01:24,920 --> 00:01:31,360
what those are, give you a general description of what they do and we might even get to look at a

14
00:01:31,360 --> 00:01:37,160
few. So let's get to it then. Now the very first one which I want to talk to you about is a

15
00:01:37,160 --> 00:01:44,760
configuration file within the Etsy directory and this is the Etsy hosts file. Now what this

16
00:01:44,840 --> 00:01:52,280
configuration file does is it's going to allow us to associate particular host names to IP addresses.

17
00:01:52,280 --> 00:01:58,359
Now you may be thinking that this sounds pretty much like what DNS does. This is really what we

18
00:01:58,359 --> 00:02:04,040
are talking about here. The difference here is that this particular file is going to be used for

19
00:02:04,040 --> 00:02:11,360
DNS resolution on your local network. So if you happen to have a particular address on your local

20
00:02:11,360 --> 00:02:21,920
network let's say the address is 192.168.0.50 and maybe this is a web server whatever it may be.

21
00:02:21,920 --> 00:02:29,280
Instead you could just type in something like I don't know let's just maybe say my server.cbtn.com

22
00:02:29,280 --> 00:02:35,760
whatever it may be. The point is is that as opposed to having to send a particular request to an

23
00:02:35,759 --> 00:02:42,719
external DNS server to look up this host name and resolve it to that particular IP address we could

24
00:02:42,719 --> 00:02:49,599
just reference particular local files on our system that will do this binding for us. So when we

25
00:02:49,599 --> 00:02:56,000
happen to type in this address it's going to be recognized as a host name within our what's it

26
00:02:56,000 --> 00:03:02,479
called the Etsy hosts file and instead of doing that DNS look up we can just resolve it directly

27
00:03:03,039 --> 00:03:10,159
to the IP address we bind it to within this file right here. Now of course you absolutely can set

28
00:03:10,159 --> 00:03:16,639
up a DNS server for your local network but quite honestly this can be cumbersome it can be additional

29
00:03:16,639 --> 00:03:22,719
complexity that you perhaps may want to avoid especially if you are just dealing with a private

30
00:03:22,719 --> 00:03:29,439
local network this can be a great solution for you. So let me show you what this configuration

31
00:03:29,439 --> 00:03:35,039
file looks like then shall I. Okay so what I will say is nano and I'm going to the Etsy directory

32
00:03:35,039 --> 00:03:41,599
and then the host file notice that if I do not use super user privileges and I enter this file

33
00:03:41,599 --> 00:03:48,079
it's going to tell me that this is unwriteable we know why because it is in the Etsy directory this

34
00:03:48,079 --> 00:03:54,719
is going to be system wide configurations therefore we need super user privileges. Now we can see here

35
00:03:54,719 --> 00:04:00,719
we already have some configurations here now let me just show you what some of these are so say for

36
00:04:00,719 --> 00:04:11,599
example here we have this address 127.0.0.1 now you may recall this happens to be the IPv4

37
00:04:11,599 --> 00:04:16,480
look back address this is super super common you're going to see it everywhere not just my machine

38
00:04:16,480 --> 00:04:21,439
it'll be the same for you too. Now what is happening here is that on the left hand side

39
00:04:22,000 --> 00:04:28,639
let's split this here on this side as the IP addresses and on this side are the host names

40
00:04:28,639 --> 00:04:35,360
so what this actually means here is that if I just happen to type in the word local host that is

41
00:04:35,360 --> 00:04:46,319
going to be resolved to the IP address 127.0.0.1 you see that similarly if I just say IPv0 that is

42
00:04:46,399 --> 00:04:54,399
going to be resolved to the IP address 127.0.1.1 now a little bit below this might look a little

43
00:04:54,399 --> 00:05:01,600
bit more confusing but the reality is it is not confusing at all this is just simply IPv6 configurations

44
00:05:01,600 --> 00:05:07,279
and what we're looking at are hexadecimal based addresses it's still the same concept that on

45
00:05:07,279 --> 00:05:13,920
the left hand side right here we have our IP addresses just IPv6 addresses and on the right

46
00:05:14,000 --> 00:05:20,960
we can see what we are resolving this to so if I would just happen to go and let's say for example

47
00:05:20,960 --> 00:05:27,120
ping one of these host names let's just say ping and I'll just say local host what my machine is

48
00:05:27,120 --> 00:05:33,200
going to do it's going to see this as a host name it's not an actual IP address and it's going to

49
00:05:33,200 --> 00:05:39,520
look in this configuration file right here it's a host it's going to look for this particular entry

50
00:05:39,519 --> 00:05:46,079
in this case it finds it right here and it's going to say what IP address is associated with this name

51
00:05:46,079 --> 00:05:54,159
and it's going to find this value right here 127.0.0.1 in essence that is the address I will ping so

52
00:05:54,159 --> 00:06:00,399
let's just try this out then so if I just escape out here and I just say ping local host and I

53
00:06:00,399 --> 00:06:05,359
hit enter check this out we're actually getting a ping and within the brackets if I just press

54
00:06:05,360 --> 00:06:13,840
control Z to stop this you can see the address indeed is 127.0.0.1 similarly if I just say

55
00:06:13,840 --> 00:06:21,600
ping IPv0 look at this we are also just pinging this address right here so check this out I also

56
00:06:21,600 --> 00:06:27,600
have this other Linux machine here it's actually a windows machine running windows subsystem for

57
00:06:27,600 --> 00:06:33,840
Linux but you can just treat it as a separate Linux machine entirely so I'll just minimize mine

58
00:06:33,839 --> 00:06:39,759
right now and I'll open up my Linux here okay so if I open up this machine and I just say IP adder

59
00:06:39,759 --> 00:06:47,039
and I just grep to filter the results and I will grep for 192.168.0.0 so we can see here this is the

60
00:06:47,039 --> 00:06:55,120
address right here 192.168.0.39 on this machine whereas my main Linux machine if I open it up

61
00:06:55,120 --> 00:07:03,679
we can see this is 0.65 now I can actually ping this machine ping 192.168.0.39 because it is on

62
00:07:03,680 --> 00:07:10,079
the same local network and if I hit this now we can see this pings quite the thing so this means

63
00:07:10,079 --> 00:07:16,639
we have communication between this device here on the right and this device here on the left but

64
00:07:16,639 --> 00:07:23,360
again if I wanted to associate a particular hostname so that I didn't have to maybe say remember the

65
00:07:23,360 --> 00:07:29,199
IP address I could just make a modification in my etsy host files let me just do that right now

66
00:07:29,199 --> 00:07:33,759
what I will do here I'll just full screen this and of course I'm going to have to use super

67
00:07:33,759 --> 00:07:38,800
user privileges to modify this and type in my passwords we'll tell if I typed in the correct

68
00:07:38,800 --> 00:07:43,759
password there we go okay so on the left hand side let me just get some space what I can see here is

69
00:07:43,759 --> 00:07:51,599
the IP address 192.168.0.39 and all I will do in the right here is associate that with a particular

70
00:07:51,599 --> 00:07:58,159
hostname let me just call this trevor box I should imagine this is my good friend trevor's machine

71
00:07:58,160 --> 00:08:03,439
and he's on the same network so I'll just save this right now and I'll escape now I can just say

72
00:08:03,439 --> 00:08:10,000
ping trevor box and to enter and look at this we are successfully pinging this device and we are

73
00:08:10,000 --> 00:08:18,080
pinging 192.168.0.39 we have been able to resolve this by making the modification directly within

74
00:08:18,080 --> 00:08:24,879
this etsy host file really try to remember that now one thing I will say is that when we go in here

75
00:08:24,879 --> 00:08:30,399
we can actually just like we see right here we actually see two entries you see them on the left

76
00:08:30,399 --> 00:08:39,679
we have this here ip6-localhost and ip6-lookback what is happening here is the use of an alias

77
00:08:39,679 --> 00:08:45,519
so what I could do here is I can modify this let's maybe also call this machine2 let's say okay so

78
00:08:45,519 --> 00:08:51,279
that means if I ping machine2 it will resolve to this IP address or alternatively I could refer to

79
00:08:51,439 --> 00:08:58,879
it as trevor box so if I save this and escape out and I just ping machine2 notice this that we're

80
00:08:58,879 --> 00:09:05,199
actually getting a response back now the response actually is saying the IP address here but the

81
00:09:05,199 --> 00:09:11,519
device is called trevor box since that is the first name associated with the IP address but we still

82
00:09:11,519 --> 00:09:18,480
have the ability to refer to this as an alias okay and again we could add as many aliases as we so

83
00:09:18,480 --> 00:09:25,360
wish I could also say for example pizza box and say ping pizza box is still going to get a response

84
00:09:25,360 --> 00:09:32,080
from trevor box at 192.1680.39 so that is one of the big configuration files we have to be aware of

85
00:09:32,080 --> 00:09:41,519
the next one I want to talk to you about is etsy once again same big location and it is the resolve.conf

86
00:09:41,519 --> 00:09:47,360
configuration file and notice this is resolve without an e on the end okay just remember the

87
00:09:47,360 --> 00:09:54,159
spelling here within this configuration file this is well no surprise is the resolver configuration

88
00:09:54,159 --> 00:10:01,840
file and what this is going to allow us to do is going to allow us to specify dns servers as well as

89
00:10:01,840 --> 00:10:06,639
the search domains for the particular host so let me actually show you what this configuration

90
00:10:06,639 --> 00:10:13,920
file will look like then so we will clear the screen if I say sudo nano etsy resolve.conf

91
00:10:14,399 --> 00:10:20,799
let me go up there we go go in here check this out what we're actually seeing here is the ip address

92
00:10:20,799 --> 00:10:28,559
of my name server i.e my dns server so we use the name server keyword here and then the ip address

93
00:10:28,559 --> 00:10:34,879
now this is just going to be a local host lookup you can tell this because it is a 127 based ip

94
00:10:34,879 --> 00:10:40,639
address we're thinking lookbacks here now we have this keyword here called options this allows us to

95
00:10:40,639 --> 00:10:46,559
specify additional options now some options you may see say for example you might see a timeout

96
00:10:46,559 --> 00:10:53,120
option so that would mean that if you happen to specify multiple name servers as opposed to just

97
00:10:53,120 --> 00:10:58,480
one right here you listed maybe say two different domain name servers what you could do with the

98
00:10:58,480 --> 00:11:05,519
timeout option is you could specify the time and seconds that you should wait for a particular

99
00:11:05,519 --> 00:11:11,600
response from a dns server before attempting to go to the next server so what i'm seeing here is if

100
00:11:11,600 --> 00:11:18,799
we happen to use two different servers let's just say we had one at 192 168 1.1 and then maybe we're

101
00:11:18,799 --> 00:11:26,879
also using google's public dns server of 8.8.8.8 we could say a timeout and the options parameter

102
00:11:26,879 --> 00:11:34,079
and set the timeout to 2 that would mean if we happen to send a dns request we would first use

103
00:11:34,080 --> 00:11:40,639
this particular dns server but if we did not get a response back within the two seconds timeout

104
00:11:40,639 --> 00:11:46,800
we would then abandon this and begin to use this to resolve the query now the options parameter is

105
00:11:46,800 --> 00:11:52,080
going to allow us to specify other things as opposed to the timeout things such as the maximum

106
00:11:52,080 --> 00:11:59,040
amount of attempts that we would want to issue i.e the amount of queries before a failure occurs

107
00:11:59,120 --> 00:12:05,199
so let me just modify this configuration file right now if i go in here and i happen to type in

108
00:12:05,199 --> 00:12:14,799
a let's just say a bad address 192 168 0.145 let's just maybe say and i save you an escape if i try

109
00:12:14,799 --> 00:12:21,279
to ping google.com we're not going to be able to get a particular response that is because

110
00:12:21,279 --> 00:12:27,199
we can see here we have a failure in name resolution what is happening is that we're trying to send

111
00:12:27,280 --> 00:12:33,520
this request google.com and have it be resolved quite frankly by a server which does not exist

112
00:12:33,520 --> 00:12:39,360
there is nothing on my local network with this ip address now what i could do is i could in fact

113
00:12:39,360 --> 00:12:46,800
specify google's public dns server this is a very well known dns server of 8.8.8.8 if i save this

114
00:12:46,800 --> 00:12:53,440
this happens to be a real dns server out on the internet so if i now resend this request notice

115
00:12:53,520 --> 00:12:58,960
here but actually now resolving this to a particular ip address we can see this indeed

116
00:12:58,960 --> 00:13:06,000
right here so within this configuration file this is where we specify which dns server we want to use

117
00:13:06,000 --> 00:13:12,240
and we can specify additional options i.e which server to use next after a particular time it

118
00:13:12,240 --> 00:13:17,840
happens or after a amount of failed attempts whatever it may be you can control these parameters

119
00:13:17,840 --> 00:13:22,720
within this configuration file now another configuration file we have to be aware of

120
00:13:23,280 --> 00:13:30,560
this one is debian based specific i.e this is a configuration file you will find on debian systems

121
00:13:30,560 --> 00:13:37,840
and this one is again within the etsy directory not surprising you here and it is in the network

122
00:13:37,840 --> 00:13:45,840
folder and the file is called interfaces so this particular configuration file is the primary

123
00:13:45,840 --> 00:13:52,560
file on debian based systems whereby you can make interface configuration changes so you may recall

124
00:13:52,560 --> 00:14:01,840
we have concepts such as dhcp this is how an interface can dynamically and automatically get an ip

125
00:14:01,840 --> 00:14:08,800
address and alternatively we can statically configure an ip address i.e we actually type the ip

126
00:14:08,800 --> 00:14:13,840
address in ourselves manually if we want to be able to do such things for maybe say a particular

127
00:14:13,840 --> 00:14:21,200
interface say for example if i do an if config we can see this interface right here enp0s3 if we

128
00:14:21,200 --> 00:14:29,200
wanted to make a modification to its ip address such that it would be manually changed or request an

129
00:14:29,200 --> 00:14:36,399
ip address via dhcp the location whereby we could do such a thing again is in the etsy network

130
00:14:36,399 --> 00:14:43,519
interfaces file now on red hat based systems every single interface on your machine say for

131
00:14:43,600 --> 00:14:51,919
example you had eth0 and eth1 and maybe a different look back address whatever it may be each interface

132
00:14:51,919 --> 00:14:58,399
would actually have its own separate configuration file now each of these configuration files will

133
00:14:58,399 --> 00:15:04,799
be found within a particular directory and this is going to be in the etsy directory it will be in

134
00:15:04,799 --> 00:15:12,879
the sysconfig directory and within this it's going to be in a directory called network-corrupts

135
00:15:12,960 --> 00:15:18,720
i'm kind of running out of space here but this directory here is going to have multiple configuration

136
00:15:18,720 --> 00:15:25,519
files for every individual interface as opposed to debian whereby we have one file whereby we

137
00:15:25,519 --> 00:15:31,759
can specify the configurations for all interfaces again just like with the one we saw before we

138
00:15:31,759 --> 00:15:39,279
can make changes to things such as dhcp configuration settings as well as static ip address allocation

139
00:15:39,279 --> 00:15:44,159
just a different way of handling this thing depending on the family of operating system

140
00:15:44,159 --> 00:15:49,519
you're using debian versus red hats now the last configuration file that we do have to be aware of

141
00:15:49,519 --> 00:15:56,559
once this is again in the etsy directory easy to remember that point and it is called the ns

142
00:15:56,559 --> 00:16:05,600
switch configuration file this is the name service switch config file and what this is used to do

143
00:16:05,680 --> 00:16:13,360
it's used to determine which source you should get your dns from and in which order to remember

144
00:16:13,360 --> 00:16:22,080
we had our etsy hosts file this is a configuration file and we would also have our name server which

145
00:16:22,080 --> 00:16:30,399
we found in our resolve.conf file now the question is if i happen to make a request for a name resolution

146
00:16:30,399 --> 00:16:36,399
such as google.com what should i consult first should i actually look in the configuration

147
00:16:36,399 --> 00:16:43,199
file for my local host or should i just go directly to the name server and make a dns request to the

148
00:16:43,199 --> 00:16:50,879
server itself well we can choose our priority by specifying this within xanss switch let me just

149
00:16:50,879 --> 00:16:58,079
show you to do nano xanss switch.conf am i going here we can see the actual process here so look

150
00:16:58,080 --> 00:17:04,559
at this see for this right here host we can see that for looking up hosts we would first consult

151
00:17:04,559 --> 00:17:10,880
our files first and then if we could not resolve that particular host name from our local files we

152
00:17:10,880 --> 00:17:17,920
would then use the dns query now what i actually could do here is i could invert this such that

153
00:17:17,920 --> 00:17:21,759
and of course i'm not actually going to be able to save this because i'm not using super user

154
00:17:21,759 --> 00:17:28,799
privileges but i could just remove this right here and say dns and then files that would mean that

155
00:17:28,799 --> 00:17:36,799
even if we had an entry within the xanss host file configuration it would actually not be looked up

156
00:17:36,799 --> 00:17:42,640
instead we would just send a request to the dns server first and only if that happened to fail and

157
00:17:42,640 --> 00:17:49,759
we couldn't get a response then would we fall back and use our local files and again the order of

158
00:17:49,759 --> 00:17:55,519
which is specified within xanss switch.conf now there actually is more things as you can probably

159
00:17:55,519 --> 00:18:02,240
gather that you can do within this particular file but with respect to the scope of the lpik2

160
00:18:02,240 --> 00:18:08,640
examination this here is really what we are focusing in on okay doc so i do know that was a lot to

161
00:18:08,640 --> 00:18:13,759
take in for these particular configuration files but like i say understanding what these files

162
00:18:13,759 --> 00:18:19,200
actually are and what they can do as well as their particular location is going to give you a lot of

163
00:18:19,200 --> 00:18:25,039
granular control over how your network operates and by having this control and understanding

164
00:18:25,039 --> 00:18:30,000
of the configuration files this is going to go a long way for you to be able to resolve and

165
00:18:30,000 --> 00:18:35,519
troubleshoot particular network issues whether it's ip address allocation or say for example

166
00:18:35,519 --> 00:18:41,279
dns lookups okay doc so i hope this has been informative for you and i'd like to thank you for viewing

