DHCP Server Configuration Problem

Simon Hobson dhcp1 at thehobsons.co.uk
Mon May 26 18:26:08 UTC 2008


DÔ Phan-Cam-Thach wrote:

>I have tried it, and the resultat returned is:
>
>"can't  open lease database /var/db/dhcpd.leases/no such file or directory"
>
>And in fact there is no folder whose name is db in /var.

So you have noticed any connection between an 
error message "/var/db/dhcpd.leases/ no such file 
or directory" and the fact that there is no file 
at that path ?

If the directory doesn't exist, then create it. Eg :
   mkdir -p /var/db
   touch /var/db/dhcpd.leases

The first command will make the directory, the 
second will create an empty file within it.

>I have search for the file lease and it is in 
>/usr/local/share/man/man5, but the name is 
>dhcpd.leases.5. I found that there is nothing 
>important inside, just the explaination of what 
>the file dhcpd.lease is.

It's the man page - ie what is used to display 
help if you type "man dhcpd.leases" !

>  However, i tried this command:
>
>sudo /usr/local/sbin/dhcpd -lf /usr/local/share/man/man5/dhcpd.leases.5
>
>It return a resultat "can not open 
>/etc/dhcpd.conf: no such file or directory" 
>(there is not this file in /etc).

Again, do you not spot the connection between 
"can not open /etc/dhcpd.conf: no such file or 
directory" and the fact that there is no such 
file ?


It seems you have multiple problems :

1) You have limited knowledge of Linux, and that 
means you don't really understand what people are 
telling you.

2) You have installed from source, and so it's 
quite possible that required files/directories 
have not been created for you - and neither us, 
nor I suspect yourself, know what config options 
were specified at compile time.

3) It appears from earlier emails that you may 
have another problem (permissions ?) that is 
stopping you from creating the required config 
file.


Given your limited skills, I would suggest that 
you should try installing your distributions 
package for the DHCP server. That will take care 
of creating the right files, in the right places 
for your package - then all you need to 
concentrate on is the actual config.


If you want to persist with your currently 
installed program, then try this and let us know 
what happens :

   mkdir -p /var/db
   touch /var/db/dhcpd.leases
   touch /etc/dhcpd.conf
   dhcpd -t -cf /etc/dhcpd.conf -lf /var/db/dhcpd.leases

These commands will :

Create /var/db/dhcpd.leases if it doesn't already exist.
Create /etc/dhcpd.conf if it doesn't already exist.
Test (the '-t' option) the config using the 
config and leases files ('-cf' and '-lf' options) 
specified. It will probably fail with an empty 
config file, but the results will be useful.


More information about the dhcp-users mailing list