[Cialug] DHCP Server: how can a client get the same IP after restart?

David Champion dave at visionary.com
Mon Aug 1 18:37:47 CDT 2005


Nathan C. Smith wrote:
> 
> Recently I switched to using the Linux DHCP server on redhat 9 distribution
> instead of my firewall.  I really like being able to specify IP addresses by
> MAC address.  However, It seems with other DHCP implementations the server
> would reserve the address even when the machine was off any the machine
> could get the address again when it started up.
> 
> Is this a client option, or do I just need to lengthen my DHCP leases or set
> some other option?
> 
> These are my lease settings:
>         default-lease-time            21600;
>         max-lease-time                21600;
> 
> I believe that makes it 6 hours.  But I have machines that get a new address
> each time they boot and it is a little annoying.  Does the client have to be
> able to request the old lease again somehow?
> 
> For convenience sake I would just like to reboot a machine and have it get
> the same dynamically assigned address until I can assign a permanent or
> static one.

The way most DHCP clients work is they will request the previously 
assigned IP from the server. If you watch a Windows client trying to get 
it's old IP back when it's already been dished out, it retries several 
times (like 4 times, IIRC).

The DHCP server I'm using (the one that ships with Mandriva) is this one...

http://www.isc.org/dhcp.html

Here's a sample generic config...

ddns-update-style ad-hoc;

subnet 192.168.0.0 netmask 255.255.255.0 {
         authoritative;
         max-lease-time 7200;
         default-lease-time 7200;
         range 192.168.0.64 192.168.0.254;
         option domain-name "<your domain>";
         option subnet-mask 255.255.255.0;
         option routers 192.168.0.1;
         option domain-name-servers 192.168.0.53, 192.168.0.1;
}



More information about the Cialug mailing list