dhcpd wont start

Issues related to configuring your network
Post Reply
Joreis
Posts: 3
Joined: 2015/05/15 14:30:05

dhcpd wont start

Post by Joreis » 2015/05/15 14:43:35

Hello,

Maybe this is a known topic but I was not able to find a answer by myself in the forum.

I installed DHCP on my virtual Machine CentOS 6.2 for learning proposes. I am using VirtualBox and GNS3. I have 2 NICS ( ETH0 for connection ) (ETH1 For internal network)

Here is the IP config

eth0 Link encap:Ethernet HWaddr 08:00:27:BD:6C:3E
inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0


eth1 Link encap:Ethernet HWaddr 08:00:27:7A:72:BD
inet addr:192.168.10.1 Bcast:192.168.10.255 Mask:255.255.255.0

I want to run DHCP on eth1 and I installed it and edited the dhcpd.conf file this way:
Can you please give some help understanding why dhcpd is not starting?

[root@CentOSReis ~]# cat /etc/dhcp/dhcpd.conf
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.sample
# see 'man 5 dhcpd.conf'
#


default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.10.255;
option routers 192.168.10.1;
option domain-name-servers 8.8.8.8;

subnet 192.168.10.0 netmask 255.255.255.0 {
range 192.168.10.10 192.168.10.100;
range 192.168.10.150 192.168.10.200;


starting dhcpd: [Failed]

##/var/log/messages##

May 15 16:26:05 CentOSReis dhcpd: Internet Systems Consortium DHCP Server 4.1.1-P1
May 15 16:26:05 CentOSReis dhcpd: Copyright 2004-2010 Internet Systems Consortium.
May 15 16:26:05 CentOSReis dhcpd: All rights reserved.
May 15 16:26:05 CentOSReis dhcpd: For info, please visit https://www.isc.org/software/dhcp/
May 15 16:26:05 CentOSReis dhcpd: Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
May 15 16:26:05 CentOSReis dhcpd: Can't chown new lease file: Operation not permitted
May 15 16:26:05 CentOSReis dhcpd:
May 15 16:26:05 CentOSReis dhcpd: This version of ISC DHCP is based on the release available
May 15 16:26:05 CentOSReis dhcpd: on ftp.isc.org. Features have been added and other changes
May 15 16:26:05 CentOSReis dhcpd: have been made to the base software release in order to make
May 15 16:26:05 CentOSReis dhcpd: it work better with this distribution.
May 15 16:26:05 CentOSReis dhcpd:
May 15 16:26:05 CentOSReis dhcpd: Please report for this software via the CentOS Bugs Database:
May 15 16:26:05 CentOSReis dhcpd: http://bugs.centos.org/
May 15 16:26:05 CentOSReis dhcpd:
May 15 16:26:05 CentOSReis dhcpd: exiting.


Thanks for your help

User avatar
avij
Retired Moderator
Posts: 3046
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: dhcpd wont start

Post by avij » 2015/05/15 14:53:42

Joreis wrote:Can't chown new lease file: Operation not permitted
See if removing /var/lib/dhcp/dhcpd.leases* helps. Also check that /var/lib/dhcp is writable by the user dhcpd runs as.

In addition, it would be smart to use the latest version of CentOS. The latest version from the 6.x branch is 6.6.

Joreis
Posts: 3
Joined: 2015/05/15 14:30:05

Re: dhcpd wont start

Post by Joreis » 2015/05/15 15:20:09

Thanks for your answer.

I am using centOS 6.2 because its the version we use at work.

For some reason dhcpd.leases is not on /var/lib/dhcpd/

I checked if it was writable by using:

Code: Select all

touch test
I also as a test it by creating the file dhcpd.leases on the directory /var/lib/dhcpd/
I started DHCP but it failed still

Any Ideas?

Joreis
Posts: 3
Joined: 2015/05/15 14:30:05

Re: dhcpd wont start

Post by Joreis » 2015/05/15 15:26:26

Also, dhcpd runs as root since I have no other user created. this setup is is running on my private network so there is no risk in using only root user. ;)

jscarville
Posts: 135
Joined: 2014/06/17 21:50:37

Re: dhcpd wont start

Post by jscarville » 2015/05/15 17:47:20

As installed in Centos 6, the dhcpd daemon runs as user dhcpd. A few suggestions

1. Check ownership on /var/lib/dhcpd
# ls -ld /var/lib/dhcpd/
drwxr-xr-x. 2 dhcpd dhcpd 4096 May 4 08:45 /var/lib/dhcpd/

2. Check that the dhcpd user exists
# id dhcpd
uid=177(dhcpd) gid=177(dhcpd) groups=177(dhcpd)

3. Put a closing brace '}' at the end of your subnet statement.

heeblet
Posts: 1
Joined: 2015/12/18 19:26:55

Re: dhcpd wont start

Post by heeblet » 2015/12/18 19:29:09

My friends - was working on this for 3 days. Disabling SELinux / setting to permissive worked great.

To do this temporarily for testing -

Code: Select all

echo 0 >/selinux/enforce 
See if DHCPD starts.

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: dhcpd wont start

Post by TrevorH » 2015/12/19 00:21:22

And then once it does start you consult your audit logs to find out why selinux was stopping it, fix that and put selinux back to enforcing again.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply