• 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. bzegrep: Find extended regular expression patterns in bzip2 compressed files using egrep
  2. aws kinesis: Official AWS CLI for Amazon Kinesis streaming data services
  3. Linux OS Service ‘syslog’
  4. dstat Command Examples in Linux
  5. 14 Useful “cat” Command Examples in Linux
  6. axel: Download accelerator (Command Examples)
  7. cups-config: Show technical information about your CUPS print server installation
  8. ffprobe: Multimedia stream analyzer
  9. ansible-playbook: command not found
  10. fprintd-enroll Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • glab Command Examples
  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright