Linux applications: Installation and troubleshooting of DHCP servers (1)

Source: Internet
Author: User

How DHCP servers work

Key points of this Chapter

The working principle of the DHCP (Dynamic Host Configuration Protocol) server.

Install the DHCP server.

Troubleshooting of DHCP servers.

DHCP is used to automatically provide IP addresses, subnet masks, and route information for computers. Network administrators usually assign IP addresses in a certain range to distribute the IP addresses to clients on the LAN. When devices access the LAN, they request an IP address from the DHCP server. The DHCP server then assigns an address to each requested device until all IP addresses in the specified range are allocated. The allocated IP address must be regularly extended for the borrow period. This extension process is called "leasing ", make sure that the IP address allocated when the client device suddenly disconnects from the network before the IP address is released normally can be returned to the server. This chapter uses RHEL 5.0 as an example to describe how to create a complete and secure DHCP server.

8.1 how DHCP servers work

8.1.1 DHCP Overview

The predecessor of DHCP is BOOTP, which works at the OSI Application layer. It is a self-raising protocol that helps computers obtain configuration information from a specified DHCP server. DHCP uses the Client/Server mode. The computer requesting configuration information is called the DHCP client, and the information provided is called the DHCP server ". DHCP can assign addresses to clients by means of manual configuration, automatic configuration, and dynamic configuration. The most important function of DHCP is dynamic allocation. In addition to IP addresses, DHCP also provides other configuration information for the client, such as the subnet mask, so that the client can automatically configure and connect to the network without manual intervention.

8.1.2 why DHCP is used

DHCP is useful for sending customer network configurations quickly. When configuring the client system, if the administrator chooses DHCP, you do not need to enter an IP address, subnet mask, gateway, or DNS server, the client retrieves the information from the DHCP server. DHCP is also useful when the network administrator wants to change a large number of system IP addresses. Instead of reconfiguration all systems, it is better to edit a DHCP configuration file on the server for the new IP address set. If the DNS server of an organization changes, this change only needs to be performed on the DHCP server, rather than on the DHCP client. Once the client network is restarted (or the client restarts the system), the change takes effect. In addition, if DHCP is configured for a portable computer or any type of removable computer, as long as each office has a DHCP server that allows it to connect to the Internet, it can be freely moved between offices without reconfiguration.

8.1.3 DHCP workflow

1. discovery phase

That is, the DHCP client finds the DHCP server stage. The client sends DHCP discover information in broadcast mode (because the IP address of the DHCP server is unknown to the client) to find the DHCP server, that is, sends specific broadcast information to the IP address 255.255.255.255. Each host installed with TCP/IP on the network will receive such broadcast information, but only the DHCP server will respond.

2. Provision phase

That is, when the DHCP server provides an IP address, the DHCP server that receives the DHCP discover information in the network will respond. It selects an IP address allocated to the DHCP client from the IP address that has not been rented, and sends a DHCP offer information containing the IP address for rent and other settings to it.

3. Select phase

That is, the DHCP Client selects the IP address provided by a DHCP server. If Multiple DHCP servers send DHCP offer information to the DHCP client, the DHCP client accepts only 1st received DHCP offer information. Then, it answers a DHCP request message in broadcast mode, which contains the content of requesting IP addresses from the selected DHCP server. The answer is broadcast to notify all DHCP servers that the IP address provided by a DHCP server is selected.

4. validation phase

That is, the DHCP server confirms the stage of the provided IP address. When the DHCP server receives the DHCP request information from the DHCP client, it sends a dhcp ack message containing the IP address and other settings to the DHCP client, the DHCP client can use this IP address, and then the DHCP client binds its TCP/IP address to the NIC. In addition, all other DHCP servers except the server selected by the DHCP client will reclaim the previously provided IP address.

5. Log On again

In the future, when the DHCP Client re-logs on to the network, it does not need to send DHCP discover information, but directly sends the DHCP request information containing the previous IP address. When the DHCP server receives this information, it will attempt to allow the DHCP client to continue using the original IP address and answer a dhcp ack message. If the IP address cannot be assigned to the original DHCP Client (such IP address has been assigned to another DHCP client), the DHCP server returns a dhcp nack message to the DHCP client. When the original DHCP client receives this information, it must resend the DHCP discover information to request a new IP address.

6. Update the lease

The IP address rented by the DHCP server to the DHCP Client generally has a lease term. After the lease term expires, the DHCP server will reclaim the IP address. If a DHCP Client wants to extend its IP lease, it must update its IP lease. When the DHCP Client is started and half of the IP Lease Term expires, the DHCP Client automatically sends an update message to the DHCP server.

DHCP design goals

8.1.4 DHCP design objectives

DHCP is designed as follows.

(1) DHCP should be a mechanism rather than a policy. It must allow the local system administrator to control the configuration parameters. The local system administrator should be able to effectively manage the resources to be managed.

(2) the client does not need to be manually configured, but should discover configuration parameters suitable for the local machine without participation, and use these parameters to configure.


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.