Problem: Many users in the use of the router's DHCP server process has a question, DHCP has a setup project is to set the DHCP address lease time, if the set is relatively short, whether the lease time will come back to obtain the IP address, causing the user to disconnect the network? Today, let's introduce the working principle of DHCP on lease time in this issue.
How DHCP lease time works:
Once the DHCP client has successfully obtained a DHCP lease from the server, it will not need to send DHCPdiscover information unless its lease has been invalidated and the IP address is reset back to 0.0.0.0, instead of using the leased IP address directly to the previous The DHCP server sends out DHCPrequest information, the DHCP server will try to let the client use the original IP address, if no problem, the direct response to DHCPack to confirm. If the address has expired or has already been used by another machine, the server responds to a DHCPNACK packet to the client requesting it to execute the DHCPdiscover from the new one.
As for the IP lease term is very elegant, not as simple as we rent a house, with NT as an example: the DHCP workstation in addition to the time when the DHCPrequest request, in the lease period is half of the time will be issued DHCPrequest, if not at this time DHCP server, the workstation can continue to use the IP, and when the lease period is over 87.5%, if the client is still unable to contact the original DHCP server, it will communicate with other DHCP servers. If no DHCP protocol server is running on the network, the client must stop using that IP address and start by sending a DHCPDISCOVER packet, repeating the entire process again. If you wish to refund, you can send out the dhcprelease order at any time, even if your lease was received one second ago.
DHCP operation across networks from the process described earlier, it is not difficult to see that the DHCPDISCOVER is broadcast, and that the situation can only be carried out within the same network, because router will not transmit the broadcast. But what if the DHCP server is installed on a different network? Because the DHCP client does not have the IP environment setting, so do not know the Router address, and some Router will not pass the DHCP broadcast packets out, so in this case DHCPDISCOVER is never able to reach the end of the DHCP server, of course, will not happen. And it moves. To solve this problem, we can use the dhcpagent (or Dhcpproxy) host to take over the client's DHCP request, pass the request to the real DHCP server, and then pass the server's reply to the client. Here, the Proxy host must have its own routing capability, and the two sides of the packet can be transmitted to each other.
If you do not use proxy, you can also install a DHCP server in each network, but in this case, the cost of equipment will increase, and management is also more decentralized. Of course, if you are in a very large network, such a balanced architecture is desirable. Depends on your actual situation.
How DHCP Lease time works