-: Assigning IP addresses. 2 2
Now when we have our networks 3 3
and they rely on IP addresses like IPv4, 4 4
how do we tell our devices 5 5
what addresses they're going to have? 6 6
Well, there are really two different methods we can use. 7 7
One is to manually or statically assign them, 8 8
and the other is to dynamically assign them. 9 9
Now, when I use a static assignment, 10 10
this is a really simple process. 11 11
As a technician, 12 12
I manually will type in the IP address for the host, 13 13
its subnet mask, its default gateway 14 14
and its DNS server. 15 15
But this can be time consuming and prone to error. 16 16
For example, let's say I have 20 devices on the network. 17 17
Now I'm going to have to go 18 18
and assign those four pieces of information 19 19
20 different times, once for each device, 20 20
that's 80 places I have to enter information. 21 21
This means there's a lot of chance for human error here, 22 22
because these numbers are very easy to mistype, 23 23
and if you mistype one, 24 24
you're going to be assigning the wrong information 25 25
to the wrong devices. 26 26
Or you might have the same information on multiple devices. 27 27
And this will also cause problems 28 28
or conflicts between two devices. 29 29
So as you start to work on large enterprise networks, 30 30
it becomes very impractical to do static assignment 31 31
of the IP addresses for all your devices. 32 32
Some of our networks in the past that I've run 33 33
have been 500 clients, 1,000 clients, 34 34
5,000 clients, 10,000 clients, 35 35
100,000 clients, or even 1 million client computers 36 36
in a large-scale intranet. 37 37
So for us to assign those all statically 38 38
and keep track of all of those different IP addresses, 39 39
would become a full-time job 40 40
for a large team of people 41 41
located at all over the world 42 42
because that large intranet spans six continents. 43 43
That would be a waste of a lot of time, 44 44
money, labor, and resources. 45 45
So instead we, simplify this process 46 46
by using dynamic allocation of IP addresses. 47 47
This is known as a dynamic assignment. 48 48
By doing this, we have a quicker, 49 49
easier and less confusing method of assigning our IPs 50 50
to all of our network clients when they join the network. 51 51
Now for larger small networks, 52 52
using dynamic IP addressing 53 53
is usually going to be your best option. 54 54
In your home, whether or not you know it, 55 55
you're already probably using dynamic IP addressing. 56 56
When you bought a new smartphone or tablet 57 57
or laptop or desktop, 58 58
you took it out of the box, you powered it on, 59 59
and then you joined your wireless network, 60 60
and you were able to go online and browse the web, right? 61 61
You didn't have to do any kind of crazy configurations. 62 62
Well, in this case, 63 63
you didn't assign your new device an IP address, 64 64
a subnet mask, a default gateway, 65 65
or a DNS server to use. 66 66
Instead, your network's DHCP server 67 67
did all that for you automatically, 68 68
without you even having to ask it to. 69 69
This is because most small office 70 70
and home office network devices like your cable modem, 71 71
fiber modem, or wireless access point 72 72
already have a running DHCP server there for you 73 73
and it's turned on by default. 74 74
You just tell the device what network to join 75 75
and your router will use DHCP 76 76
to hand out a dynamic IP address 77 77
for your network client to be able to utilize. 78 78
So what are those four components 79 79
of a fully configured client? 80 80
Well, I've said it a couple of times, 81 81
and whether you're using static or dynamic assignment, 82 82
you still need to use the same four components. 83 83
This is an IP address, 84 84
a subnet mask, a default gateway, 85 85
which is usually just the IP of your router, 86 86
and a server for either DNS or WINS. 87 87
Now, DNS is the domain name system. 88 88
DNS is going to be used to convert domain names 89 89
used by a website to the IP address of it's server 90 90
so that your computer can connect to it. 91 91
Now we're going to cover DNS more in its own video, 92 92
because there's a lot you need to know about it. 93 93
But for right now, 94 94
just realize the DNS is essentially 95 95
the internet's version of a phone book, 96 96
where we can look up a name 97 97
and get a number to connect directly to. 98 98
Now names to numbers and numbers to names, 99 99
that's what DNS is all about. 100 100
For example, when you went to diontraining.com, 101 101
you're going to be using DNS in the background 102 102
to determine what the IP address is of my server, 103 103
so you can connect to it 104 104
and access our web pages or our videos. 105 105
That is DNS at work. 106 106
Now WINS, on the other hand, 107 107
W-I-N-S, is used within a local area network, 108 108
specifically WINS is used in Windows domains, 109 109
and it is known as the Windows Internet Name Service. 110 110
It's used to enable Windows 111 111
to identify NetBIOS names on a TCP/IP network 112 112
and convert those NetBIOS names to IP addresses. 113 113
Basically, WINS is like DNS, 114 114
but it only works within a Windows domain environment. 115 115
So if I wanted to connect to my mail server 116 116
inside a Windows domain, 117 117
I could type in its IP address, if I knew it, 118 118
or I could simply type in the name of the server, 119 119
something like mailbox 120 120
or whatever I have named it. 121 121
Now, when it comes time to do the dynamic assignment 122 122
of the critical addressing information for each client, 123 123
we can use four different methods to do this. 124 124
This includes BOOTP, DHCP, APIPA, and ZeroConf. 125 125
BOOTP is by far the oldest 126 126
and least used of these four options. 127 127
BOOTP or the Bootstrap Protocol 128 128
was originally introduced in 1985 129 129
for use in disclosed Unix workstations, 130 130
because it could dynamically assign 131 131
the IP address information 132 132
and then allow the workstation 133 133
to load a copy of their boot image over the network. 134 134
Now, BOOTP used a static database of IPs and Mac addresses. 135 135
So essentially whenever a client connected to the network 136 136
to initiate the BOOTP process, 137 137
it would find its Mac address inside its database, 138 138
and then send the proper IP address that matched it 139 139
back to the requesting client as its assignment. 140 140
This wasn't as dynamic as we would like. 141 141
So in 1993, a newer updated protocol known as DHCP 142 142
was introduced to replace BOOTP. 143 143
Now DHCP, or the Dynamic Host Configuration Protocol 144 144
is going to allow the assignment of an IP 145 145
based on an assigned scope or pool of addresses, 146 146
as well as it provides the ability 147 147
for us to configure numerous other options within it. 148 148
Now, since DHCP allows me to configure my scope, 149 149
I can actually tell my DHCP server something like, 150 150
"Hey, I only want you to hand out addresses 151 151
that are from 192.168.1.100 152 152
up through 192.168.1.200." 153 153
And this gives you about 100 clients 154 154
that can now be automatically assigned. 155 155
Every time somebody connects to the network, 156 156
the DHCP is going to send out one of those IPs from that range 157 157
and assign it for a given period of time 158 158
known as a lease to a client. 159 159
Now, each IP can be borrowed for a certain amount of time 160 160
from this pool, and when that lease expires, 161 161
the DHCP server is going to pull back that address. 162 162
Now this doesn't actually cause a problem for us, 163 163
because your computer at any time can say, 164 164
"Hey, I'm still using that address. 165 165
You can't take it." 166 166
And in that case, the DHCP server would say, 167 167
"Oh, okay, you can keep it." 168 168
And reassigns it for another period by renewing its lease. 169 169
It's just like if you get a book from the library. 170 170
Say you were halfway through reading it, 171 171
and it's going to be due tomorrow, 172 172
you can take it back to the library and recheck it out. 173 173
It's the same concept with DHCP and dynamic addresses. 174 174
Now when the lease does expire 175 175
and it's no longer needed by the client, 176 176
it's going to be returned back to the scope or that pool, 177 177
and be ready to be issued to another client. 178 178
Essentially, each client can borrow that IP 179 179
during its assignment 180 180
and then return it whenever it's done with it. 181 181
Now this IP management 182 182
is going to be performed by the DHCP server on our behalf. 183 183
And it's going to use to manage all of these IPs 184 184
that are being assigned and returned over time. 185 185
This is great because we don't have to control it ourselves 186 186
or keep track of it all manually. 187 187
Instead, we have the ability to go into it at any time 188 188
and look at the logs and say, 189 189
"Hey, who was using the IP 192.168.1.132 190 190
on September 9th at 3:00 PM?" 191 191
And then we can figure it out 192 192
using DHCP's IP address management and their logs. 193 193
And so this gives us all the benefits of figuring out 194 194
who did what, 195 195
while still not having to do any of the management 196 196
and oversight of handing out these IP addresses. 197 197
Now, another great thing about DHCP 198 198
is that it gives our clients 199 199
all of these different variables 200 200
that they need to communicate. 201 201
This includes the dynamic IP address that's being assigned 202 202
as well as the subnet mask, 203 203
the default gateway and the DNS server, 204 204
and if you're using a WIN server, 205 205
you can also send that through DHCP. 206 206
This can all be done 207 207
using the DHCP protocol for us automatically, 208 208
each and every time a new client connects to the network. 209 209
Yes, I know I've repeated these four configuration options 210 210
a bunch of times now. 211 211
And you know what that means? 212 212
It means this information is really important. 213 213
So you simply have to know those four configuration items 214 214
that DHCP provides to your clients 215 215
and keep them in mind for test day. 216 216
Remember that the IP address, the subnet mask, 217 217
the gateway, and the DNS server's IP. 218 218
The WIN server is an optional component 219 219
that may or may not be sent. 220 220
All right, we're going to talk a lot more about DHCP 221 221
in a separate video, but for now, 222 222
you need to remember that DHCP 223 223
is the modern implementation of BOOTP, 224 224
and it's commonly used in our modern networks 225 225
to be able to assign automatically the IP address 226 226
and other required data 227 227
for a client to communicate on a network. 228 228
Now, the third way we can do automatic or dynamic addressing 229 229
is by using APIPA, A-P-I-P-A, 230 230
or the Automatic Private Internet Protocol Addressing. 231 231
Basically if for any reason 232 232
DHCP cannot complete the assignment process 233 233
or find an address for you to give to the client 234 234
because you ran out, 235 235
then APIPA is going to be used instead. 236 236
This kind of thing can happen if there's a problem 237 237
where the client can't reach the DHCP server 238 238
because of networking issues or something else like that. 239 239
Now in these cases, 240 240
the client is going to assign itself an APIPA address, 241 241
which is a self assigned address. 242 242
Now by default, on a Windows server or workstation, 243 243
you're going to find that APIPA is selected by default 244 244
under the TCP/IP properties 245 245
under the Alternate Configuration tab. 246 246
Now this allows the Windows machine 247 247
to assign itself an address randomly 248 248
from the 169.254 dot something dot something scope, 249 249
if it can't reach a DHCP server 250 250
or it can't contact it 251 251
and finish the negotiation process. 252 252
Now APIPA is designed 253 253
to allow for a quick configuration of a local area network 254 254
without the need of having a DHCP server. 255 255
For example, if I take 10 clients 256 256
and I connect them all to a switch without a DHCP server, 257 257
these 10 clients will default 258 258
to picking up their own IP address from the APIPA range, 259 259
which is 169.254 dot something dot something. 260 260
Again, because it's a class B address, 261 261
this is perfectly fine, 262 262
because they're all going to be on the same local area network. 263 263
So if I wanted to play Doom on this local area network 264 264
with these 10 machines, that's fine. 265 265
They'll all find each other, 266 266
and they'll talk based on their APIPA addresses 267 267
without any issues at all. 268 268
Now, the only problem that will occur 269 269
is that these are private IP addresses. 270 270
So they can't be routed outside of our local area network. 271 271
Therefore, if we need to communicate locally, 272 272
we can do that using a switch, 273 273
and everything will be fine. 274 274
But we're not going to be able to reach the internet 275 275
because we don't have the same network as the router, 276 276
because the router had a valid IP address, 277 277
not an APIPA address. 278 278
And so we don't have a default gateway 279 279
to get out of this local network we've created. 280 280
Now, this is the biggest challenge you're going to have 281 281
when you have an APIPA address assigned to your clients, 282 282
because they cannot communicate 283 283
outside the local area network 284 284
or with other devices that don't have an IP address as well. 285 285
If you ever have a computer that starts with 169.254 286 286
dot something dot something, 287 287
and you can't figure out 288 288
why it's not connecting to the internet, 289 289
well, that's your reason. 290 290
It's an APIPA address, 291 291
and APIPA addresses can't get out past the router. 292 292
And so APIPA addresses are not going to allow you 293 293
to connect to the internet. 294 294
Our last dynamic method of configuring an IP address 295 295
is known as ZeroConf or Zero Configuration. 296 296
Now ZeroConf is a newer technology 297 297
that was based on APIPA 298 298
and can provide you with a lot of the same features as APIPA 299 299
as well as some new ones. 300 300
For example, ZeroConf can actually assign 301 301
an IPv4 link-local address to a client. 302 302
This is a form of a non writeable IP 303 303
that's used on a local sub-net, just like APIPA, 304 304
but the big difference is that with ZeroConf, 305 305
this client can now have the ability 306 306
to resolve computer names to IP addresses 307 307
without the need of DNS, 308 308
by using something known as mDNS 309 309
or multicast domain name service. 310 310
Also ZeroConf can perform a service discovery on a network, 311 311
so it can find out what things are connected 312 312
and available for use. 313 313
So if there's a printer, a scanner, or show file system, 314 314
you can actually find that using ZeroConf. 315 315
There've been lots of different implementations of ZeroConf 316 316
in recent years, 317 317
and it's called different things 318 318
depending on the implementation 319 319
and the product line you're using. 320 320
For example, on Apple products, 321 321
ZeroConf is actually called Bonjour, 322 322
and it's used mostly for service discovery of other clients 323 323
end devices on the local area network. 324 324
In Microsoft Windows, 325 325
they like to call it LLMNR, 326 326
Link-Local Multicast Name Resolution. 327 327
And it's going to rely on it as an extension of APIPA 328 328
to provide for name resolution and service discovery, 329 329
in addition to providing network conductivity. 330 330
Now if you're using Linux, 331 331
ZeroConf is usually implemented using SystemD 332 332
or the System Daemon Service, 333 333
specifically the systemd-resolved background service. 334 334
So remember, there are lots of different ways 335 335
to assign IP addresses. 336 336
You can do it manually known as a static assignment 337 337
or automatically known as a dynamic assignment. 338 338
If you're using a dynamic assignment, 339 339
you can do this with one of four methods: 340 340
BOOTP, DHCP, APIPA, or ZeroConf. 341 341
Really, it all depends on the needs of your clients 342 342
and your network.