Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to set up a DHCP server that gives out semi-static leases. Allow me to explain.

I want the server to give out static leases (I think these are also referred to as "sticky" leases) to users, but if a user has been inactive for a long period of time and I've run out of addresses, I want the server to abandon the oldest lease.

Does this even need to be set up on the server side? Most of my clients connect with home routers. Do most home routers ask for their previous address via DHCP in the manner similar to my Windows machine? Alternatively, is this something that needs to be scripted? If I set a really long lease expiry time, will the server automatically check for inactive users when the DHCP pool is full?

I appreciate any suggestions you may have.

share|improve this question

closed as not a real question by Chris S Jul 31 '12 at 18:58

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
This question is a bit off topic for ServerFault. DHCP is a pretty basic task for any professional admin. Just be aware that this question may be closed due to not enough background knowledge. –  Brent Pabst Jul 31 '12 at 18:45
    
This really isn't how DHCP works and I can't imagine a good reason for trying to force it to work this way. Perhaps reword the question to explain the actual problem your facing and the details surrounding it. Once you've done that please flag the question to be reopened. Thank you! –  Chris S Jul 31 '12 at 18:58
    
Understood. I will rephrase the question. –  Seanny123 Jul 31 '12 at 19:32
    
Well, it looks like I really herped when I derped. There's no way to salvage this question since it's a combination of a series of misconceptions and lacks details that a simple edit won't fix. I apologize for wasting everyone's time and will try to create questions with more consideration in the future. –  Seanny123 Aug 2 '12 at 15:03

3 Answers 3

Seanny,

I don't think you understand how DHCP works. This question may get closed as being off topic but here are the basics...

When a client connects to the network and is configured to use DHCP it sends a broadcast message requesting an address. Any DHCP server on the network will respond (after some handshaking) with an address the client can use. The address includes an expiration time (which is configured by the server). Typically leases are valid for a period of time, many times 24 hours. After that time the lease expires and the address returns to the pool to be used by the next client.

So if you simply want to expire the leases more often you can configure the server to expire them in less time, say maybe every 4 hours or so. You have to be careful not to make it too low otherwise you can clog up your network with tons of DHCP requests.

If you are running into problems with having enough addresses to provide you may want to use a different IP range, which would in turn give you more IP addresses and leases to use. Most home routers are configured with a subnet of 255.255.255.0 which gives you 254 potential addresses. If you use a subnet of 255.255.0.0 you gain a whole bunch more addresses.

share|improve this answer

Most of my clients connect with home routers. Do most home routers ask for their previous address via DHCP in the manner similar to my Windows machine?

What are "your clients"? Are you an ISP - you should KNOW. A VPN provider - bad news: noone cares about the routers.

bbut if a user has been inactive for a long period of time

define "long time".

and I've run out of addresses, I want the server to abandon the oldest lease.

THAT is unusual and thus does not exist, the rest is standard DHCP setup.

share|improve this answer

Regarding the first part of your question just setup a short lease - say an hour or less, unless you have hundreds of thousands of requests per minute any DHCP server will do just fine with the extra load lowering the least to this level will add.

The second part of your question is more complex as you've not painted a clear-enough picture here. So you have a bunch of clients who somehow connect to your network for whatever reason right? If so how do they connect in, via a VPN concentrator or similar? if so then it's that concentrator that manages the IP allocation and it will release an IP if the VPN is disconnected. If you're worried about clients just sat there 'eating up' an IP/VPN-connection then again just change their 'lease' (not the right term) by setting an inactivity timeout on the concentrator.

If I've misunderstood this second part of your question you're going to have to clarify it please. Oh and the 'elephant in the room' here is "why are you running out of IP addresses?" you shouldn't need to.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.