Previously, we looked at a common situation in which a PC loses a connection to a printer because the printer’s DHCP-assigned IP addresses periodically changes. DHCP-induced address changes can be problematic any time you want a computer or other networked device to have a predictable IP address, such as when you want remote access to a PC or NAS device.
The customary way to keep a device consistent in its IP address usage is to assign it a static address. However, if your DHCP server (which is probably in your router) supports one of two features — configurable lease times or reservations — you’ll be able to use DHCP while reducing the frequency of address changes or eliminating them altogether. If your router supports either feature, you’ll find the settings under DHCP, LAN or a similar-worded heading.
First, some background. When a network device requests an IP address and a DHCP server responds with one, it’s called an address lease. Like a lease on a car or apartment, a DHCP IP address lease has a fixed duration, and before it expires the lease must be renewed. On a typical home or small office router a DHCP lease may last between eight and 24 hours. Each time the lease is renewed (which happens automatically), there’s a chance the device will receive a different IP address.
Extend Your Lease
One way to keep DHCP-issued addresses more consistent is to lengthen the lease times for more staying power. Many routers let you specify a lease time as long as 9,999 minutes, which works out to a tick under a week (166.65 hours, to be exact). Some offer only a handful of pre-defined lease lengths, but these usually include a few relatively long-term options like a week, two weeks or a maybe even month. Others go so far as to offer an “unlimited” or “forever” option. (On routers that define DHCP leases in minutes, setting it for 0 minutes is often a stand-in for a long-term or unlimited lease; check your device’s documentation or online help to be sure.)
In short, by selecting the longest DHCP lease time possible, you can reduce the odds of a device having its IP address changed. A lease that never expires is ideal, but even extending the lease time from a day to a week reduces the number of potential address changes from 365 to 52.
Make a Reservation
DHCP address reservations offer an even better way of making an ostensibly temporary IP address permanent because they let you set aside a particular IP address for a particular device, which essentially amounts to a lease that both exclusive and permanent. A reserved address remains under DHCP’s control, but it will only be assigned to the specified device.
To set up a DHCP address reservation for a device, you’ll not only need to pick an IP address to reserve, you’ll also need the MAC address of the device you want to have the reserved address. (This is the unique 12-character address that’s hard-coded into every network device when it’s manufactured.) You can usually find a device’s MAC address printed on a sticker on the back or bottom of the device. On a PC, typing ipconfig /all from a command prompt will show the MAC address, though it will be called the “physical address.”
Some routers may be able to save you the trouble of having to find or type in a MAC address — if the device for which you want to create an address reservation is already connected to the network, it will often let you select it from a list of attached devices.
Static Addresses
Most routers should support either adjustable DHCP lease times or reservations. If yours supports neither, then your only remaining option is to configure certain devices with a static IP address. When doing this, verify that any static IP address you plan to use isn’t one available for DHCP to assign because on many routers DHCP’s preconfigured “pool” of assignable addresses includes all 253 available on the network. In other words, all addresses in the range from xxx.xxx.xxx.2 to xxx.xxx.xxx.254 (1 is used by the router) will be allotted to DHCP.
Finally, to avoid potential conflicts, you should reduce the size of DHCP’s address pool to free up some addresses to assign manually. Virtually all routers will allow you to limit which addresses can be used by DHCP, but you can usually also get away with simply using high-numbered addresses from the DHCP static addresses. Since DHCP assigns addresses in numerical order, it will not issue, for example, address number 200 unless it’s already assigned the 198 addresses before it.