DHCP (Dynamic Host Configuration Protocol)


Preface

We generally configure the IP address manually, but when there are too many PCs, the task will be very large. Is there any way?

1. What is DHCP?

DHCP (Dynamic Host Configuration Protocol, dynamic host configuration protocol) is usually used in large local area network environments. The main function is to centrally manage and allocate IP addresses, so that hosts in the network environment can dynamically obtain IP addresses, Gateway addresses, and DNS Server address and other information, and can improve the utilization rate of the address. Automatically assign IP addresses to internal networks or network service providers, and to users or internal network administrators as a means of central management of all computers.

Second, the principle and configuration of DHCP

1. The role of DHCP

1. Reduce the workload of the administrator
2. Avoid the possibility of input errors
3. Avoid IP address conflict
4. When changing the IP address segment, there is no need to reconfigure each user's IP address
5. Improve the utilization of IP addresses
6 .Convenient client configuration

2. DHCP principle

DHCP uses UDP as the transport protocol, requesting to port 67 of the DHCP server, and responding to port 68 of the client.

Step 1: The client searches for the server in the network. The client sends a DHCP Discover message by broadcasting to find the server.
Step 2: The server responds to the client with a service. The server sends a DHCP Offer message through unicast to provide network information such as an IP address to the client, and selects an unallocated IP address from the IP address pool to assign to the client.
Step 3: The client sends a service request to the server. If multiple DHCP servers send DHCP-offer messages to the client, the client only accepts the first received DHCP-offer message and extracts the IP address, and then the client broadcasts a DHCP Request message to inform the server The client locally chooses to use the IP address
. Step 4: The server provides services to the client. The server sends a DHCP Ack message through unicast to inform the client that the IP address is legal and usable, and adds the lease information of the IP address in the option field

3.DHCP configuration

Insert picture description here
It is required to assign a reasonable address to PC1PC2.
R1 configuration: Insert picture description here
R2 configuration: Insert picture description here
check.
Insert picture description here
Remember to select the DHCP allocation for the PC2 address, and remember to apply it!

Guess you like

Origin blog.csdn.net/xiwagogogo/article/details/112711361