Wednesday, October 27, 2010

Server Configuration in Linux

 DHCP [Dynamic Host Configuration Protocol]:

To check package is installed or not :

# rpm -qa |grep dhcp*

if package is installed on your machine it will display you the list. If not inatall it using CD or DVD as mentioned in FTP section.

Search a file “dhcpd.conf.sample
this file is present at '/usr/share/doc/dhcp-*/ ' location. Copy this file into /etc/ location and rename it as 'dhcpd.conf'. i.e.
# cp /usr/share/doc/dhcp-*/dhcpd.conf.sample /etc/dhcpd.conf

goto /etc/ and check it.

Edit that file
Contents of that file are-
# vim /etc/dhcpd.conf

1) ddns-update-style interim;
'dhcp server and DNS server communicate with each other using interim method
2) ignore client-updates;
if client tries to update the information, DHCP will not allow it.
3) Range dynamic-bootup  (range of ip addresses);
    e.g.   172.16.0.50  to   172.16.0.100


The default lease time upto which client can use the connection is 21600 seconds (i.e. 6 Hrs. approx) and the maximum lease time is 43200 seconds (i.e. 12 Hrs. approx). You can increase the max lease time if client request for it.
Server can renew the Ip address if the lease period is 50% over. After 80% lease period done the server frees that ip address for to give to anyone.

# service dhcpd start

if you get [Failed] message the check the ip address of system and server and make them same.

# service network restart
# service dhcpd start


you will get [OK] message

For to give a fix ip address i.e. reservation:

get MAC address of client (using ifconfig command you can get it).

Edit dhcpd.conf file
in that file serach option

 hardware ethernet (give client's MAC address)  
 fixed address (give client's ipaddress)  

# service dhcpd restart

If you want to check the ip addresses of various machines assigned by DHCP server then edit
'/var/lib/dhcp/dhcpd.leases' file





No comments:

Post a Comment