Linux DHCP server configuration (1)

Source: Internet
Author: User

DHCP Overview
1. necessity of using DHCP
In TCP/IP networks, before each workstation can access resources on the network, basic network configurations must be performed. Some main parameters, such as IP addresses, subnet masks, and default gateways, DNS is essential, and some additional information, such as IP management policies, may be required. For a slightly larger network, the task of network management and maintenance is rather heavy. If a computer is transferred from one subnet to another, you need to reconfigure the system. It is not necessary for normal level workstation users to grant them the permissions to configure their workstation network. If a user who does not have the corresponding technical level mistakenly changes the network configuration of the workstation out of curiosity or want to learn, resulting in a network failure, the consequences are self-evident. Therefore, a mechanism is required to transfer TCP/IP configuration and management from the user end to the network management end to implement centralized IP management. The solution is to use DHCP.
2 main DHCP Functions
The full name of DHCP is the Dynamic Host Configuration Protocol (Dynamic Host Configuration Protocol), designed by the IETFInternet network engineer Task Team). The detailed Protocol content is included in RFC documents rfc2131 and rfc1541. The objective is to reduce the planning, management, and maintenance burden of TCP/IP networks and solve the problem of insufficient IP address space. The server running DHCP sets up the TCP/IP network and dynamically processes the IP Address Configuration of the workstation. The DHCP lease is associated with the preset IP address, the DHCP lease provides a mechanism to automatically and securely allocate and lease IP addresses on TCP/IP networks to achieve centralized IP address management without human intervention from network administrators. In addition, DHCP itself is designed as a BOOTP self-lifting protocol) extension. It supports diskless workstations that require network configuration information and provides corresponding support for systems that require fixed IP addresses.
How DHCP works
DHCP terms
Before introducing the working principle of DHCP, explain the meanings of these terms:
DHCP Client: An Internet host that obtains network configuration parameters through DHCP, usually the workstation of a common user.
DHCP server: the DHCP server provides network setting parameters to the DHCP Client's Internet host.
DHCP/BOOTP relay Proxy: the host or router that forwards DHCP messages between the DHCP client and the server.
DHCP is designed based on the client/server model. DHCP clients and DHCP servers send and receive DHCP messages for communication.
DHCP Message format:


The format of DHCP messages is the same as that of BOOTP messages. This design enhances the BOOTP server tool and serves both BOOTP and DHCP. In addition, the BOOTP relay proxy can forward DHCP requests across subnets.
The sections are described as follows:
The numbers in the brackets indicate the size of this segment in 8-bit groups. Except for options, the lengths of other segments are fixed, the length of the options segment must be at least 312 8-bit groups.
For example, op1) indicates that the length of this segment is an 8-bit group.
Op is the message operation code. If the value is 1, it indicates the BOOTREQUEST user-initiated request. If the value is 2, it indicates the BOOTREPLY user-initiated response)
During the dialogue between the DHCP client and the DHCP server, the op segment is set as BOOTREQUEST (1) by the DHCP Client and BOOTREPLY (2) by the DHCP server ).
Htype is a hardware address type.
Hlen is the hardware address length.
The hops DHCP Client sets this item to zero, and the relay proxy needs to use
A random number generated by the xid DHCP client upon request. It provides a combination of client requests and server responses in all subsequent DHCP messages.
The ciaddr client is used to request a specific IP address, which was previously assigned to the client and is expected to be retained.
Yiaddr is filled in by the DHCP server, including the IP address it provides to a DHCP client.
Host address of the siaddr Server
IP address of the giaddr relay proxy
Chaddr DHCP client hardware address
Sname server host name
File Startup file Name
Options
Before obtaining an IP address, the DHCP client uses the htype, hlen, and chaddr segments to indicate its hardware address. This value is used by the server and relay proxy that responds to the customer's hardware address. Two unused 8-bit flags in the BOOTP protocol are defined in the DHCP message. The high bit of this segment is used to indicate whether the client can receive the Unicast response before the IP address is configured. The remaining low bit is retained and must be set to zero. The hops and secs segments are selectively used by the relay agent during initialization. The sname and file fields can be used by BOOTP or diskless websites.
Options
After the option is attached to a fixed length segment of the DHCP message, to be compatible with the BOOTP tool, the first four eight-bit groups of the Option segment contain
The magic cookies defined in RFC1497, the remaining segments are DHCP options. All DHCP options are defined in RFC1533.
Format. Most options are used to indicate network transmission settings, such as Subnet mask (mask), DNS server address, etc.
This option is used by the DHCP protocol and is required in most messages.


Related Article

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.