Configure DHCP Server CentOS 6

Configure DHCP Server CentOS 6

This article goes through setting up DHCP (Dynamic Host Client Protocol) what this service does is allow computers to be “just plugged in” and have access to the internet, rather than having to manually assign IP addresses to each device.

Let’s get started! Login to the server you are going to configure as a DHCP server and su to root

*** Make sure that you have a STATIC ip set on the Server before proceeding past this point ***

obviosly we need to install the DHCP role

set the service to start on reboot

from here edit the following file:

it should look like so:

now we need to edit the DHCP config file

here’s a basic config (customize for your environment)

# specify domain name
option domain-name

# specify DNS’s hostname or IP address
option domain-name-servers

# specify WINS Servers
#option netbios-name-servers

# Allow Dynamic Updates to DNS
ddns-updates on;
ddns-update-style interim;
update-static-leases on;

# default lease time
default-lease-time 600;

# max lease time
max-lease-time 7200;

# this DHCP server to be declared valid

# specify network address and subnet mask
subnet netmask {
        # specify the range of lease IP address
        range dynamic-bootp;
        # specify broadcast address
        option broadcast-address;
        # specify default gateway
        option routers;

# Specify DHCP Reservations

        host fixed-device.mydomain.local {
        hardware ethernet 33:06:74:ac:ef:5b;
        fixed-address 192.168.1.x;

Save + quit

** At this point if you have a DHCP server already, please Un-Authorize/disable it, otherwise your new DHCP server will not work ***

In Win-Blows this is how to disable DHCP

Let’s start our DHCP Server

to view your current DHCP leases to make sure it’s working, you can view the dhcpd.leases (this file is one where you may want to use the grep command)

here’s an example of a used IP

That’s it!

To get a hosted Linux server visit to get started today!