Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1149
  • Last Modified:

DHCP lease and expiry

Hi

In regards to DHCP leases, can anyone tell me what happens when the lease expires but the client is still connected to the network? And what about when the client disconnects?

Basically, I have a wireless network with 30 IP addresses that are given out via DHCP. At the moment, the DHCP lease period is set to 24 hours. Since this is wireless, there are people joining and disconnecting all the time, unlike a wired environment with client PC's where they tend to remain.

If Laptop1 comes along and grabs an IP address at 13:00, then disconnects at 14:00, does this mean that IP is 'reserved' until 13:00 the next day?

Likewise, if we changed the lease time to 30 mins, will Laptop1 have to request a new IP at 13:30, or does it automatically keep the existing one although the lease time has expired, due to the fact that it is still connected?
0
kam_uk
Asked:
kam_uk
3 Solutions
 
BidonetCommented:
IP address will be reserved for 24 hours so if the same client comes back within 24 hours, he will get the same IP address.  Otherwise, if the lease espires after 30 minutes, if the client is still connected it will renew the address automatically as long as he's still connected.  When disconnnected for more than 30 minutes the IP address will be released and available for anyone who connects to get it, even the client who released it.
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
When a client requests a lease, the server gives it one for the term of the lease.  That lease cannot be given out again until the lease expires.  The CLIENT renews the lease at half time.  So if you have a 24 hour lease given by your server, the client will renew it after 12 hours holding on to it for another 24 from that point (and 12 hours after it renews it, it tries to renew it again).

When the client is disconnected from a network, the lease is lost, but when it reconnects to the network, the DHCP server, if it has record of the client's MAC address having a particular address, will hand it back the same address - otherwise, it would likely receive a new address.

If you're running out of leases because machines come and go, you should probably go with a shorter lease time.  Probably 8 hours... maybe less depending on how long clients typically remain on the network.  DHCP broadcasts are not generally a problem so you COULD go much shorter.
0
 
Den_HBRCommented:

Clients begin to attempt to renew their leases once half the lease interval has expired.
source: http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol#Reliability

So, if the client stays connected he will renew his lease before it expires.
He will keep the same IP, as long as he stays connected.


If the client disconnects, the ip will return to the pool when the lease time expires.

0
 
kam_ukAuthor Commented:
Thanks...

So with the 24 hour lease and a large number of devices constantly trying to join, we won't see problems with existing clients losing their Wi-Fi connection (since they will renew the lease at half time), but we could see problems with new clients trying to connect (because there are no spare IP's in the DHCP scope)?

0
 
BidonetCommented:
If you plan to get more than 30 clients within a 24 hours period, you should reduce your release period otherwise all 30 IP addresses will be reserved.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now