# DHCP issue



## kthned (Jul 16, 2013)

Hi

I am quite new to this forum. I have a problem for my clients to get IP addresses from the DHCP server. /var/log/messages shows the following log messages. Can somebody help me on this? Thanks.
//kthned


```
Jul 15 12:41:23 primarydhcp dhcpd: DHCPREQUEST for 172.25.28.104 (x.y.z.x) from 00:19:99:60:51:60 (chaub) via 172.25.28.254: [color="Red"]database update failed[/color]
Jul 15 12:41:29 primarydhcp dhcpd: Wrote 0 deleted host decls to leases file.
Jul 15 12:41:29 primarydhcp dhcpd: Wrote 0 new dynamic host decls to leases file.
Jul 15 12:41:29 primarydhcp dhcpd: write_lease: unable to write lease 192.168.54.60
Jul 15 12:41:29 primarydhcp dhcpd: DHCPREQUEST for 172.25.28.129 (x.y.z.x) from 00:19:99:a6:9a:99 (VOLKER-EWW0) via 172.25.28.253: database update failed
Jul 15 12:41:29 primarydhcp dhcpd: Wrote 0 deleted host decls to leases file.
Jul 15 12:41:29 primarydhcp dhcpd: Wrote 0 new dynamic host decls to leases file.
Jul 15 12:41:29 primarydhcp dhcpd: write_lease: unable to write lease 192.168.54.60
Jul 15 12:41:29 primarydhcp dhcpd: DHCPREQUEST for 172.25.28.129 (x.y.z.x) from 00:19:99:a6:9a:99 (VOLKER-EWW0) via 172.25.28.254: database update failed
```


----------



## ShelLuser (Jul 16, 2013)

So what is the actual problem? You showed us an error message but then leave it up to guess what's going wrong.

For all I know clients got an IP address but it changes every time or clients didn't get an IP address or they did but several extra bits of information are incorrect, etc.

I also fail to understand why you hid the IP address, especially since it seems to be fully related to a private network anyway.

Alas; I'd start by looking into the dhcpd process and its data files. Especially the permission bits of those files. Judging from the error it couldn't write to the database file, and it needs to in order to keep track of all the leases it gives out.

_Edit_: I'm referring to /var/db/dhcpd.leases, if I recall correctly it has its own manual page called dhcpd.leases (see using `man dhcpd.leases`).


----------



## kthned (Jul 17, 2013)

Thanks for your reply.

Actually my DHCP server has been running perfectly for a couple of months and suddenly there were many users who stopped getting the IP adddres from the DHCP server. When I looked into the /var/log/messages file, it showed the following errors. There are hundreds of similar errors in the logs with different MAC addresses and with a repeated pattern

```
Jul 15 12:41:23 primarydhcp dhcpd: DHCPREQUEST for 172.25.28.104 (x.y.z.x) from 00:19:99:60:51:60 (chaub) via 172.25.28.254: database update failed
Jul 15 12:41:29 primarydhcp dhcpd: Wrote 0 deleted host decls to leases file.
Jul 15 12:41:29 primarydhcp dhcpd: Wrote 0 new dynamic host decls to leases file.
Jul 15 12:41:29 primarydhcp dhcpd: write_lease: unable to write lease 192.168.54.60
Jul 15 12:41:29 primarydhcp dhcpd: DHCPREQUEST for 172.25.28.129 (x.y.z.x) from 00:19:99:a6:9a:99 (VOLKER-EWW0) via 172.25.28.253: database update failed
Jul 15 12:41:29 primarydhcp dhcpd: Wrote 0 deleted host decls to leases file.
Jul 15 12:41:29 primarydhcp dhcpd: Wrote 0 new dynamic host decls to leases file.
Jul 15 12:41:29 primarydhcp dhcpd: write_lease: unable to write lease 192.168.54.60
Jul 15 12:41:29 primarydhcp dhcpd: DHCPREQUEST for 172.25.28.129 (x.y.z.x) from 00:19:99:a6:9a:99 (VOLKER-EWW0) via 172.25.28.254: database update failed
```

x.y.z.x is the public IP address of server where DHCP is hosted. It is the same in all the logs entries.

Restarting DHCP solves the issue, but I am wondering what was the problem to avoid it happening next time. I am quite new to the DHCP world. dhcpd.leases(5) didn't help. Please guide me where I can troubleshoot the problem.


```
db]$ man dhcpd.leases
No manual entry for dhcpd.leases
```


----------



## Chris_H (Jul 17, 2013)

kthned said:
			
		

> Thanks for your reply.
> 
> Actually my DHCP server has been running perfectly for a couple of months and suddenly there were many users who stopped getting the IP adddres from the DHCP server. When I looked into the /var/log/messages file, it showed the following errors. There are hundreds of similar errors in the logs with different MAC addresses and with a repeated pattern
> 
> ...


Greetings,

`uname -a` would have been helpful in your introductory post (OP). I'm guessing you're on 7, or 8.x.

Off the top of my head, this looks like it might be an order issue perhaps in rc(8); given that a service restart appears to cure it. Are the permission bits correct on the database? In other words: does the dhcpd service user have permission to create the database, when the system starts?

Just a couple of thoughts, that might help.

--chris


----------

