- DHCP automates the process of assigning IP addresses to devices connecting to a network, making it easier to connect multiple devices.
- DHCP allows you to control the range of IP addresses available for use, ensuring you can limit the number of devices connected to your network.
- While DHCP assigns IP addresses temporarily, static IP addresses are necessary for certain devices (e.g. servers) to maintain consistent connectivity and configuration.
The Dynamic Host Configuration Protocol (DHCP) is integral to networks and controls what IP addresses devices receive so they can communicate with the internet. Usually, IP assignment is automated, but if you need static IPs, familiarity with DHCP is essential.
DHCP Can Handle IP Assignments
Every device that connects to a network needs an IP address. In the early days of networking, users manually assigned themselves an IP address, but that’s a cumbersome task, especially for places with many devices, such as a corporate office. DHCP, in part, automates this process, which makes connecting devices to the network far easier. DHCP servers or routers handle this process based on a set of defined rules. Most routers are set to use a 192.168.0.x range, for instance, so you’ll commonly see IP addresses like this in home networks.
The process is pretty straight forward. When a client (a computer, IOT device, tablet, cell phone, etc.) connects to the network, it sends out a signal (called DHCPDISCOVER) to the DHCP server (or router). The server responds with all the rules and settings for the network and an IP address for use (a DHCPOFFER). The client acknowledges the information and asks permission to use the assigned address (a DHCPREQUEST message). Finally, the DHCP server acknowledges the request, and the client is free to connect to the network.
DHCP Controls the Range of IP Addresses
You can configure DHCP to control the range of IP addresses available for use. If you state that range as starting at 192.168.0.1 and the end as 192.168.0.100, then all available addresses will fall somewhere within that range. You’ll never see a device assigned to 192.168.0.101. Also, bear in mind that the start IP (192.168.0.1 in this example) is reserved for the router. Some routers only list a starting address and then include an option for a maximum number of users (which determines the end address).
The upside to this is you can control how many devices connect to your network simultaneously (no more than 100 in this example). But the downside is if you set the range too small you can unintentionally prevent connection of new devices. To allow for a lower range of IP addresses, DHCP servers only lease out IP addresses to devices.
Dynamically Assigned Addresses are Temporary
When a DHCP server assigns an IP Address, it does so under a lease system. The machine retains this IP address for a set number of days, after which it can try to renew the IP address. If no renewal signal is sent (such as a decommissioned machine), then the DHCP server reclaims the IP address to assign to another device. When the renewal signal is detected, the device retains its IP address for another set of days. This is why your IP address may appear to change from time to time if you use the ipconfig option often.
It’s possible for two devices to end up with the same IP, such as a virtual machine (VM) that spends most of its time offline. The VM won’t be able to send the renew signal, so its IP address will be handed out to another machine. When the VM is brought back up, it still has a record of the old IP address (especially if restored from a snapshot), but it won’t be able to use that IP address since it is taken. Without that permission, it can’t connect to the network until a new IP is assigned. But using dynamic IP addresses should prevent this type of scenario.
Static IP Addresses are Necessary For Some Devices
If you have a network connected printer or media server (such as a NAS unit Plex Server, or game server), it would be inconvenient for them to have their IP addresses changed. Sometimes hosted services require special configuration to function correctly. For example, a Minecraft server requires that port 25565 is forwarded, and you may have software pointing to your NAS’s local IP. If the local IP of the device changes, then any rules (like port forwards) applied to it won’t work anymore.
While renewal of the lease can prevent this, it’s still possible for the IP address to change. If your router is restarted, due to a power outage or because you’re trying to solve a pesky problem, then all Dynamically generated IP addresses may be reassigned. For those scenarios, manually assigning a Static IP address will solve the problem.
The exact process for this varies, especially as router web interfaces can change from device to device even when made by the same manufacturer. On some routers, like the Eero Mesh Router kit, this may be referred to by another term, such as IP reservation. But a static IP address still needs to conform to any range rules, if they exist. Using a current IP address as the basis for a static IP is usually the easiest thing to do. Depending on the device and its Operating System, it may be possible to set a static IP at the device end instead of through the router or DHCP server. This may be necessary if the router itself doesn’t support Static IP.