Thứ Ba, 26 tháng 1, 2016

How to install DHCP

DHCP provides an IP address. In addition it has several features to provide other elements of client. 


Ex: Provides IP address of PC to solve DNS domain, Address of a Gateway Router, ...

The composition of a DHCP server include the following four main sections:

Options: Provides the elements for Client such as: IP; Subnet Mask Address; Gateway Address; DNS; ...

Scope: A segment addresses is before defined on the DHCP server, which you will use to assign to the Client.

Reservation: It is segment addresses for a Scope which you is defined above.

Lease: It is time "leasing" an IP address to each Client.

How to install DHCP?

To use DHCP, you must install the system with services already on the CD. It have extension is .rpm.

 In addition, you can installation package in the form of source code and download it from the GNU website.

The installation process:

• In the form of the extension is .rpm, you run the command:

rpm -ivh dhcp - *. rpm

• In the form of source code, you compiled the following:

-xzvf tar dhcp - *. tar.gz
cd dhcp- *
./configure
make
make install

After completing the installation process, you will be configuration to this services can operate according to your idea by creating and modifying file /ect/dhcp.conf. This file will be contain the following.

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

 subnet 192.168.0.0 netmask 255.255.255.0 {
    range dynamic-bootp 192.168.0.190 192.168.0.240;

    option routers 192.168.0.10;
    option subnet-mask 255.255.255.0; 

    option nis-domain "mydomain.com"; 
    option domain-name "mydomain.com"; 
    option domain-name-servers 192.168.0.20; 
    option netbios-name-servers 192.168.0.100; 
    option ntp-servers 192.168.0.25; 
    option smtp-server 192.168.0.35; 
    
    default-lease-time 360000; 
    max-lease-time 259200; 
    } 


 # Client-definitions

 host big-daddy { 
    hardware ethernet 00:a0:d9:cb:94:8a;
    fixed-address 192.168.0.18; 
    }

And before you start the DHCP Server. You must creat a final file to review the allocation of IP Addresses for the Client.

touch /etc/dhcpd.lease

To turn on or turn off DHCP Service. You only run two scripts as belows:

/etc/init.d/dhcpd start
/etc/init.d/dhcpd stop

Không có nhận xét nào:

Đăng nhận xét