From the course: CompTIA Network+ (N10-009) Cert Prep
Dynamic and static IP addresses
From the course: CompTIA Network+ (N10-009) Cert Prep
Dynamic and static IP addresses
- Every computer on your IP network has got to have IP address settings. In particular, it needs to have an IP address. It has to have a subnet mask, and it has to have a default gateway. Now this information has to be put in there somehow. So you've got two choices. The old fashioned way is statically. You literally go up to the machine, you find the right configuration screen, and you type all this information in. There's nothing wrong with that, and a lot of times that's the best way to do it. However, the alternative is to let it happen automatically. Now, there are two terms. One of them is DHCP or Dynamic Host Configuration Protocol, and the Linux people tend to use the term BOOTP. So either one of these terms are pretty much interchangeable, and what it means is that when your computer first boots up in the morning, it doesn't have any IP information at all. What it needs is something called a DHCP server. Let me show you what I mean. So here's my happy little network here. So I've got, this is my computer right here, and it's turned off right now. Now I've got a router and I've got a block. You haven't seen this in previous episodes, but this is going to be like Windows server or something like that. Now you'll notice that they're all on one broadcast domain. They're all hugging off the same switch. So if one person broadcasts, everyone else can hear it. DHCP manifests most times as a server. Now this DHCP server can be special software sitting on certain computers, but most home routers also have DHCP server capability. Your individual computers need to be DHCP clients. Now, assuming that the DHCP servers are running, this is pretty much what takes place. When you could first boot this computer up, he will begin sending out a broadcast called a DHCP Discover. And now at this point, your computer doesn't have an IP address or any IP settings at all. So it just sends out a broadcast on the MAC address of all Fs to all these computers, and it's looking for a DHCP server. Now I'm going to say that I've got DHCP server software running on, this is a Windows server system. So DHCP servers are designed to respond to these broadcasts, and what it'll do is send unicast traffic back. Keep in mind this is a broadcast, but when this guy gets it, he knows this guy's MAC address. So what he's going to do is send a unicast traffic straight back to him with what's known as a DHCP offer. So we start off with a DHCP Discover, which is a broadcast, and then a DHCP offer, which is a unicast right back to it. This has all the information in it, this is, here's an offer, this is the IP address I want to give you. Here's the subnet mask, here's the default gateway. There's even other stuff. But for right now, we'll stick with the basics. Now, when your computer hears that, what he's then going to do is going to go, okay, I'll take that. And he'll send what's known as a DHCP request back to the DHCP server. When he does this, he's basically telling the DHCP server, yep, I'm going to take this information that you're giving me and I'm going to use it. Once the DHCP server hears that, he sends a DHCP acknowledgement, which says, okay, we're going to do it. And once this takes place, the DHCP server will store all of this information in there and he'll keep a track of all of the different clients that are out there that are using DHCP. So the important thing to appreciate about DHCP is that you've got to have a DHCP server. Anybody who's got a home router, almost all those have DHCP servers built in. And we also have DHCP servers that run with just about every different operating system too. So the trick is, number one, if you're going to be using DHCP, only have one DHCP server. Remember, DHCP servers are designed to respond to broadcasts. So if you have two running and they're passing out different information, that would be what we call a bad thing. Secondly, the other thing you need to appreciate is that DHCP servers have to be within the broadcast domain. You can't have a DHCP server outside of your network that your network responds to. So the DHCP server has to be part of your own little network. - Great job, Mike. But let me cover a couple of new topics. Now that we've covered how DHCP works, here are some other DHCP related terms you might see on your Network+ exam. DHCP reservation isn't like booking a table at a restaurant. It's more like calling dibs on an IP address. A reservation links a MAC address to a specific IP address, ensuring a device always gets the same IP without having to manually hard code it. DHCP servers have several settings to make interaction smooth. Address scope, which is going to be the range of IP addresses. Lease times, how long an IP address is reserved for a node, and configuration options, additional settings like default gateway and even DNS servers. DHCP relay is going to be when a forwarding DHCP request needs to cross network boundaries. And then there can even be DHCP address exclusions as well as stateless address auto configuration, otherwise known as SLAAC, S-L-A-A-C. The address scope defines the range of IPs available to clients. Lease time similar to TTL and routing reserves an IP for a set period typically automatically renewing. Now, optional settings can include default gateways, DNS addresses and even subnet masks. For networks where clients are on a different physical network than the DHCP server, a DHCP relay agent can forward DHCP broadcasts to the appropriate network segment. Other protocols like TACACS, DNS, TFTP, and even NetBIOS also use UDP broadcasts. An IP helper address is a configuration that helps overcome the separation of clients and servers in different broadcast domains. Address exclusions reserve certain IPs that aren't assigned dynamically. On IPv6 networks, there are two modes. Stateless SLAAC and stateful DHCPv6. SLAAC is simple, letting devices auto generate their own IPv6 addresses using the EUI-64 method, adding FF:FE in the middle of the MAC address halves. DHCPv6 operates similarly to IPv4 DHCP, assigning IPv6 addresses from a scope with lease times requiring more configuration than SLAAC.