Dhcp provide a method for hosts on a network to request and be granted,configuration information including the address of routers and nameservers
Ipv4 addresses are either dynamically assigned from a range of address and netmask,its default gateway  .Domain name and dns server,timeserver,and location of kickstart conf.files

service profile:

type : SysteV-managed service
package : dhcp
Daemon : /usr/sbin/dhcpd
script : /etc/init.d/dhcpd
ports : 67(bootps), 68 (bootpc)
conf.file: /etc/dhcpd.conf,/var/lib/dhcpd/dhcpd.leases
related : dhclient,dhcpv6-client,dhcpv6

steps to configure dhcp server:

#yum install dhcpd-* -y
#service dhcpd start
#chkconfig dhcpd on
#cp /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf
# vi /etc/dhcpd.conf

(change as follows)

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

subnet 192.168.0.0 netmask 255.255.255.0 {

# — default gateway
option routers                  192.168.0.254; (server ip)
option subnet-mask              255.255.255.0;  (subnetmask)

option nis-domain               “domain.org”;
option domain-name              “redhat.com”;   (domain name)
option domain-name-servers      192.168.0.254;   (dns ip)

option time-offset              -18000; # Eastern Standard Time
#       option ntp-servers              192.168.1.1;
#       option netbios-name-servers     192.168.1.1;
# — 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 192.168.0.1 192.168.0.20; (ip range)
default-lease-time 21600;
max-lease-time 43200;

save & quit

#service dhcpd restart

if you want to give a specific ip for a system

at the end of the file specify as follows

host station1
{ hardware ethernet 00:a0:cc:3d:45:3e
fixed address 192.168.0.10;
}
}
(here in this example we are providing 192.168.0.10 for a specific system we have to type mac address of that system at hardware ethernet)

Leave a Reply

Your email address will not be published. Required fields are marked *