interview question and answer

June 24, 2012

Configure DHCP On RHEL-5

Configure DHCP On RHEL-5


DYNAMIC HOST CONTROL PROTOCOL (DHCP)


Setup:

Server: sandeeplinux-server (192.168.4.1 Local Network IP)
Client: Linux & Windows XP/2003 etc...


Requirement: This DHCPD package available on RHEL5 DVD only

dhcp-3.0.5-3.el5.i386.rpm
 
Installation Of Required Packages:



[root@maheshlinux-server ~]# rpm -qa
grep dhcp

dhcpv6_client-0.10-33.el5

[root@maheshlinux-server ~]#



[root@maheshlinux-server RHEL5_Total_Pack]# rpm -i dhcp-3.0.5-3.el5.i386.rpm

warning: dhcp-3.0.5-3.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

[root@maheshlinux-server RHEL5_Total_Pack]#



Configure DHCP config file:

NOTE: Modify dhcpd.conf file (Before Modifying any Files take one backup copy)



In this file you will get information to modify dhcpd.conf.sample file which located in “/usr/share/doc/dhcp-3.0.5”



[root@maheshlinux-server ~]# cd /etc/

[root@maheshlinux-server etc]# cat dhcpd.conf

#

# DHCP Server Configuration file.

# see /usr/share/doc/dhcp*/dhcpd.conf.sample

#[root@maheshlinux-server etc]#



GO TO --> /usr/share/doc/dhcp-3.0.5/



[root@maheshlinux-server etc]# cd /usr/share/doc/dhcp-3.0.5/

[root@maheshlinux-server dhcp-3.0.5]#



[root@maheshlinux-server dhcp-3.0.5]# vi dhcpd.conf.sample

ddns-update-style interim;

ignore client-updates;



subnet 192.168.4.0 netmask 255.255.255.0 {



# --- default gateway

option routers 192.168.4.1;

option subnet-mask 255.255.255.0;



option nis-domain "domain.org";

option domain-name "domain.org";

option domain-name-servers 192.168.4.1;



option time-offset -18000; # Eastern Standard Time

# option ntp-servers 192.168.4.1;

# option netbios-name-servers 192.168.4.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.4.128 192.168.4.254;

default-lease-time 21600;

max-lease-time 43200;



# we want the nameserver to appear at a fixed address

host ns {

next-server marvin.redhat.com;

hardware ethernet 12:34:56:78:AB:CD;

fixed-address 192.168.4.100;

}

}

[root@maheshlinux-server dhcp-3.0.5]#



Now Try To Start DHCPD Service:

[root@maheshlinux-server RHEL5_Total_Pack]# service dhcpd status

dhcpd is stopped

[root@maheshlinux-server RHEL5_Total_Pack]# service dhcpd start

Starting dhcpd: [FAILED]

[root@maheshlinux-server RHEL5_Total_Pack]# chkconfig dhcpd on

[root@maheshlinux-server RHEL5_Total_Pack]#





IF ITS GETTING FAIL TO START MEANS copy dhcpd.conf.sample file to dhcpd.conf file

[root@maheshlinux-server dhcp-3.0.5]# cp dhcpd.conf.sample /etc/dhcpd.conf

It will ask for over write dhcpd.conf file give YES



[root@maheshlinux-server dhcp-3.0.5]# service dhcpd restart

Shutting down dhcpd: [ OK ]

Starting dhcpd: [ OK ]

[root@maheshlinux-server dhcp-3.0.5]#



Now Check DHCP with Windows Client:





Go To My Network Places --> Properties --> Local Area Connection --> Properties --> General Tab --> Internet Protocol (TCP/IP) --> Properties --> Obtain an IP Address Automatically --> OK

No comments: