I have generally seen that DHCP lease times are quite long (a day plus) on most defaults. I have a client that seems to have the following problem. They have a DHCP server in a router that is near-saturation (say in a normal work day 80-85% of the potential IPs are used). Occasionally they restart their router. When that happens it seems that the the router loses its table of assigned IPs, so it assigns IPs anew (of course).
The problem is that quite often there is a client on the LAN which has the IP already and is going to hold it for a day (the current timeout length), causing an IP conflict and connectivity issues for those two machines.
The obvious solution is to make a very short lease time, but since I’m only a hobbyist when it comes to networking, there may be more to DHCP that I don’t understand.
Is the above a reasonable evaluation of the situation (at least with lower-end equipment) and does a lower lease time (say a half-hour) make sense in this case?
asked Mar 25 ’11 at 13:52
You should consider replacing the DHCP server, as it is obviously broken. DHCP servers should keep lease information between restarts and preferably also probe addresses before releasing them into the pool to avoid address duplication.
If that is not an option you can drop the lease length. As long as the DHCP server can handle the churn it should work, but short leases will cause a small increase the amount of broadcast traffic on your network.
Short leases are primarily a problem when you have clients disconnecting and reconnecting a lot, for example in WiFi networks. Very short leases (less than 1 minute) can cause weird problems with some DHCP clients that have time-outs longer than the lease.
answered Mar 25 ’11 at 14:06
Fix the real problem. DHCP servers should remember leases between restarts and should ping test IPs before handing them out (to make reasonably sure they aren’t already in use).
Windows Server comes with a DHCP server. Any *nix platform can run ISC DHCPd. Both are pretty good choices and will easily accomplish the above requirements.
We have DHCP leases set to 8 days for IPv4, and 2 weeks for IPv6. Whatever you set, remember clients will renew after 1/2 the time, so if you set it to 8 hours, it’ll renew every 4 hours (continuing with double declining time upon failed requests).
answered Mar 25 ’11 at 14:09
Your routers DHCP server implementation may be able to do “DHCP collision detect”. Check this out and enable it if possible. This is the easiest fix.
Shorter lease-times will definitely help but are not a 100% guarantee. I would not go below 1 hour though. In my experience many network-programs don’t really like it the computer re-acquires DHCP while the program is running (e.g. Outlook2003 is notorious for this, 2007 seems better behaved). Doing it every 5 minutes may be quite noticable to the users.
If the DHCP scope is large enough for all computers on-site and the majority of those computers is fixed on-site it may be feasible to assign the regular systems a fixed ip-address through DHCP reservation, leaving only a very small pool of dynamically assigned addresses for guests and/or laptops that are infrequent in the office. The reserved addresses will not be subject to collisions. Of course: Someone has to maintain that reservation list.
If you have another DHCP server (Windows/Linux or another router) on your WAN that is able to do collision detect you may consider adding this LAN as an additional DHCP scope there and reconfigure the site-router to forward DHCP to this one.
If all else fails you will have to setup a separate DHCP server. For up to about 200 users you don’t really need a big Windows server or a Linux box. You can get away with something like TFTPD32 which is free, easy to setup and will do collision detect as well. (And it will run on a desktop OS if costs are an issue. If you happen to have a PC lying around that can be left “always on”). (And, see previous paragraph, this can be located on another site.)
answered Mar 25 ’11 at 16:02
A lease time of 30 minutes will be fine for a few hundred of clients. If you have under 100 clients you can use 5 or 10 minutes.
answered Mar 25 ’11 at 13:58
The only real issue I would consider is server load. Since DHCP is a relatively light service compared to current processor/network power, that consideration is becoming much less important.
This is of course all relative to the size of your network. A class C full of clients is one thing, 5 class As is a completely different beast.
Try setting it to the 30 minutes you mentioned, and see how your router reacts as far as processor load.
answered Mar 25 ’11 at 13:59
Server is down. It seems that the URL is abandoned. koppor Sep 12 ’15 at 21:06
Wouldn’t a better solution be to fix the problem with the DHCP server or replace it?
answered Mar 25 ’11 at 14:08
I have had several cases where users are not the same for more than half a day, i.e. restaurants guest houses and hotels, if they have lease over few hours or an day one needs enormous ip pool in order not to run out and have clients with ip assignment that are long gone. But for regular network where there are the same devices an users all the time 3 days is fine.
answered Sep 7 ’15 at 16:45
I agree on Stefan, the correct lease time depends on a few parameters. How many users, how long the clients stay generally connected, what class network you have, how powerfull is your router. In my case many people walk in and out the clubhouse. At the most busiest times I see 100 simultanious connections. Every day I’m guessing that 700-1000 people will visit.
Our ISP provided a cheap home-use router that doesn’t support a good DHCP server with shorter lease times 1 day so that whould mean a large DHCP pool with in turn the router can’t handle. The lease table would be too large to maintain next to the other functions the router has so the DORA functions fail and clients will asign themselves an APIPA address. Since the netwerk doesn’t contain a server of any kind I bought a cheap router (tp-link WR841n) that supports a good DHCP server with options to give clients, routing / DNS specification and shorter lease times.
I only enabled this router to act as dedicated DHCP server and gave clients a 30 minutes lease time. After the 30 minutes, the DHCP server will contact the client if it’s still there, if not it will release the IP-address if still present it will reassign 30 minutes to the client lease. Client will keep the same IP-address. DHCP range is set within the Private Address Range with 254 simultanious leases max. (bases on the total max. connections of the AP’s). This works great for my case.
Restarting a DHCP server, flushing it’s table is not a good idea unless you make sure to disconnect all the clients from your network first (disable WiFi AP’s). Give it a minute at least to make sure all clients are disconnected. Then start up the network in the following order and wait until fully started and connected: router, DHCP server, Wifi Access Points.
answered Mar 13 ’16 at 11:18
5 to 10 minute leases are idiotic and bodes no knowledge of RFC 2131. In fact anything other then 3 days especially on wireless networks is just plainly not a good idea. Sounds like router / dhcp fix the root problem don’t compound it.
answered May 27 ’15 at 4:18
2017 Stack Exchange, Inc