-   Linux - Networking (
-   -   Fixed IP being taken - DHCP Server - CentOS 6 (

hknoener 04-05-2012 01:24 AM

Fixed IP being taken - DHCP Server - CentOS 6

I'm facing a problem with my DHCP server. I have a linux box using CentOS 6. My DHCP server is up and running.

I've needed to format my server and reconfigure my DHCP and everything else. After that all the computer on my Network needed to have their IP back and they took all sorts of IP addresses that they where not supposed to take. I even assigned 15 minutes as lease time to solve this problem at the beginning. It actually worked to put some order on my IP leases, but the problem persists.

For instance, the IP (a real example, in this case) is stated to be given to a certain MAC address and there's another computer using this IP at the moment. My IP range goes from up to .170. The fixed IPs are in the range of 2-15 and 120-170. All the rest is free to be taken but even though sometimes random computers just take fixed IPs and take them.

My Squid rules are based on IP range so it causes me all sorts of problems cause some users have rules applied that are note supposed to be apply to them.

Never had a IP conflict, but it looks-like that when the assigned computer is offline, any other computer that renews the IP can, by chance take that IP. I don't think it's supposed to be that way. Just because the MAC address is not online doesn't mean that my server should give this IP to any other computer, specially if I have a big IP Range that is empty and can be used for this purpose.

Is there anything that I'm missing?

Here is part of my dhcpd.conf, up to 5-6 fixed address. All the rest is basically the same.


# DHCP Server Configuration file.
#  see /usr/share/doc/dhcp*/dhcpd.conf.sample
#  see 'man 5 dhcpd.conf'

ddns-update-style interim;
#ignore client-updates

subnet netmask {
default-lease-time 900;
max-lease-time 900;
  option routers;
  option broadcast-address;
  option subnet-mask;
#  option ntp-servers;
  option domain-name-servers;
#  option domain-name "";
#  option domain-name-servers,;
  option netbios-name-servers;

  hardware ethernet 00:25:64:be:3f:48;
  hardware ethernet 00:25:64:c2:c4:d7;
host NOTE2 {
  hardware ethernet e0:cb:4e:37:2b:92;
  hardware ethernet 44:87:fc:95:de:3f;
  hardware ethernet 00:26:2d:2e:19:c1;
  hardware ethernet 44:87:fc:94:80:8c;

acid_kewpie 04-05-2012 03:02 AM

just keep the fixed range outside of the dynamic range - make your "range" value start at or similar.

hknoener 04-05-2012 03:14 AM

Acid, pretty clever. I haven't thought about it.

If my fixed-IP-machines are out of range, is that a problem? I can make my range goes from .20 till .119, then all my fixed range is protected, the lower part and the higher part. Is that ok?

Didn't know that I could have computers out of my DHCP range. Is there any major consequence applying this new configuration?

acid_kewpie 04-05-2012 03:18 AM

it's not a problem, no. They just need to have a suitable subnet declaration to match with to pick up the other details like routers and masks.

hknoener 04-05-2012 03:30 AM

Acid, where do I place that info? I just have IP there, no subnet.


  hardware ethernet 44:87:fc:95:de:3f;

acid_kewpie 04-05-2012 03:49 AM


When dhcpd tries to find a host declaration for a client, it first
looks for a host declaration which has a fixed-address declaration that
lists an IP address that is valid for the subnet or shared network on
which the client is booting. If it doesn't find any such entry, it
tries to find an entry which has no fixed-address declaration.
So from this it should be fine where it currently is, this suggests that there's no syntactical scoping required in the config, it'll all be parsed and made sense of without further relation between the fixed-address and the subnet definitions.

hknoener 04-05-2012 05:23 AM

Ok, I'll try to make the changes that you've proposed and will run some tests. Accordingly to this explanation, I think what I need to modify is pretty basic.

Thanks for your help. I'll come back with some feedback.

hknoener 04-06-2012 04:57 AM

Acid, it worked like a charm. Thank you very much. Just changed the range and that was it.

All times are GMT -5. The time now is 12:23 PM.