Changing the IP address lease time

An IP address is assigned to a computer from the router's DHCP server not for permanent use but for a specific period of time. This is called the lease time of an IP address. When the lease time expires, the IP address is again considered free, and the client must request a new one (it can, however, be the same one).

In KeeneticOS, the default DHCP lease time for home and guest networks is set to 25200 sec (7 hours). This is the amount of time allocated for IP leasing.

When 50% of the lease period has passed, the client will attempt to renew the lease or update the IP address information.

lease_7hours.png

You can set the IP lease time in the router's web interface. This setting is located on the 'Home segment' page in the 'IP settings' section. To change the parameters of an existing home network segment in the 'IP settings' section, click 'Show DHCP settings' and set the required value in seconds in the 'Lease time' field.

lease_time_setting.png

Here is an example of setting a lease period of an IP address assigned automatically by the DHCP server of the Keenetic router, and its renewal.

For example, let's set the IP address lease time for the main home network to 60 seconds (we purposely set such a short time in our example to show how the IP address lease mechanism works). Generally, the recommended time to lease an IP address is 48 hours (172800 seconds) to renew the IP address once a day.

lease_time_changing.png

After applying the specified parameters, clients will receive an IP address for 1 minute, after which they will send a request to the DHCP server for a new IP address every 30 seconds. To update the IP lease timer, disconnect and reconnect the network adapter (or disconnect the Ethernet cable from the computer for a few seconds and then reconnect it).

lease_1min.png

This mechanism is clearly visible from the network packet dump collected on the DHCP client side. On the screenshot below, you can see that after 30 seconds there is a request to update the IP address.

You can also set the IP address lease time with a special command through the command-line interface (CLI) of the router:

ip dhcp pool _WEBADMIN lease xxx 


where xxx is the time in seconds. The maximum value of IP address lease in KeeneticOS is 259200 seconds (72 hours, 3 days).

To save the settings to the non-volatile memory of the router, run the command.

system configuration save

 

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.