Page 1 of 1

DHCP howto's

Posted: Mon Feb 23, 2009 2:31 pm
by CyberBob
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 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

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

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;

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 "";
option domain-name "";
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;
hardware ethernet 00:02:55:50:5A:BA;

Posted: Mon Feb 23, 2009 3:41 pm
by Muhammad Saad
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:

Posted: Tue Feb 24, 2009 11:49 am
by x2oxen
Yup. You should use how to page!

Thx. .

Posted: Tue Feb 24, 2009 2:14 pm
by CyberBob
Any how posted those howto's to Howto's & Tip n' Tricks section :)