Dhcpd.leases file manually edit

dhcpopenbsd

I have OpenBSD 4.8 serving as Gateway & DHCP Server.

By mistake, when reinstalling one of the workstations (it is Windows 7) it gets the same name as it was before (i.e workstation-PC).
So now I have in my /var/db/dhcpd.leases file two records with different IPs and same MAC address.

lease 172.32.100.185 {
starts 2 2012/11/06 13:10:58;
ends 4 2012/12/06 13:10:58;
hardware ethernet 00:1d:7d:00:54:ef;
uid 01:00:1d:7d:00:54:ef;
client-hostname "workstation-PC";
 }

And the old one workstation:

 lease 172.32.100.92 {
starts 2 2012/11/06 13:10:58;
ends 4 2012/12/06 13:10:58;
hardware ethernet 00:1d:7d:00:54:ef;
uid 01:00:1d:7d:00:54:ef;
client-hostname "workstation-PC";
 }

And I have that warning in /var/log/messages:

   dhcpd[12370]: client 00:1d:7d:00:54:ef has duplicate leases on LOCAL-NETWORK

I do not want to delete dhcpd.leases file and renew it because of one wrong settings, since that all other (Servers & workstations) will have changed (all are settled as dynamic not static addresses lease) IP and most of my colleagues will have to change a lot of settings in their local workstations.

My question is:
Can I just simply delete faulty record, save & exit dhcpd.leases file or it will made some problems?

Or, is there any other method which I can use to remove faulty records without changing anything else?

Thanks in advance

Best Answer

I just wouldn't touch that file.

If you really want to do it then you can. Just don't edit it in place. At least stop the DHCP server when you edit the file. (and backup the file in advance).

On the other hand if you want DHCP handling out static addresses then you should do that in the config file. Then you can guarantee that each client gets the same address every time.

Related Topic