Search This Blog

Saturday, September 24, 2011

How to Configure DHCP in RHEL 6 ?

Before starting make sure that your system has a Static IP Address.

My ip address is as following.
IP- 192.168.1.65
Subnet- 255.255.255.0
 


1)yum install –y dhcp 
 # Install the dhcp package.
2)chkconfig dhcpd on 
 # This setting makes sure that service starts on subsequent
 # system boots.
3)vi /etc/dhcp/dhcpd.conf
 # open the file and insert the following parameters.


Here is my sample dhcp configuration file.
# Global Options
ddns-update-style none;
authoritative;

# Subnet definition
subnet 192.168.1.0 netmask 255.255.255.0 {
# Parameters for the local subnet
option routers               192.168.1.1;
option subnet-mask           255.255.255.0;
option domain-name           “example.com”;
option domain-name-servers   192.168.1.1;
default-lease-time           21600;
max-lease-time               43200;
# Client IP range
range dynamic-bootp 192.168.1.100 192.168.1.200;
}

Meaning of parameters.

ddns-update-style #Means that the DHCP server will not update the dns records of the client.

authortitative #This parameter informs the clients that the values in the DHCP server are legitimate.


option routers #Defines the default gateway.

option subnet-mask #Defines the subnet mask.

option domain-name #Defines the domain name.


option domain-name-servers #Defines the Domain name server.

range dynamic-bootp #Defines the range from which IP addresses can be allocated.

4)service dhcpd restart #restart the service.

0 comments:

Post a Comment