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
dhcpd wont start
Re: dhcpd wont start
See if removing /var/lib/dhcp/dhcpd.leases* helps. Also check that /var/lib/dhcp is writable by the user dhcpd runs as.Joreis wrote:Can't chown new lease file: Operation not permitted
In addition, it would be smart to use the latest version of CentOS. The latest version from the 6.x branch is 6.6.
Re: dhcpd wont start
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:
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?
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 started DHCP but it failed still
Any Ideas?
Re: dhcpd wont start
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.
-
- Posts: 135
- Joined: 2014/06/17 21:50:37
Re: dhcpd wont start
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.
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.
Re: dhcpd wont start
My friends - was working on this for 3 days. Disabling SELinux / setting to permissive worked great.
To do this temporarily for testing -
See if DHCPD starts.
To do this temporarily for testing -
Code: Select all
echo 0 >/selinux/enforce
Re: dhcpd wont start
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
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