Saturday, December 03, 2011

DHCP Server Configuration

Dynamic Host Configuration Protocol (DHCP) automatically assigns IP addresses and other network configuration information (subnetmask, broadcast address, etc) to computers on a network. A client configured for DHCP will send out a broadcast request to the DHCP server requesting an address. The DHCP server will then issue a "lease" and assign it to that client. The time period of a valid lease can be specified on the server.
  • DHCP assignment:
    • Lease Request: Client broadcasts request to DHCP server with a source address of and a destination address of The request includes the MAC address which is used to direct the reply.
    • IP lease offer: DHCP server replies with an IP address, subnet mask, network gateway, name of the domain, name servers, duration of the lease and the IP address of the DHCP server.
    • Lease Selection: Client recieves offer and broadcasts to DHCP servers that will accept given offer so that other DHCP server need not make an offer.
    • The DHCP server then sends an ack to the client. The client is configured to use TCP/IP.
    • Lease Renewal: When half of the lease time has expired, the client will issue a new request to the DHCP server.
  • Package = dhcp
  • Service = dhcpd
  • Port No. = 67
  • Configuration File = /etc/dhcpd.conf
Per quest:-
  • Configure IP =
  • Configure Hostname =
  • Firewall must be disabled.
1] Install required package
[root@server ~]# yum install dhcp* -y

2] Copy the new sample file and paste it under /etc directory
[root@server ~]# cp /usr/share/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf

3] Edit the dhcpd.conf file as follows: ( Make changes which are denoted in BOLD format)
[root@rootuser ~]# vi /etc/dhcpd.conf
ddns-update-style interim;
ignore cient-updates;

subnet netmask {

option routers;
option subnet-mask;
options nis-domain “”;
option domain-name “”;
option domain-name-servers;

option time-offset -1800; # Eastern
# option ntp-servers;
# option netbios-name-servers;
# --- Selects point-to-point node ( default is hybrid )
# -- You understand Netbios very well
# option netbios-node-type 2;

range dynamic-bootp;
default-lease-time 21600;
max-lease-time 43200;
# we want to nameserver to appear at a fixed address
host client {
hardware ethernet 12:AH:CD:78:43:GI;

4] Crete one blank file to store allocated ip address to client
[root@server ~]# touch /var/lib/dhcpd/dhcp.ip

5] Start dhcp service
[root@server ~]# service dhcpd start
[root@server ~]# chkconfig dhcpd on

DHCP Client Side:-
1] Set the ip address to dynamic from LAN card properties
[client@server~]# setup
Select the Network configureation --> Select Edit Network Devices --> Select device eth0 --> Select option Use DHCP [ * ] --> Then Ok --> Quit --> Save&quit --> Quit

2] Restart network service
[root@server ~]# service network restart
[root@server ~]# chkconfig network on

3] Now check IP address for eth0 device
[root@server ~]# ifconfig eth0

No comments: