1
1

00:00:00,000  -->  00:00:03,700
<v ->Ipconfig, ifconfig and ip.</v>
2

2

00:00:03,700  -->  00:00:06,184
In this video, we're going to cover the ipconfig,
3

3

00:00:06,184  -->  00:00:08,690
ifconfig and ip command line tools
4

4

00:00:08,690  -->  00:00:10,140
and how we use them in maintaining
5

5

00:00:10,140  -->  00:00:11,810
and troubleshooting our networks.
6

6

00:00:11,810  -->  00:00:13,602
First, we have ipconfig.
7

7

00:00:13,602  -->  00:00:16,810
Ipconfig, or IP Configuration, is used to display
8

8

00:00:16,810  -->  00:00:20,020
all of the current TCP IP network configuration values
9

9

00:00:20,020  -->  00:00:23,100
and refreshes the DHCP and DNS settings
10

10

00:00:23,100  -->  00:00:25,140
for a Windows client or server.
11

11

00:00:25,140  -->  00:00:27,380
If you enter ipconfig at the command prompt,
12

12

00:00:27,380  -->  00:00:29,430
you're going to get some basic information back
13

13

00:00:29,430  -->  00:00:31,610
about the TCP IP network configuration
14

14

00:00:31,610  -->  00:00:33,800
in use by your Windows client.
15

15

00:00:33,800  -->  00:00:37,140
In this example, you could see my IPv6 link-local address,
16

16

00:00:37,140  -->  00:00:40,470
my IPv4 address of 10.0.2.15,
17

17

00:00:40,470  -->  00:00:44,260
my subnet mask of 255.255.255.0
18

18

00:00:44,260  -->  00:00:47,740
and my default gateway of 10.0.2.2.
19

19

00:00:47,740  -->  00:00:49,470
There isn't a whole lot of details here,
20

20

00:00:49,470  -->  00:00:51,630
but it does give you the basics.
21

21

00:00:51,630  -->  00:00:54,110
Now, for example, if I entered ipconfig
22

22

00:00:54,110  -->  00:00:58,430
and my IP address was listed as 169.254.132.51,
23

23

00:00:59,690  -->  00:01:01,960
that would indicate I have a DHCP issue,
24

24

00:01:01,960  -->  00:01:04,510
because my computer is now assigned an APIPA address
25

25

00:01:04,510  -->  00:01:07,200
or automatic private IP address value.
26

26

00:01:07,200  -->  00:01:10,040
Now, if this was the case, I could try to get a new IP
27

27

00:01:10,040  -->  00:01:11,435
by releasing and renewing my connection
28

28

00:01:11,435  -->  00:01:13,600
or by rebooting my machine.
29

29

00:01:13,600  -->  00:01:15,650
If that doesn't work, then I can troubleshoot
30

30

00:01:15,650  -->  00:01:19,080
the DHCP server and ensure that it's functioning properly.
31

31

00:01:19,080  -->  00:01:20,880
To release the current IP address,
32

32

00:01:20,880  -->  00:01:23,960
you have to enter the ipconfig /release command
33

33

00:01:23,960  -->  00:01:25,120
and hit ENTER.
34

34

00:01:25,120  -->  00:01:26,500
At this point, you're going to see
35

35

00:01:26,500  -->  00:01:28,560
your IP configuration displayed again,
36

36

00:01:28,560  -->  00:01:31,350
this time showing you have no IPv4 address,
37

37

00:01:31,350  -->  00:01:34,210
no subnet mask and no default gateway assigned.
38

38

00:01:34,210  -->  00:01:36,360
To attempt to get a new DHCP address,
39

39

00:01:36,360  -->  00:01:40,260
you're going to enter ipconfig /renew and then you press ENTER.
40

40

00:01:40,260  -->  00:01:43,480
Now you're going to get an IPv4 address, a subnet mask
41

41

00:01:43,480  -->  00:01:46,460
and a default gateway assigned through the DHCP DORA
42

42

00:01:46,460  -->  00:01:50,000
or discover, offer, request and acknowledge process.
43

43

00:01:50,000  -->  00:01:52,500
Now, you may remember that DHCP actually gives up
44

44

