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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • 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. pkgmk Command Examples in Linux
  2. “git missing” Command Examples
  3. links Command Examples in Linux
  4. last Command Examples in Linux
  5. gdebi Command Examples in Linux
  6. update-alternatives: command not found
  7. nft: command not found
  8. How to uninstall scons package from Ubuntu
  9. How to find docker storage device and its size (device mapper storage driver)
  10. module: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright