July 25, 2014, 03:57:49 PM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: DHCP SERVER How to..(dhcpd)  (Read 22473 times)

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
DHCP SERVER How to..(dhcpd)
« 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 ftp://ftp.isc.org/isc/dhcp/dhcp-latest.tar.gz

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 255.255.255.0;


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

 # Give your router address here..
option routers 192.168.1.1;


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

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

 
 # 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 192.168.1.2. Similarly add other subnet for other  of ip range.
subnet 192.168.1.0 mask 255.255.255.0 {
                       192.168.1.10 192.168.1.90;
                        192.168.1.100 192.168.1.200;
   
                     }
 
 #  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;
                           fixed-address 192.168.1.15;
                       }


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]
/usr/sbin/dhcpd

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


Lastly :
Please correct me if you find any mistake or errors
Thankyou!

Offline tomamodi

  • Linux Learner
  • ***
  • Posts: 78
DHCP SERVER How to..(dhcpd)
« Reply #1 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

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
DHCP SERVER How to..(dhcpd)
« Reply #2 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.

Offline tomamodi

  • Linux Learner
  • ***
  • Posts: 78
this is the reply
« Reply #3 on: July 27, 2004, 11:50:05 AM »
/usr/sbin/dhcpd
this is the reply
/etc/dhcpd.conf line 29: semicolon expected.
subnet
^
Configuration file errors encountered -- exiting

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
DHCP SERVER How to..(dhcpd)
« Reply #4 on: July 27, 2004, 11:59:04 AM »
Ya there was semicolon missing .. now corrected!!

Offline sathish

  • Linux Learner
  • ***
  • Posts: 73
dhcp server
« Reply #5 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,

Sathish.

Offline j0nd4v1d

  • New Member
  • Posts: 1
2 Networks, 1 DHCP server
« Reply #6 on: August 11, 2005, 07:29:58 PM »
Hello!

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 :->