DHCP Configuration in Linux

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 netmask {
# — default gateway
option routers        ; (server ip)
option subnet-mask    ;  (subnetmask)
option nis-domain               “domain.org”;
option domain-name              “redhat.com”;   (domain name)
option domain-name-servers;   (dns ip)
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; (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;
(here in this example we are providing 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 *