How to set up a DHCP server?
The problem is that with the new dhcp3 server that the config files are done differently than on older installations.
Now the installation is done under isc-dhcp-server the location of the dhcpd.conf
file and interfaces has changed along with the mechanism to start stop the service.
The dhcpd.conf
file has moved from /etc/dhcp3/dhcpd.conf
to /etc/dhcp/dhcpd.conf
.
The interface definition has also moved--from /etc/default/dhcp3-server
to /etc/default/isc-dhcp-server
.
The fields are basically the same but if you have been modifying the original files you will get the error you see above. Make the mods to these files and you should be OK to go.
Also no best to start and stop using sudo service isc-dhcp-server start/stop/restart
.
I was suffering with all these problems on Ubuntu 12.04 but this resolved all the issues and now it's working. I hope this helps you.
I would suggest you to take a look to the man page of /etc/dhcp3/dhcpd.conf, which is the file you'll have to modify to correctly configure your dhcpd server. A basic file would look like this :
DHCPDARGS=eth0; # to specify to which interface your dhcpd server have to listen
subnet 192.168.0.0 netmask 255.255.255.0 {
option routers 192.168.0.1; #Default Gateway
option subnet-mask 255.255.255.0;
option domain-name "home.local";
option domain-name-servers 192.168.0.2;
range dynamic-bootp 192.168.0.51 192.168.0.100; #DHCP Range to assign
default-lease-time 43200; # every 12 hours, an address can be changed
max-lease-time 86400; # every 24 hours, an address must be renewed
}