I'm still trying to get away from Centos 6 but I have to get some other things working first so the business keeps running. Now I'm trying to get a new IP address for a Windows 10 PC. No matter what I do, it continues to get the same old address.
The C6 DHCP server has a defined static IP address for this PC based on its MAC address. I've deleted all references to the old address in /var/lib/dhcpd/dhcpd.leases and restarted dhcpd. I've found a way to get W10 to forget its old address and send DHCPDISCOVER to C6. But the C6 server responds by offering the old address, not the defined static address. Where is it keeping this old information?
What additional change do I need to make to the C6 DHCP server to get it to forget the old address and respond properly to the discover request?
Assuming you're running ISC DHCP, the lease database is in /var/lib/dhcpd.
To find the dhcp package names, use "rpm -qa | grep -i dhcp".
To list the files a package knows about: "rpm -qlv dhcp"
Also useful is to find what files have been touched: "rpm -V dhcp"
I find it useful to verify the whole system for signs of tampering with "rpm -Va", redirected into a file.
Kenneth Porter wrote:
Assuming you're running ISC DHCP, the lease database is in /var/lib/dhcpd.
Yes, it's ISC DHCP, the standard version for Centos 6 so far as I know.
But as I initially wrote, "I've deleted all references to the old address in /var/lib/dhcpd/dhcpd.leases and restarted dhcpd." Still, ISC DHCP offers the same old address in response to discover. Where else does it remember that address?
On Tue, 17 Jun 2025 at 00:53, Dave Close dave@compata.com wrote:
I'm still trying to get away from Centos 6 but I have to get some other things working first so the business keeps running. Now I'm trying to get a new IP address for a Windows 10 PC. No matter what I do, it continues to get the same old address.
The C6 DHCP server has a defined static IP address for this PC based on its MAC address. I've deleted all references to the old address in /var/lib/dhcpd/dhcpd.leases and restarted dhcpd. I've found a way to get W10 to forget its old address and send DHCPDISCOVER to C6. But the C6 server responds by offering the old address, not the defined static address. Where is it keeping this old information?
If the mac address has been redefined with a new ip address in the config file, and dhcpd is not offering that ip address.. then it probably isn't looking at the config file you changed. The reasons could be: 1. The dhcpd is a ghost still running from before you restart dhcpd (if it happens after a reboot then this isn't the case). 2. The startup script doesn't use the file you changed but uses something else for some reason (ps, lsof, etc can help pin this down). 3. The dhcpd you think you are running isn't actually the one offering things. [I had 2 dhcp servers on a network where one was changed and the other was still offering old data] I doubt this since I expect you are using tcpdump from your above comments and would have seen a different ip address offering things. 4. When you removed the dhcpd.leases entries, the old dhcpd was still running and it wrote from ram what it knew again to that file on exit. 5. [This is a variation of 3.. and one I have only had to deal with once..] you have a failover operating system somewhere. We had some programmers playing with QNX running in High Availability and one followed a tutorial and set up a dhcp server on theirs. They then shut down the system but every other QNX box (there were 4 or 5 of them) picked it up and started offering DHCPD with the original ip address. We had to power off 2 labs and reinstall boxes from scratch to stop this]
It has been a long time since I used dhcpd on c6, so I don't remember if it was one where if it found an error in startup it would work with an old leases file or if that was a different tool.
Basically if you have already done the following: 1. killall dhcpd 2. confirm they are all dead and not restarted etc because nagios or something else tried to be helpful 3. edit the dhcpd.leases file (or just mv /var/lib/dhcpd/dhcpd.leases /var/lib/dhcpd/dhcpd.leases.cursed) 4. edit the config file and confirm that the correct mac address has the new ip address and there is no conflict in that file with another mac and that ip address. 5. restart dhpcd 6. see if the lease action changed.
If that fails.. 4a. reboot to try and exorcise any problems.
What additional change do I need to make to the C6 DHCP server to get it to forget the old address and respond properly to the discover request? -- Dave Close, Compata, Irvine CA +1 714 434 7359 dave@compata.com dhclose@alumni.caltech.edu "Intelligence is like four-wheel drive. It only allows you to get stuck in more remote places." -- Garrison Keillor
Discuss mailing list -- discuss@lists.centos.org To unsubscribe send an email to discuss-leave@lists.centos.org