• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS / RHEL : How to configure an DHCP server

By admin

1. Install the dhcp package:

# yum install dhcp

2. Copy the sample file /usr/share/doc/dhcp*/dhcpd.conf.sample.

# cp /usr/share/doc/dhcp*/dhcpd.conf.sample /etc/dhcp/dhcpd.conf

3. The Sample dhcp configuration file will look as follows.

# cat /etc/dhcp/dhcpd.conf

          Allow booting;
          Allow bootp;
          authoritative;
          subnet 192.168.0.0 netmask 255.255.255.0 {
          option routers 192.168.0.1;
          range 192.168.0.100 192.168.0.200;
          default-lease-time 21600;
          max-lease-time 43200;

You will need to change the IP addresses/ranges and subnet masks as per your requirements in the file above.

4. Restart the dhcp service once you are done with doing all the changes.

# /etc/init.d/dhcpd restart

For more about the dhcpd.conf, use the below command to check the man page:

# man dhcpd.conf

Filed Under: Linux

Some more articles you might also be interested in …

  1. Beginners Guide to User and Group Administration in Linux
  2. “mlock failed: Cannot allocate memory” lvcreate command error in CentOS/RHEL 7
  3. CentOS / RHEL 6 : How to password protect grub (Password-Protected Booting)
  4. CentOS / RHEL : How to configure alias (virtual interface) of bond interface (bondx:y)
  5. Understanding kdump Configuration file /etc/kdump.conf
  6. How to use auditd to monitor a specific SYSCALL
  7. How the BASH Shell load its configuration files in Linux
  8. Linux OS Service ‘NetFS’
  9. Bash for loop Examples
  10. CentOS / RHEL 7 : How to configure kdump using GUI

You May Also Like

Primary Sidebar

Recent Posts

  • How to set the default character set in MySQL and how to propagate it in a master-master replication scenario
  • “Connection reset by peer” – error while ssh into a CentOS/RHEL system with a specific user only
  • MySQL: how to figure out which session holds which table level or global read locks
  • Recommended Configuration of the MySQL Performance Schema
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary