Install and Configure DHCP Server on CentOS 6.x – RHEL 6.x

Updated on July 14, 2018
1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)
Loading...

What is DHCP?
DHCP stands for Dynamic Host Configuration Protocol. DHCP is a standardized network protocol used on Internet Protocol networks for dynamically distributing network configuration parameters, such as IP addresses for interfaces and services.

DHCP is configured in a server-client model. DHCP server is the one assigning IP Addresses to client computers on the network. Each client is assigned a unique IP Address. DHCP server has a number of IP Addresses available in it’s pool.

In this video tutorial, we will see how to install and configure DHCP Server on CentOS 6.x or RHEL 6.x

How to Install and Configure DHCP Server on CentOS 6 and RHEL 6

Related Article  Install Fedora 19 KDE Desktop Edition in VMware Workstation 9

Steps:

1. Install DHCP
yum install dhcp
rpm -qc dhcp
/etc/dhcp/ – container for DHCPD configuration
/etc/dhcp/dhcpd.conf – IPv4 config
/var/lib/dhcpd – container for leases
/var/lib/dhcpd/dhcpd.leases – IPv4 leases

2. Enable DHCPD service
chkconfig dhcpd on

3. View dhcpd.conf file
cat /etc/dhcp/dhcpd.conf

4. Copy sample conf file to /etc/
cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample  /etc/dhcp/dhcpd.conf

5. Edit the dhcpd.conf file and comment out unnecessary things
Configure scope for: 192.168.0.0/24
192.168.0.50-100 – Usable IP Address

Note: Alter DHCPD to log using a different facility: i.e. ‘local6’ because boot messages are logged via: local7

6. Start DHCPD service
service dhcpd start

7. Release client’s IP configuration
dhclient -r or dhclient -r eth0 or ifdown eth0

Related Article  Install and Configure VSFTPD FTP Server - RHEL 6 - CentOS 6

8. Renew client’s IP configuration

dhclient or dhclient eth0 or ifup eth0
or service network restart

9. Show DHCP server that client gets its IP configuration
cat /var/lib/dhclient/dhclient.leases