2

If I configure an IP address range in dhcp, and allocate two addresses to two different MACs using fixed-address, and if those two or one of the systems is not active in the network, then the corresponding IP address is getting assigned to some other system which is not mentioned in any host declaration.

I have configured dhcp server 4.2.5 on CentOS 7.1 and configured dhcpd.conf as given below:

log-facility local7;
ping-checks;
ping-timeout 5;
deny declines;
lease-file-name "/etc/dhcp/dhcpd.leases";
infinite-is-reserved on;

#######################- eth0 -#######################
subnet 192.168.72.0 netmask 255.255.255.0 {
        range 192.168.72.56 192.168.72.100;
        option domain-name-servers 192.168.72.35;
        option routers 192.168.72.35;
        default-lease-time 86400;
        max-lease-time 172800;
}
host abc {
        hardware ethernet 00:90:fb:38:15:ae;
        fixed-address 192.168.72.56;
}
host xyz {
        hardware ethernet 11:22:88:55:66:22;
        fixed-address 192.168.72.57;
} 

Now if the system with MAC address "11:22:88:55:66:22" is not active in the network, then IP address "192.168.72.57" can be assigned to any other machine.

But if the system with MAC address "11:22:88:55:66:22" is active then it's working properly.

Please tell me whether it is expected behaviour or not. In the previous version of dhcp 4.1 I never observed this behaviour.

I thought a reserved IP address should not get assigned to any other system.

Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47
Kiran
  • 21
  • 3
  • Are you sure those other systems are actually getting the address via DHCP - or could someone have misconfigured them manually? – Jenny D Feb 14 '18 at 14:06
  • Yes I am sure that other machine is getting ip address via same dhcp, I have created isolated setup and on client no static ip is configured. – Kiran Feb 15 '18 at 06:55
  • Current configuration in dhcpd.conf: host abc { hardware ethernet 00:0e:46:49:0d:a6; fixed-address 192.168.72.56; Dhcpd logs: [root@kiran ~]# tailf /var/log/messages Feb 15 12:22:35 kiran dhcpd[2588]: DHCPREQUEST for 192.168.72.56 from 00:90:fb:38:18:af via eth0 Feb 15 12:22:35 kiran dhcpd[2588]: DHCPACK on 192.168.72.56 to 00:90:fb:38:18:af via eth0 #################################################### Now you can see 192.168.72.56 is reserved for mac "00:0e:46:49:0d:a6" but as per dhcp logs it is getting assigned to mac "00:90:fb:38:18:af" – Kiran Feb 15 '18 at 07:07

2 Answers2

2

I put the fixed addresses inside the subnet, but outside the range. They way they don't get given to others.

Jasen
  • 621
  • 5
  • 12
0

Adding an entry in dhcpd.leases solved my problem.

I added the following entry in the /etc/dhcp/dhcpd.leases file:

lease 192.168.72.56 {
  binding state active;
  reserved;
  hardware ethernet 00:90:fb:38:15:ae;
}
Colt
  • 1,939
  • 6
  • 20
  • 25
Kiran
  • 21
  • 3