Score:0

DHCP is not starting in Ubuntu 18.04

jp flag

Im on ubuntu 18.04 ( also tried with ubuntu 20.04)....but i cant run isc-dhcp-server

osboxes@osboxes:~$ sudo systemctl status isc-dhcp-server
● isc-dhcp-server.service - ISC DHCP IPv4 server
     Loaded: loaded (/lib/systemd/system/isc-dhcp-server.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2021-11-10 17:06:48 CET; 13min ago
       Docs: man:dhcpd(8)
    Process: 9991 ExecStart=/bin/sh -ec      CONFIG_FILE=/etc/dhcp/dhcpd.conf;      if [ -f /etc/ltsp/>
   Main PID: 9991 (code=exited, status=1/FAILURE)

nov 10 17:06:48 osboxes dhcpd[9991]: 
nov 10 17:06:48 osboxes dhcpd[9991]: If you think you have received this message due to a bug rather
nov 10 17:06:48 osboxes dhcpd[9991]: than a configuration issue please read the section on submitting
nov 10 17:06:48 osboxes dhcpd[9991]: bugs on either our web page at www.isc.org or in the README file
nov 10 17:06:48 osboxes dhcpd[9991]: before submitting a bug.  These pages explain the proper
nov 10 17:06:48 osboxes dhcpd[9991]: process and the information we find helpful for debugging.
nov 10 17:06:48 osboxes dhcpd[9991]: 
nov 10 17:06:48 osboxes dhcpd[9991]: exiting.
nov 10 17:06:48 osboxes systemd[1]: isc-dhcp-server.service: Main process exited, code=exited, status=>
nov 10 17:06:48 osboxes systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'

Also got:

osboxes@osboxes:~$ /usr/sbin/dhcpd -f
Internet Systems Consortium DHCP Server 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
unable to create icmp socket: Operation not permitted
Config file: /etc/dhcp/dhcpd.conf
Database file: /var/lib/dhcp/dhcpd.leases
PID file: /var/run/dhcpd.pid
Can't open /var/lib/dhcp/dhcpd.leases for append.

If you think you have received this message due to a bug rather
than a configuration issue please read the section on submitting
bugs on either our web page at www.isc.org or in the README file
before submitting a bug.  These pages explain the proper
process and the information we find helpful for debugging.

exiting.

Perhaps is not important, but /var/lib/dhcp/dhcp.leases changes its permissions when isc-dhcp-server is launched:

osboxes@osboxes:~$ ls /var/lib/dhcp/dhcpd.leases -l
-rw-r--r-- 1 dhcpd dhcpd 219 nov 10 17:06 /var/lib/dhcp/dhcpd.leases
osboxes@osboxes:~$ sudo chmod -R 777 /var/lib/dhcp/
osboxes@osboxes:~$ ls /var/lib/dhcp/dhcpd.leases -l
-rwxrwxrwx 1 dhcpd dhcpd 219 nov 10 17:06 /var/lib/dhcp/dhcpd.leases
osboxes@osboxes:~$ sudo systemctl start isc-dhcp-server
osboxes@osboxes:~$ ls /var/lib/dhcp/dhcpd.leases -l
-rw-r--r-- 1 dhcpd dhcpd 219 nov 10 17:32 /var/lib/dhcp/dhcpd.leases

My /etc/dhcp/dhcpd.conf:

# dhcpd.conf
#

default-lease-time 60;
max-lease-time 60;
authoriative;                                                                                                                                             
                                                                                    
subnet 192.168.0.0 netmask 255.255.255.0 {
    range 192.168.0.10 192.168.0.30;
    #option domain-name-servers ns1.your_domain.com;
    #option domain-name "local.your_domain.com";
    option subnet-mask 255.255.255.0;
    option routers 192.168.0.1;
    option broadcast-address 192.168.0.255;

}

host VM1 {                                                                                                                                                      
  hardware ethernet 08:00:27:24:41:79;                                                                                                                          
  fixed-address 192.168.0.10;                                                                                                                                    
}

Any help or ideas would be apreciated

Doug Smythies avatar
gn flag
I do not know if it will solve your problem, but your MAC based IP address assignment should not overlap your dhcp pool range. Try giving it 192.168.0.9. Also I suggest to declare your MAC based IPs before your generic dhcp pool, rather than after. Why? So if you change a device from dhcp to MAC based, then it will actually get the new IP address rather than the old dhcp one. You might want to make your options global, covering both the pool and MAC based.
Doug Smythies avatar
gn flag
You shouldn't be altering permissions on the leases files. I suggest deleting the leases file, `/var/lib/dhcp/dhcpd.leases`, and its backup, `/var/lib/dhcp/dhcpd.leases~` and starting again.
jp flag
I made the changes you suggested and no luck....deleted the files and put the host before with a different host not in the range.
Doug Smythies avatar
gn flag
Are you in conflict with something else? Do you have a `/etc/ltsp/` directory? Which would mean you are using ltsp, I think.
jp flag
Sorry it worked now... i had to delete all the files in /var/lib/dhcp. T hanks for your help tomorrow i have class with students and i suppose we could solve the problem...also id answer about the network setup in other post where you are helping also....
Score:0
jp flag

Just for anyone that could have the same problem

Credits go to @DougSmythies

I had to delete all the files in /var/lib/dhcp.

Restart DHCP service.

Changing permissions didnt work

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.