00:01:52,500  -->  00:01:54,420
a bit more information though, right?
45

45

00:01:54,420  -->  00:01:56,450
What is our DNS server's IP address?
46

46

00:01:56,450  -->  00:01:59,320
When is my lease going to be obtained and when does it expire?
47

47

00:01:59,320  -->  00:02:00,800
How can I find my Mac address
48

48

00:02:00,800  -->  00:02:02,250
if I need to know the physical address
49

49

00:02:02,250  -->  00:02:04,640
for some kind of troubleshooting of layer 2 issues?
50

50

00:02:04,640  -->  00:02:06,900
All of these details simply aren't being displayed
51

51

00:02:06,900  -->  00:02:09,500
when I type in ipconfig and hitting ENTER though.
52

52

00:02:09,500  -->  00:02:13,070
So I want to enter ipconfig /all,
53

53

00:02:13,070  -->  00:02:15,368
then I'll be able to see all these additional details
54

54

00:02:15,368  -->  00:02:18,210
about my TCP IP configuration.
55

55

00:02:18,210  -->  00:02:21,780
Now, here I can see my host name, MSEDGEWIN10.
56

56

00:02:21,780  -->  00:02:23,360
I can also see a description of the model
57

57

00:02:23,360  -->  00:02:24,380
of the network adapter
58

58

00:02:24,380  -->  00:02:26,570
or the network interface card I have installed.
59

59

00:02:26,570  -->  00:02:27,860
I can see the physical address
60

60

00:02:27,860  -->  00:02:30,500
and the fact that DHCP is enabled on this machine,
61

61

00:02:30,500  -->  00:02:32,540
as well as the auto configuration being enabled
62

62

00:02:32,540  -->  00:02:34,940
if DHCP fails to get an IP address,
63

63

00:02:34,940  -->  00:02:37,410
which means I can have an APIPA address assigned
64

64

00:02:37,410  -->  00:02:38,290
if I need to.
65

65

00:02:38,290  -->  00:02:40,610
I can also see the IP address and subnet mask,
66

66

00:02:40,610  -->  00:02:43,110
just like I did in the summarized ipconfig version,
67

67

00:02:43,110  -->  00:02:45,410
but now I also see my lease times of the issue
68

68

00:02:45,410  -->  00:02:47,860
and expiration for that DHCP address.
69

69

00:02:47,860  -->  00:02:49,750
I also see my default gateway,
70

70

00:02:49,750  -->  00:02:53,100
my DHCP server and DNS servers' IP addresses.
71

71

00:02:53,100  -->  00:02:54,730
That is a lot of information
72

72

00:02:54,730  -->  00:02:57,150
and it can be really helpful to you as a network technician
73

73

00:02:57,150  -->  00:02:59,010
during your troubleshooting efforts.
74

74

00:02:59,010  -->  00:03:00,795
Next, we have ifconfig.
75

75

00:03:00,795  -->  00:03:03,640
Now, ifconfig stands for interface configuration
76

76

00:03:03,640  -->  00:03:05,690
and it's the command line tool used in Unix,
77

77

00:03:05,690  -->  00:03:09,410
Linux and OS X systems to display IP address information
78

78

00:03:09,410  -->  00:03:11,913
just like we did with ipconfig in Windows.
79

79

00:03:11,913  -->  00:03:13,920
Ipconfig only works in Windows,
80

80

00:03:13,920  -->  00:03:15,530
so if you're going to be working on a Unix,
81

81

00:03:15,530  -->  00:03:18,970
Linux or OS X system, you have to use ifconfig.
82

82

00:03:18,970  -->  00:03:21,860
Now, ifconfig is used to configure your network interfaces
83

83

00:03:21,860  -->  00:03:24,060
and troubleshooting network connectivity issues.
84

84

00:03:24,060  -->  00:03:26,070
If you enter the command, ifconfig by itself
85

85

00:03:26,070  -->  00:03:27,970
and you press ENTER, the system is going to display
86

86

00:03:27,970  -->  00:03:30,440
the status of the currently active interfaces.
87

87

00:03:30,440  -->  00:03:32,490
If you only want to see a single interface though,
88

88

