Noob here again: cannot start DHCPD
This is a freshly installed RHEL 6.8 with DNS and DHCP installed.
I get "failed" whenever I try to start a newly installed dhcpd. The dhcpd.conf file is as follows:
option domain-name "example.com";
option domain-name-servers "example.com";
default-lease-time 600;
max-lease-time 1800;
subnet 192.168.100.0 netmask 255.255.255.0 {
range 192.168.100.10 192.168.100.20;
options routers 192.168.100.1;
}
This is the example I got from my textbook, and I've tried removing quotes as well as adding them.
Any ideas ? thank you for your kind assistance.
I'm adding the exact steps I followed from the textbook below:
- Start the virtual machine, and open a root shell. From the root shell, use the command yum -y install dhcp to install the DHCP server.
- Open the file /etc/dhcp/dhcpd.conf with an editor, and give it the following contents. Make sure that the names and IP addresses used in this example match your network:
option domain-name "example.com";
option domain-name-servers YOUR.DNS.SERVERNAME.HERE;
default-lease-time 600;
max-lease-time 1800;
subnet 192.168.100.0 netmask 255.255.255.0 {
range 192.168.100.10 192.168.100.20;
options routers 192.168.100.1;
} - Start the DHCP server by using the command service dhcpd start, and enable it using chkconfig dhcpd on.
Responses
Do you got a dns server configured with domain being "example.com"? So, does hostname resolves to IP successfully? If this is working good, then make sure to enable required ports for dns and dhcpd services to work properly.
Like most daemon processes, dhcpd won't emit its error messages to the screen, as it is designed to assume there may be nobody watching the screen. Instead, it sends its error messages to the syslog daemon, which writes them to the standard system log files.
If you run
grep dhcp /var/log/messages
what do you get?
In this way, you're likely to find a detailed error message describing what is wrong with dhcpd or its configuration. If the problem is a configuration syntax error, the error message may even include a line number to identify the location of the error.
That is good. Yes sometimes these typos are hard to trace out. It is always better to run a syntax check if that is available for the respective daemon as "dhcpd -t" in this case.
Below is the snippet from the man page of dhcpd:
If the -t flag is specified, the server will simply test the configuration file for correct syntax, but will not attempt to perform any network operations.
Otherwise, "service dhcpd configtest" would do the same.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
