Install DHCP on CentOs 7 / RHEL 7

DHCP Stands for Dynamic Host Configurations Protocol that is used to dynamically assign IP Addresses to Clients, on every device attached on network requires an IP Address to communicate with other devices.

If you notice when you connect to a network and you get an IP address automatically that is given by DHCP Server.
Step – 1
Open the terminal window and install DHCP package using yum command.
yum install dhcp -y
Step - 2
Edit the configuration file.
vi /etc/etc/dhcp/dhcpd.conf
Copy and paste below code into '/etc/dhcp/dhcpd.conf' file, and change according to your desired settings.
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.example
# see dhcpd.conf(5) man page
# Option definitions common to all supported networks
# Specify domain name
option domain-name “”;
# Specify name server’s hostname or IP address
option domain-name-servers;
# Default lease time
default-lease-time 600;
# Max lease time
max-lease-time 7200;
# This DHCP server Authoritative server in the Network.
subnet netmask {# Specify the range of lease IP address
range dynamic-bootp;
# Specify broadcast address
option broadcast-address;
# Specify default gateway
option routers;
Now Save and Exit the file.
Step - 3
Now its time to Enable and start the DHCP Service.
systemctl enable dhcpd
systemctl start dhcpd
If you didn’t miss anything clients machines on your network now able to get automatic ip addresses from your DHCP server.

So, setup your client machine on "Obtain an IP Address Automatically" it should get an automatic ip addresses from the specified range in the DHCP server.

About Author:

I am a Linux Administrator and Security Expert with this site i can help lot's of people about linux knowladge and as per security expert i also intersted about hacking related news.TwitterFacebook

Newer Post
Older Post


Post a Comment