Linux Dynamic Host Configuration Protocol | DHCP Server
Dynamic Host Configuration Protocol or DHCP -configuration examples
Below are the steps in configuring your DHCP Server. There is a working configuration file that uses CentOS Linux as the Operating System.
Before doing that please define your listening Ethernet card. This card will be listening to DHCP requests by clients within the network.
Please backup the original file located in /etc/ named dhcpd.conf by executing the command.
Be sure to edit /etc/sysconfig/dhcpd to reflect your Ethernet card that will use dhcp.
# Command line options here
DHCPDARGS=eth0
[mylogin@hostname dhcp]# cd /etc
[mylogin@hostname dhcp]# cp dhcpd.conf dhcpd.conf_<backup_date>
It is important to always backup the current configuration before modifying it just incase something goes wrong :D. Then edit dhcpd.conf
[mylogin@hostname dhcp]# vim dhcpd.conf
#!/bin/bash
authoritative;
ddns-update-style interim;
default-lease-time 28800;
max-lease-time 28800;
# Network 01
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.2 192.168.1.254;
# Configure Clients Default Configuration
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.1;
# Configure the clients DNS Settings
option domain-name "public_dns.tld";
option domain-name-servers <IP address of DNS 01>, <IP address of DNS 02>, <IP address of DNS 03>;
}
Set the service to run every time the system restarts.
[mylogin@hostname dhcp]# chkconfig dhcpd on
Start DHCP Server without rebooting the Operating System
[mylogin@hostname dhcp]# service dhcpd start
When there are no errors while starting DHCP Service then the DHCP Server is properly configured and ready to roll out.

