DHCP (Dynamic Host Configuration Protocol) dynamic host configuration protocol


A protocol for automatically assigning TCP/IP parameters to computers in a TCP/IP network.
Client port number: 67 Server port number: 68

Advantages of DHCP:

  1. Reduce the workload of administrators;
  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;


  1. Automatic allocation: permanent use after allocated to an ip address;
  2. Manual allocation: The ip address is specially formulated by the DHCP server administrator;
  3. Dynamic allocation: release the ip after use, for other clients to use;

Four steps for DHCP to obtain an address:

  1. The client requests an ip address: when a DHCP client is started, the client does not have an ip address, so the client obtains a legal address through DHCP; at this time, the DHCP client sends DHCP Discover discovery information by broadcast to find the DHCP server.
  2. Server response: When the DHCP server receives the information requesting the ip address from the client, it checks whether there is a legal ip address provided to the client in its ip address pool; if so, the DHCP server marks the ip address and adds it To the DHCP Offer message, and then broadcast a DHCP Offer message.
  3. Client selects IP address: The DHCP client extracts the IP address of the DHCP server that issued the IP address from the first DHCP Offer message received, and reserves the server address, so that the changed address cannot be assigned to another DHCP client.
  4. The server determines the lease: After receiving the DHCP Request message, the DHCP server broadcasts a successful confirmation to the client in the form of a DHCP Ack message, which contains the valid lease of the ip address and other configurable information; when the client receives the DHCP Ack message When, configure the ip address to complete the initialization of TCP/IP.

Re-login the
   DHCP client every time you re-login to the network, you do not need to send DHCP Discover information, but directly send the DHCP Request request information containing the ip address assigned last time.
Insert picture description here

Renewal of lease
   When the lease period of the DHCP server to the client and the leased IP address reaches 50%, it needs to renew the lease; the client directly sends a DHCP Request packet to the server that provides the lease, requesting to renew the existing address lease.

DHCP service
   automatically allocate addresses for a large number of clients, provide centralized management;
   reduce management and maintenance costs, and improve network configuration efficiency;

The address information that can be allocated mainly includes:

  1. The IP address and subnet mask of the network card;
  2. Corresponding network address, broadcast address;
  3. Default gateway address;
  4. DNS server address;
  5. Lease term

Guess you like

Origin blog.csdn.net/weixin_49343462/article/details/109377997