DHCP howto's

Share your expert knowledge and show off your skills.
Posts: 8
Joined: Wed Mar 12, 2008 11:44 am
Location: End of Road. . . .

DHCP howto's

Postby CyberBob » Mon Feb 23, 2009 2:31 pm

First of all thx to all LP members who made this website a platform to learn and discuss ideas in a better way. Usually all the system admins like to get rid of long documentation to perform a task. As long and unnecessary documentation really sucks. So i decided to put some howto's for configuring different servers. DHCP is the first that belongs to that series of howto's. I hope you would like this. . .Please contact me cyberbob.thedarklord@gmail.com so that i can improve this document.

Package name: dhcpd
Service name: dhcpd

path: /etc/dhcpd.conf
Log file: /var/log/messages

when dhcp is installed there is no config file present in etc,we have to copy
the config file from /usr/share/doc/dhcp.x.x.x/dhcpd.conf.sample to /etc/dhcpd.conf

This file is by default designed for subnet with netmask
now change this file to your desired subnet like in my case

The next line router means our gateway, like in my case

We are not using nis domain so just comment that,as nis is used when you use network
information services as centerlized authentication method.

option domain is different from the nis domain and it is the dns domain name in my
case it is cyberdyne.net.

In the next line we will tell the client about the DNS server in my case it is

just comment ntp-servers and netbois servers.

range dynamic-bootp is the range of ip's you can set it by your desire.like

range dynamic-bootp;

default-lease-time 21600; #it is the time after which a client will go to server for the renewel of IP address.It is in seconds.

max-lease-time 43200; #It is the time after which a server will automatically change the ip address of the client.It is in seconds.

If you want to give static ip to a client than use the host ns line like this

#host ns(name of the client )

host dumb{

comment the next-server line like this:
# next-server marvin.redhat.com;

hardware ethernet #it is the MAC of the client to which static ip is given

hardware ethernet 00:02:55:50:5A:BA;

fixed-address give desired static ip like this:


#######Configuring a Client to Use Your DHCP server.

To configure a linux client edit this file


for DHCP only three lines are enough like


While in case of static ip it shoud be like this


To configure a microshit client(ooh i was supposed to say micrsoft windows client) just go to

Control panel--->>Network Connections-->>Right click the desired connection
and than click properties,select Internet Protocol(TCP/IP) and click properties
button,now select Obtain IP address automatically and select obtain DNS server
address automatically.

now, restart the dhcpd service

A sample dhcpd.conf file

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

subnet netmask {

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

# option nis-domain "domain.org";
option domain-name "cyberdyne.net";
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 dumb{
# next-server marvin.redhat.com;
hardware ethernet 00:02:55:50:5A:BA;
Last edited by CyberBob on Fri Apr 17, 2009 9:47 pm, edited 1 time in total.

Muhammad Saad
Battalion Havaldaar Major
Posts: 273
Joined: Sat Jan 27, 2007 11:07 pm
Location: Dera Ismail Khan, Pakistan

Postby Muhammad Saad » Mon Feb 23, 2009 3:41 pm

You should not post useful information in "Gup Shup" section since it is automatically deleted after a few days.
This will be a more appropriate place:

Major General
Posts: 1114
Joined: Wed Aug 22, 2007 3:17 pm
Location: Faisalabad

Postby x2oxen » Tue Feb 24, 2009 11:49 am

Yup. You should use how to page!
Muhammad Usman
Chemonics International

Posts: 8
Joined: Wed Mar 12, 2008 11:44 am
Location: End of Road. . . .

Thx. .

Postby CyberBob » Tue Feb 24, 2009 2:14 pm

Any how posted those howto's to Howto's & Tip n' Tricks section :)

Return to “Howto's & Tip n' Tricks”

Who is online

Users browsing this forum: No registered users and 1 guest