00:03:32,490  -->  00:03:35,247
like en0, you can enter ifconfig en0.
89

89

00:03:36,500  -->  00:03:37,440
Now, if you want to display
90

90

00:03:37,440  -->  00:03:39,410
all the interfaces available on the system,
91

91

00:03:39,410  -->  00:03:41,580
even if those interfaces are currently down,
92

92

00:03:41,580  -->  00:03:43,030
you would enter, ifconfig -a,
93

93

00:03:43,960  -->  00:03:45,440
which is like the /all command
94

94

00:03:45,440  -->  00:03:47,270
that we used inside of Windows.
95

95

00:03:47,270  -->  00:03:50,960
Now, the big difference here between ifconfig and ipconfig
96

96

00:03:50,960  -->  00:03:51,793
is that you're going to get
97

97

00:03:51,793  -->  00:03:54,130
the same amount of information with ifconfig
98

98

00:03:54,130  -->  00:03:56,160
regardless of whether you're using it by itself,
99

99

00:03:56,160  -->  00:03:59,010
with an active interface or with the -a option.
100

100

00:03:59,010  -->  00:04:00,990
There's no brief version of it.
101

101

00:04:00,990  -->  00:04:02,760
The only difference is the number of interfaces
102

102

00:04:02,760  -->  00:04:03,870
that are going to be returned,
103

103

00:04:03,870  -->  00:04:05,580
whether you're saying a single interface,
104

104

00:04:05,580  -->  00:04:08,300
the active interfaces or all the interfaces.
105

105

00:04:08,300  -->  00:04:11,570
Notice here, I typed in ifconfig and under en0,
106

106

00:04:11,570  -->  00:04:15,040
you can see inet6, which list out my IPv6 address.
107

107

00:04:15,040  -->  00:04:17,850
And I see inet, which is my IPv4 address,
108

108

00:04:17,850  -->  00:04:21,410
which is 192.168.1.54.
109

109

00:04:21,410  -->  00:04:23,680
All the other information I need is there too.
110

110

00:04:23,680  -->  00:04:25,440
This includes things like my physical address
111

111

00:04:25,440  -->  00:04:27,750
or Mac address, which is listed as ether,
112

112

00:04:27,750  -->  00:04:29,650
my net mask or subnet mask,
113

113

00:04:29,650  -->  00:04:31,460
which is shown in hexadecimal equivalent,
114

114

00:04:31,460  -->  00:04:35,460
but it's still going to be equivalent to 255.255.255.0
115

115

00:04:35,460  -->  00:04:36,480
like you're used to.
116

116

00:04:36,480  -->  00:04:38,500
It's going to have the broadcast IP for this network
117

117

00:04:38,500  -->  00:04:40,490
and the fact that this network is up.
118

118

00:04:40,490  -->  00:04:43,890
As you can see by default, ifconfig has more details
119

119

00:04:43,890  -->  00:04:46,550
than ipconfig does on a Windows client.
120

120

00:04:46,550  -->  00:04:48,190
Now, if you need additional details,
121

121

00:04:48,190  -->  00:04:51,580
you can enter ifconfig -v and then the interface.
122

122

00:04:51,580  -->  00:04:53,650
The -v stands for verbose,
123

123

00:04:53,650  -->  00:04:55,650
meaning tell me a lot about this thing.
124

124

00:04:55,650  -->  00:04:57,940
So you can see here, I get a lot more details,
125

125

00:04:57,940  -->  00:04:59,280
including the type of the connection,
126

126

00:04:59,280  -->  00:05:00,860
in this case, it's WiFi,
127

127

00:05:00,860  -->  00:05:03,420
the speed of the transmission for the uplinks and downlinks
128

128

00:05:03,420  -->  00:05:05,831
and if the quality of service is enabled or not.
129

129

00:05:05,831  -->  00:05:08,730
Ifconfig can also be used to control the network connection
130

130

00:05:08,730  -->  00:05:11,080
and not simply display information about it.
131

131

00:05:11,080  -->  00:05:13,640
If, for example, I want to turn off that connection,
132

132

00:05:13,640  -->  00:05:15,630
I can use ifconfig down,
133

133

