LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Fixed IP being taken - DHCP Server - CentOS 6 (http://www.linuxquestions.org/questions/linux-networking-3/fixed-ip-being-taken-dhcp-server-centos-6-a-938203/)

hknoener 04-05-2012 12:24 AM

Fixed IP being taken - DHCP Server - CentOS 6
 
Hi.

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 192.168.1.138 (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 192.168.1.2 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.

Code:


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

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

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.1 192.168.1.170;
default-lease-time 900;
max-lease-time 900;
  option routers 192.168.1.1;
  option broadcast-address 192.168.1.255;
  option subnet-mask 255.255.255.0;
#  option ntp-servers 192.168.1.1;
  option domain-name-servers 192.168.1.2;
#  option domain-name "sda.sdasystem.com";
#  option domain-name-servers 117.103.88.33,71.163.249.97;
  option netbios-name-servers 192.168.1.2;

host HSLABTEACHER01 {
  hardware ethernet 00:25:64:be:3f:48;
  fixed-address 192.168.1.3;
  }
host ESLABTEACHER01 {
  hardware ethernet 00:25:64:c2:c4:d7;
  fixed-address 192.168.1.5;
  }
host NOTE2 {
  hardware ethernet e0:cb:4e:37:2b:92;
  fixed-address 192.168.1.4;
  }
host ACCOUNTANT {
  hardware ethernet 44:87:fc:95:de:3f;
  fixed-address 192.168.1.6;
  }
host SECRETARY {
  hardware ethernet 00:26:2d:2e:19:c1;
  fixed-address 192.168.1.7;
  }
host PRINCIPAL {
  hardware ethernet 44:87:fc:94:80:8c;
  fixed-address 192.168.1.8;


acid_kewpie 04-05-2012 02:02 AM

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

hknoener 04-05-2012 02: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 02: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 02:30 AM

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

Code:

host ACCOUNTANT {
  hardware ethernet 44:87:fc:95:de:3f;
  fixed-address 192.168.1.6;
  }


acid_kewpie 04-05-2012 02:49 AM

Quote:

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 04: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 03: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 11:20 PM.