configuring DHCP service in Linux

Written By smart| 16 June 2009| 2 Comments

DHCP stands for Dynamic Host Configuration Protocol.

DHCP server manages a pool of IP addresses and information about client configuration parameters such as default gateway, domain name, the DNS servers, other servers such as time servers, and so forth. On receiving a valid request, the server assigns the computer an IP address, a lease (length of time the allocation is valid), and other IP configuration parameters, such as the subnet mask and the default gateway. The query is typically initiated immediately after booting, and must complete before the client can initiate IP-based communication with other hosts.

There three methods of allocating IP addresses

dynamic allocation
:network administrator assigns a range of IP addresses to DHCP, and each client computer on the LAN has its IP software configured to request an IP address from the DHCP server during network initialization. The request-and-grant process uses a lease concept with a controllable time periods, allowing the DHCP server to reclaim (and then reallocate) IP addresses that are not renewed (dynamic re-use of IP addresses).

automatic allocation
: The DHCP server permanently assigns a free IP address to a requesting client from the range defined by the administrator. This is like dynamic allocation, but the DHCP server keeps a table of past IP address assignments, so that it can preferentially assign to a client the same IP address that the client previously had.

static allocation: The DHCP server allocates an IP address based on a table with MAC address/IP address pairs, which are manually filled in (perhaps by a network administrator). Only requesting clients with a MAC address listed in this table will be allocated an IP address. This feature (which is not supported by all routers) is variously called Static DHCP Assignment (by DD-WRT), fixed-address (by the dhcpd documentation), DHCP reservation or Static DHCP (by Cisco/Linksys), and IP reservation or MAC/IP binding (by various other router manufacturers).

Instal your dhcp server using

#yum -y install dhcp

Configure the dhcp.conf

#vi /etc/dhcpd.conf

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

#Network For DHCP
subnet 192.168.0.0 netmask 255.255.255.0 {

# — Router IP
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;

#Option For Domain
option nis-domain “domain.org”;
option domain-name “domain.org”;
#Option for DNS Server

option domain-name-servers 192.168.1.1;

option time-offset -18000; # Eastern Standard Time

# Range Ip For DHCP
range dynamic-bootp 192.168.0.128 192.168.0.254;
default-lease-time 21600;
max-lease-time 43200;
}

Related Posts with Thumbnails

Share With Others

2 Comments »

  • Hobosic said:

    Super post, Need to mark it on Digg
    Have a nice day

  • sushanth said:

    thanks for the comment hobosic

Leave your response!




Comment moderation is enabled. Your comment may take some time to appear.