00:05:15,630  -->  00:05:17,700
and this will shut down the network interface.
134

134

00:05:17,700  -->  00:05:19,280
If I use ifconfig up,
135

135

00:05:19,280  -->  00:05:21,300
this will activate that network interface.
136

136

00:05:21,300  -->  00:05:23,410
If you're using static assignments on an interface,
137

137

00:05:23,410  -->  00:05:25,380
you first need to shut down the interface
138

138

00:05:25,380  -->  00:05:27,810
and then set the new address and subnet mask
139

139

00:05:27,810  -->  00:05:29,690
and then you can activate the interface again
140

140

00:05:29,690  -->  00:05:31,910
by using ifconfig up.
141

141

00:05:31,910  -->  00:05:34,200
Remember, ifconfig down turns off
142

142

00:05:34,200  -->  00:05:36,900
your network interface card and if you enter ifconfig up,
143

143

00:05:36,900  -->  00:05:39,560
it'll turn that network interface card back on.
144

144

00:05:39,560  -->  00:05:41,210
These are really important to remember,
145

145

00:05:41,210  -->  00:05:43,100
because if you're not seeing any network connectivity
146

146

00:05:43,100  -->  00:05:44,650
on a Linux client or server,
147

147

00:05:44,650  -->  00:05:46,760
it could be that somebody mistakenly turned off
148

148

00:05:46,760  -->  00:05:49,860
that network card and you just need to enter ifconfig up
149

149

00:05:49,860  -->  00:05:51,410
to turn it back on.
150

150

00:05:51,410  -->  00:05:52,423
Now, as of this recording,
151

151

00:05:52,423  -->  00:05:55,480
ifconfig is considered officially deprecated,
152

152

00:05:55,480  -->  00:05:57,390
which means it's now considered to be obsolete
153

153

00:05:57,390  -->  00:05:59,490
in modern systems and network administrators
154

154

00:05:59,490  -->  00:06:01,390
should instead be using the ip command,
155

155

00:06:01,390  -->  00:06:02,700
which has replaced it.
156

156

00:06:02,700  -->  00:06:05,354
That said, many systems still support ifconfig,
157

157

00:06:05,354  -->  00:06:06,730
at least for now.
158

158

00:06:06,730  -->  00:06:07,940
So you should still learn it
159

159

00:06:07,940  -->  00:06:10,170
in case you're working on an older system.
160

160

00:06:10,170  -->  00:06:12,160
Now, finally, we have ip.
161

161

00:06:12,160  -->  00:06:14,740
The ip command is going to be used to assign an address
162

162

00:06:14,740  -->  00:06:15,860
to a network interface
163

163

00:06:15,860  -->  00:06:18,530
or configure a network interface perimeter on a Unix,
164

164

00:06:18,530  -->  00:06:20,970
Linux or OS X operating system.
165

165

00:06:20,970  -->  00:06:23,060
Ip is a newer tool and it was designed
166

166

00:06:23,060  -->  00:06:25,600
as a modern replacement for ifconfig.
167

167

00:06:25,600  -->  00:06:28,140
The ip command stands for internet protocol
168

168

00:06:28,140  -->  00:06:31,040
and it supports all the same functions as the if command.
169

169

00:06:31,040  -->  00:06:33,770
The ip command though can do a whole lot more.
170

170

00:06:33,770  -->  00:06:36,360
Now, the ip command is actually an entire suite of tools
171

171

00:06:36,360  -->  00:06:39,010
that supports not just configuring your interface address,
172

172

00:06:39,010  -->  00:06:41,180
but also things like routing, creating tunnels
173

173

00:06:41,180  -->  00:06:43,374
and much, much more that is way beyond the scope
174

174

00:06:43,374  -->  00:06:46,320
of this particular course and this exam.
175

175

00:06:46,320  -->  00:06:48,650
Now, instead I want to focus on how we can replace
176

176

00:06:48,650  -->  00:06:50,900
the if command using what we learned
177

177

00:06:50,900  -->  00:06:54,140
with similar features inside of the ip command suite.
178

178

00:06:54,140  -->  00:06:56,380
Now first, if I want to display the configuration
179

179

