Managing Hosts on a Network with DHCP

๐Ÿ”Œ Managing hosts on a network can be a daunting and time-consuming task. Every single computer on a modern TCP/IP-based network needs to have at least four things specifically configured:

  1. IP address ๐ŸŒ: The unique identifier for each device on the network.

  2. Subnet mask ๐ŸŽญ: Defines the range of IP addresses that belong to a specific network.

  3. Primary gateway ๐Ÿšช: The network device that serves as an access point to other networks.

  4. Name server ๐Ÿ“š: The server responsible for translating domain names into IP addresses (DNS).

On their own, these four things don't seem like much, but when you have to configure them on hundreds of machines, it becomes super tedious. Out of these four things, three are likely the same on just about every node on the network: the subnet mask, the primary gateway, and DNS server. However, the last item, an IP address, needs to be different on every single node on the network. That could require a lot of tricky configuration work, and this is where DHCP or Dynamic Host Configuration Protocol comes into play.

๐Ÿ’ก Listen up, because DHCP is critical to know as an IT support specialist when it comes to troubleshooting networks. DHCP is an application layer protocol that automates the configuration process of hosts on a network. With DHCP, a machine can query a DHCP server when the computer connects to the network and receive all the networking configuration in one go. Not only does DHCP reduce the administrative overhead of having to configure lots of network devices on a single network, but it also helps address the problem of having to choose what IP to assign to what machine.

๐Ÿ–ฅ๏ธ Every computer on a network requires an IP for communications, but very few of them require an IP that would be commonly known. For servers or network equipment on your network, like your gateway router, a static and known IP address is pretty important. For example, the devices on a network need to know the IP of their gateway at all times. If the local DNS server was malfunctioning, network administrators would still need a way to connect to some of these devices through their IP. Without an assigned IP configured for a DNS server, it would be hard to connect to it to diagnose any problems if it was malfunctioning. However, for a bunch of client devices like desktops, laptops, or even mobile phones, it's really only important that they have an IP on the right network. It's much less important exactly which IP that is.

๐Ÿ”ง Using DHCP, you can configure a range of IP addresses that's set aside for these client devices. This ensures that any of these devices can obtain an IP address when they need one. It solves the problem of having to maintain a list of every node on the network and its corresponding IP. There are a few standard ways that DHCP can operate:

  1. Dynamic allocation: This is the most common method, where a range of IP addresses is set aside for client devices. One of these IPs is issued to these devices when they request one. Under dynamic allocation, the IP of a computer could be different almost every time it connects to the network.

  2. Automatic allocation: This method is very similar to dynamic allocation in that a range of IP addresses is set aside for assignment purposes. The main difference here is that the DHCP server keeps track of which IPs it has assigned to certain devices in the past. Using this information, the DHCP server will assign the same IP to the same machine each time if possible.

  3. Fixed allocation: This method requires a manually specified list of MAC addresses and their corresponding IPs. When a computer requests an IP, the DHCP server looks for its MAC address in a table and assigns the IP that corresponds to that MAC address. If the MAC address isn't found, the DHCP server might fall back to automatic or dynamic allocation, or it might refuse to assign an IP altogether. This can be used as a security measure to ensure that only devices that have had their MAC address specifically configured at the DHCP server will ever be able to obtain an IP and communicate on the network.

โฐ It's worth calling out that DHCP discovery can be used to configure lots of things beyond what we've touched on here. Along with things like IP address and primary gateway, you can also use DHCP to assign things like NTP servers. NTP stands for Network Time Protocol and is used to keep all computers on a network synchronized in time.

Last updated