Linux DHCP server configuration and Setup

Source: Internet
Author: User

DHCP server configuration

One, what DHCP

The DHCP (dynmaic Host configuration Protocol) server is used to provide network configuration information so that the DHCP guest in the network

The system can dynamically receive the network parameter information and automatically realize the network configuration of the system. Such a computer contractors a DHCP client system. Run

DHCP server software, a host that provides network configuration information such as IP addresses, subnet masks, and DNS is called a DHCP server.

Second, the characteristics of DHCP

The client system uses the DHCP protocol to obtain the IP address and other network parameters, the implementation of TCP/IP network automatic configuration, whenever re-

When the TCP/IP protocol is initialized, the client system attempts to communicate with the DHCP server in the network and requests that a new configuration parameter be assigned

Number, or dice can continue to use the previously assigned parameter settings.

The communication between the DHCP client system and the server uses the UDP protocol, and the client system sends the request packet number to UDP port 68 of the server

The server sends the corresponding packet data to the UDP port 67 of the client system. If any server cannot be contacted, the customer system can continue to make

With the previously assigned network parameter settings until the lease time period previously negotiated by the customer system expires, after the lease expires, or the customer system

The initialization of the TCP/IP protocol will fail and the TCP/IP communication cannot be implemented without obtaining any configuration parameters before.

Third, the work flow of DHCP

DHCP dynamic address assignment can be done in four steps: Lease request, parameter provision, host selection, lease confirmation

1. Rental Request

During the client system startup or restart process, the DHCP client software will use 255.255.255.255 as the IP address on the local network

Broadcast a DHCPDISCOVER packet data, which contains its own hardware MAC address, the requested IP address, and the lease time and other letters

Interest.

2. Parameters provided

During the negotiation process of DHCP, the client system can receive DHCPOFFER packet data from multiple servers. Upon receiving

DHCPDISCOVER packet data, in response, each server will use the MAC address as the destination object, depending on which

Network interface and subnet, send a DHCPOFFER packet to the client system, which contains the server pre-allocated or

The IP address, subnet mask, DNS, lease duration, and other network configuration parameters that are selected in the available address pools for use by the customer system. This

, the server temporarily retains the IP address that was just assigned to prevent the client system from being reassigned before it is confirmed.

3. Host Selection

Once the DHCPOFFER packet data is received, the system will select the most appropriate IP address (usually taken from the first arriving

Group data) as its own configuration parameters, and then broadcast a DHCPREQUEST packet data that contains the selected DHCP service

To inform the server of the configuration parameters it provides, as well as to notify other servers to deny

Configure the parameters to release the temporary reserved IP address. If no DHCPOFFER packet data is received from any server, the customer system will

Generates an error message, and then sends the new DHCPDISCOVER packet data again, restarting the new round of negotiation processes.

4. Rental Confirmation

When the server receives DHCPREQUEST packet data, indicating that its provided configuration parameters have been received, the server will temporarily reserve

Hardware MAC address of the client system, address assignment time, and lease cycle, and then

The user system replies to a Dhcppack packet data. If the server can no longer provide previously assigned network configuration parameters, the server will return

User system A DHCPNACK packet data, terminate the negotiation process, forcing the customer system to send a dhcpdiscover group again

Data, restart a new round of negotiation process. After receiving the DHCPACK packet data, the customer system will be based on the IP address provided by the server,

Using the ARP protocol, the final address reuse detection is performed to ensure that the host in the network does not use the same address. If the IP is validated after testing

Address is available, the client system will use the configuration information provided by the server to set the IP address of its own network interface, DNS server and other network parameters

End the entire negotiation process and continue booting until the system is ready to start. If the IP address provided by the server is not available, the customer

The system will send a DHCPDECLINE packet data to the server, then delay for 10 seconds and send a dhcpdiscover number of packets again

To start a new round of consultation process.

Third, the purpose of DHCP design

1.DHCP should be a mechanism rather than a policy, it must allow local system administrators to control configuration parameters, and local system administrators should

Be able to manage the resources that you want to manage effectively.

2. The client does not need to be manually configured, but should not participate in the case to find the appropriate and local machine configuration parameters, and take advantage of these parameters

Be configured.

3. There is no need to configure a network for a single client, and under normal circumstances, the network administrator does not enter any pre-designed user

The parameter is reset.

4.DHCP do not need to configure a server for each subnet, for economic reasons, the DHCP server must be able to and the router or

The BOOTP forwarding agent works together.

5.DHCP clients must be able to respond to servers provided by multiple DHCP servers, for network stability and full consideration, and sometimes

You need to add more than one DHCP server to your network.

The 6.DHCP must be statically configured and must be implemented with existing network protocols.

7.DHCP must be able to interoperate with BOOTP forwarding agents.

8.DHCP must be able to provide services to existing BOOTP clients.

9. Multiple clients are not allowed to use one network address at a time

10. After the DHCP client restarts, it remains able to retain its original configuration parameters and, if possible, the client should be designated as the same

Configuration parameters.

11. After the DHCP server restarts, the client's configuration parameters can still be retained if possible, even if the DHCP mechanism restarts, you should

It is possible to assign the original configuration parameters to the client.

12. Ability to automatically provide configuration parameters for newly added clients.

Iv. Installing and starting the DHCP server

650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M01/77/D7/wKioL1Zvl7zxO1XcAAGKD1O0OXQ434.jpg "title=" 1.jpg " alt= "Wkiol1zvl7zxo1xcaagkd1o0oxq434.jpg"/>

as a DHCP server, you must use a static IP address, so before starting the DHCP server, you need to configure the system's network parameters to set the static IP address. When the server has DHCP service installed, the configuration file in/etc/dhcp/dhcpd.conf is empty. We need to create or copy a configuration file.

650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M02/77/D7/wKioL1ZvnHijGfVhAACDcErJ6ls228.jpg "title=" 1.jpg " alt= "Wkiol1zvnhijgfvhaacdcerj6ls228.jpg"/>





This article from the "10989640" blog, reproduced please contact the author!

Linux DHCP server configuration and Setup

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.