Answer: Do the following steps as:
1.vi /etc/dhcpd.conf
ddns-update-style none;
option routers 192.168.0.1;
option domain-name “example.com”;
option domain-name-servers 192.168.0.254;
default-lease-time 21600;
max-lease-time 43200;
subnet 192.168.0.0 netmask 255.255.255.0
{
range 192.168.0.1 192.168.0.254;
host dns1 {
hardware ethernet 00:50:FC:98:8D:00;
fixed-address 192.168.0.254;
}
host dns2 {
hardware ethernet 00:50:FC:98:8C:00;
fixed-address 192.168.0.253;
}
}
/etc/dhcpd.conf file is used to configure the DHCP. Some global options i.e Gateway, domainname, DNS server specified using option keyword. To assign as static ip from dhcp server, required the mac address of interface.
2. Check the SELinux Context, should be like this:
-rw-r--r-- root root system_u:object_r:dhcp_etc_t /etc/dhcpd.conf
3. Use the restorecon –R /etc command to restore the selinux context of the file.
4.service dhcpd start | restart
Submit