Linux Forums - Linux Help,Advice & support

Linux in General => Linux Tutorials & How To's => Topic started by: Ricky on October 25, 2003, 06:14:48 PM

Title: DHCP SERVER How to..(dhcpd)
Post by: Ricky on October 25, 2003, 06:14:48 PM
This How to is aimed to set the dhcpd server provided by isc.You can download the latest at

Intro: By using dhcpd u can assign ip address and other network information to ur clients. It is very useful in large neetworks.

Configuration. dhcpd server uses the /etc/dhcpd.conf file for its configuration. it is located in /etc/ directory.
/etc/dhcpd.conf file...

Code: [Select]

ddns-update-style ad-hoc;

 # Time used to set min. lease time ie. how long the assigned address is valid.
default-lease-time 800;
 # Maximum liease time allowed.
max-lease-time 7200;

 # Use this to set global subnet mask for your network
option subnet-mask;

 # Set the broadcast address used by clients. (usally its the last ip of the network ip range)
option broadcast-address;

 # Give your router address here..
option routers;

   #Set domain name servers for your network ie. give ip of the DNS server on your LAN
option domain-name-servers,;

  # Give domain name you want to get assigned to your network
option domain-name "";

 # Here set a range of ip used by ethernet of IP 192.168.1.x . ie. say your  
 # eth0 want to serve the network and has ip of Similarly add other subnet for other  of ip range.
subnet mask {
 #  Here use this to assign fixed ip to a client on your network with its hardware address provided.
host host_name {
                           hardware ethernet 00:c1:26:08:65:44;

Before running dhcpd make sure /var/state/dhcp/dhcpd.leases file exist. if not then run the following command.
Code: [Select]
touch /var/state/dhcp/dhcpd.leases

Now start dhcpd by giving the follwoing command
Code: [Select]

Or by
Code: [Select]
/etc/rc.d/init.d/dhcpd start

Lastly :
Please correct me if you find any mistake or errors
Title: DHCP SERVER How to..(dhcpd)
Post by: tomamodi on July 26, 2004, 10:55:17 AM
little more explanation
did this work with only one lan card  eth0
or need two
and did this need some of this in squid.conf from dhcpd
before there is rc.nat as you show for sharing lan
Title: DHCP SERVER How to..(dhcpd)
Post by: Ricky on July 27, 2004, 05:55:48 AM
This is nothing related to squid.conf

It is purely a dhcp server configuration using dhcpd in linux . It is used mostly in large network.. ie where there are many nodes .. I prefer to use dhcpd in more than 5 computer LAN.

So what you do is specify all your servers in dhcpd.conf file and then your clients get all information usind dhcp to configure themselves.

You here tell that which is your gateway , also specify what is your DNS servers, domain name and much more.

You can run NAT script with this also on static IP address LAN ie.  usually small LAN.

Hope you are cleared.
Title: this is the reply
Post by: tomamodi on July 27, 2004, 11:50:05 AM
this is the reply
/etc/dhcpd.conf line 29: semicolon expected.
Configuration file errors encountered -- exiting
Title: DHCP SERVER How to..(dhcpd)
Post by: Ricky on July 27, 2004, 11:59:04 AM
Ya there was semicolon missing .. now corrected!!
Title: dhcp server
Post by: sathish on September 22, 2004, 07:46:14 PM
Hello Ricky,

I have read the material regarding how to configure dhcp server, I have configured in my server also itz workin fine, but i am unable to understand what is the first line meant for ?? plz can you explain what is this.

ddns-update-style ad-hoc;

Thank you,

Title: 2 Networks, 1 DHCP server
Post by: j0nd4v1d on August 11, 2005, 07:29:58 PM

I have an existing ~15 machine network with a gentoo dhcp server happily providing dhcp leases to machines from a specified range.

Now, I would like to add a guest [wireless] network so guests can easily connect to open wifi.

I've added an interface to the dhcp server so I physically am ready, but have not a clue how to configure dhcp server for 2 segregated networks.

Problem1: I need to segregate them completely from my other users
Problem2: I'm wondering if I can remember their MAC adds then give the guest the same 10. address, if available, next time they request a lease - a week or a month later

Is all this doable??

THANKS IN ADVANCE for any suggestions :->