Question on the dhcp-server configuration for a fixed IP address.

Hi ,

when i configure my server with a fixed ip address in dhcpd.conf as below

subnet 172.21.151.0 netmask 255.255.255.0 {
  range 172.21.151.66 172.21.151.66;

}
host switch {
  hardware ethernet 00:05:30:02:DB:31;
   fixed-address 172.21.151.66;
}

when i start dhcpd server , it is assigning the ip address to some other node in the network.
is it a expected behavior ?
if so , some on please tell me how to assign fixed ip address to a client from dhcp server such that it wont assign to other clients the same ip address.
i very much need it .

Thanks
Gopi Krishna P

DHCP is sometimes frustratingly intelligent about assigning addresses. If said switch already has a lease -- or someone else already has a lease on that same address, or even if some random machine is misconfigured to use it -- that might take precedence over anything statically assigned. I think this is because there's no proactive way for a DHCP server to tell a client to go away and be something else. You might have to delete some leases and power cycle things.

You are assigning a static ip that is in your dynamic range of ip's.
This is why another machine is getting this ip. The range option is for the dynmaic ip pool that can be randomly assinged to machines that don't have static rules. If you change the fixed-address option to something outside this range it should work fine. Also you have only one ip in your range option so only one machine can get a dynamic ip.