jump to navigation

Quick guide how to Setup a linux dhcp server (Centos 5.2) July 3, 2009

Posted by daakeung in Uncategorized.
Tags: , ,

Quick guide to setup a linux DHCP server on a network, you can modify this to work with your own design.

[root@dhcp ~]# yum install dhcp

[root@dhcp ~]cp /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf
cp: overwrite `/etc/dhcpd.conf’? y
[root@dhcp ~]vi /etc/dhcpd.conf

ddns-update-style interim;
ignore client-updates;

subnet netmask {

# — default gateway
option routers        ;
option subnet-mask    ;

#option nis-domain               “akeung.com”;
option domain-name              “akeung.com”;
option domain-name-servers;

option time-offset              -18000; # Eastern Standard Time
#       option ntp-servers    ;
#       option netbios-name-servers;
# — Selects point-to-point node (default is hybrid). Don’t change this unless
# — you understand Netbios very well
#       option netbios-node-type 2;

range dynamic-bootp;
default-lease-time 21600;
max-lease-time 43200;

# we want the nameserver to appear at a fixed address
#        host ns {
#                next-server marvin.redhat.com;
#                hardware ethernet 12:34:56:78:AB:CD;
#                fixed-address;
#        }

Then esc, press


To start the service :

service dhcpd start

To enable it at bootup :

chkconfig dhcpd on

You can locate the leases at :


Also, if a reservation is needed. Simply add the following to /etc/dhcpd.conf

host daakeung {
option host-name “daakeung.akeung.com”;
hardware ethernet 00:00:00:00:00:00;      #<—-Replace with Client’s MAC address