DHCP with a very small pool
dhcp1 at thehobsons.co.uk
Thu Aug 17 14:39:42 UTC 2006
Artzi, Yoav (Yoav) wrote:
>I want to configure a DHCP server to assign a single address to a
>client. My address range includes one address, and I need to connect on
>client to it, however I might want to change the client machine.
>However, there will never be two clients connected at the same time. So
>what I want is that the server will try to give an IP, see that the
>range is all distributed and then will take an existing lease and try to
>see (by ping) if the client is still on the network, and if not will
>void the lease and give that IP.
>Is it possible?
It depends !
The standard, rfc compliant, operation of the server is that once it
has given out a lease it CANNOT re-use that address until either the
lease expires OR the client explicitly releases it. The fact that a
client does not respond to a ping doesn't mean that the lease is no
longer in use, the client is legally allowed to re-appear and
continue using that lease until it expires - and note that many
systems now have built in firewalls that block pings.
I can see three ways to achieve what you want :
1) Hack the server code to change it's behaviour.
2) Use a short lease time so that when the old client goes away, the
address will be free in, at most, the max lease time. The danger here
is that with very short lease times, you risk clients losing their
address quickly if the server goes down, or an odd packet gets lost.
3) Whenever you need to change the client, you manually remove the
lease or change it's state to expired. I believe this may be
accomplished via omshell rather than having to stop the server and
edit the leases file.
More information about the dhcp-users