DHCP Server configuration in Linux
Linux is a UNIX based operating system. It is a server operating system. REDHAT Linux is Enterprise version of Linux. Now a day's Most of corporate sectors use red hat Linux as server in their company because it is secure very much.
Full form of DHCP "Dynamic Host Configuration Protocol. DHCP server assigns IP addresses and other network configuration information like subnet mask, broadcast address, etc to computers on a network. The DHCP assignments are the following.
Lease Request: Client broadcasts their request to DHCP server with a source address of 0.0.0.0 and a destination address of 255.255.255.255.
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 receives offer and broadcasts to al 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.
Installation of DHCP server: First of all while install the RedHat Linux enterprise version server be careful about the ports and the services must be turned on. To create DHCP server in Linux first download DHCP RPM package and install with "rpm-ivh" command. Where I have done it there I have create YUM server, so easily I have download and install it by YUM (yum install dhcp version). DHCP package will locate in /usr/share/doc/at Linux file system. I copied the DHCP's files from /usr/share/doc/ to /etc/dhcpd.conf.. Then I started to configure the dhcpd.conf file to route the DHCP server in there local network. I have open the configuration file with "vi" command. Then commented out the lines from "default gateway to option netbios" because system don't read the commented lines. After that I set the range of IP address in dynamic- bootp of their local assumption of system. I have change the "next-server" with the dhcp server name and have also change the fixed address with the dhcp server IP address (end range of dynamic IP). It is very easy job to configure DHCP server. After configure the .conf file of dhcp just turn on the service with "chkconfig" command and restart the dhcp service. After that entire job I reboot the system. And after rebooting of server I turned on the other client system. While startup the client system without static IP address all of those picked up IP from dhcp server and going on successfully. I have prefer the command line mode to do the total job.
The DHCP server configure file is following:
ddns-update-style interim
ignore client-updates
subnet 192.168.1.0 netmask 255.255.255.0 {
# The range of IP addresses the server
# will issue to DHCP enabled PC clients
# booting up on the network
range 192.168.1.201 192.168.1.220;
# Set the amount of time in seconds that
# a client may keep the IP address
default-lease-time 86400;
max-lease-time 86400;
# Set the default gateway to be used by
# the PC clients
option routers 192.168.1.1;
# Don't forward DHCP requests from this
# NIC interface to any other NIC
# interfaces
option ip-forwarding off;
# Set the broadcast address and subnet mask
# to be used by the DHCP clients
option broadcast-address 192.168.1.255;
option subnet-mask 255.255.255.0;
# Set the NTP server to be used by the
# DHCP clients
option ntp-servers 192.168.1.100;
# Set the DNS server to be used by the
# DHCP clients
option domain-name-servers 192.168.1.100;
# If you specify a WINS server for your Windows clients,
# you need to include the following option in the dhcpd.conf file:
option netbios-name-servers 192.168.1.100;
# You can also assign specific IP addresses based on the clients'
# ethernet MAC address as follows (Host's name is "laser-printer":
host laser-printer {
hardware ethernet 08:00:2b:4c:59:23;
fixed-address 192.168.1.222;
}
}
#
# List an unused interface here
#
subnet 192.168.2.0 netmask 255.255.255.0 {
}
×