00:06:56,380  -->  00:07:00,270
of my interfaces, I can simply enter ip a,
180

180

00:07:00,270  -->  00:07:01,950
instead of using ifconfig
181

181

00:07:01,950  -->  00:07:04,240
and this is going to give me the same type of information.
182

182

00:07:04,240  -->  00:07:07,950
The ip a stands for ip address
183

183

00:07:07,950  -->  00:07:10,130
inside of the ip suite of tools.
184

184

00:07:10,130  -->  00:07:12,590
Second, if I need to assign a static IP address
185

185

00:07:12,590  -->  00:07:16,700
to an interface, I can use ip a add,
186

186

00:07:16,700  -->  00:07:20,460
the IP address, dev, whatever device I'm using.
187

187

00:07:20,460  -->  00:07:22,255
For example, this will set the IP address
188

188

00:07:22,255  -->  00:07:26,430
to the device interface known as eth0 or ethernet zero
189

189

00:07:26,430  -->  00:07:30,400
as 192.18.1.123.
190

190

00:07:30,400  -->  00:07:32,254
Third, we can remove that static IP address
191

191

00:07:32,254  -->  00:07:37,254
by entering ip a del, IP address, dev, device
192

192

00:07:38,840  -->  00:07:41,290
and that will be able to take out that IP address
193

193

00:07:41,290  -->  00:07:42,710
from that device.
194

194

00:07:42,710  -->  00:07:45,060
Now, fourth, if we want to change our Mac address,
195

195

00:07:45,060  -->  00:07:47,200
we can conduct Mac spoofing simply
196

196

00:07:47,200  -->  00:07:52,200
by entering ip link set dev, the device,
197

197

00:07:52,450  -->  00:07:55,317
in this case eth0, address,
198

198

00:07:55,317  -->  00:07:57,200
and the Mac address we want to use.
199

199

00:07:57,200  -->  00:08:02,160
In this case, 00:11:22:33:44:55
200

200

00:08:02,160  -->  00:08:04,390
or whatever other Mac address you want to use.
201

201

00:08:04,390  -->  00:08:07,210
Fifth, if you want to make your network interface card operate
202

202

00:08:07,210  -->  00:08:08,470
in promiscuous mode,
203

203

00:08:08,470  -->  00:08:10,850
this will allow it to listen to all the traffic on a network
204

204

00:08:10,850  -->  00:08:13,860
and not just the traffic destined for its own Mac address.
205

205

00:08:13,860  -->  00:08:18,377
To do this, you can enter IP link set dev, your device,
206

206

00:08:20,000  -->  00:08:24,120
eth0 in this case, promisc on.
207

207

00:08:24,120  -->  00:08:26,426
This is really useful if you're setting up a packet sniffer
208

208

00:08:26,426  -->  00:08:30,130
or a packet capture on a Linux client or a server.
209

209

00:08:30,130  -->  00:08:31,690
Finally, if you need to disable
210

210

00:08:31,690  -->  00:08:33,280
or enable a network interface,
211

211

00:08:33,280  -->  00:08:36,503
you can use ip link set eth0 down
212

212

00:08:38,930  -->  00:08:40,780
to turn off eth0
213

213

00:08:40,780  -->  00:08:44,440
or ip link set eth0 up
214

214

00:08:44,440  -->  00:08:45,890
to turn it back on.
215

215

00:08:45,890  -->  00:08:47,710
Now, we really only just scratched the surface
216

216

00:08:47,710  -->  00:08:49,370
of what the ip command can do,
217

217

00:08:49,370  -->  00:08:51,630
but if you're working heavily with Linux systems,
218

218

00:08:51,630  -->  00:08:53,390
I recommend you spend a little time learning
219

219

00:08:53,390  -->  00:08:54,820
more about the ip command
220

220

00:08:54,820  -->  00:08:56,880
and all the different functions it has.
221

221

00:08:56,880  -->  00:08:58,670
For this certification exam though,
222

222

00:08:58,670  -->  00:09:00,730
we covered exactly what you need to know
223

223

00:09:00,730  -->  00:09:03,326
to make sure you're successful on test day.
224

224

00:09:03,326  -->  00:09:05,903
(upbeat music)
