Site Tools


retain_dhcp_lease_info_after_a_reboot

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
retain_dhcp_lease_info_after_a_reboot [2023/05/24 03:23] – clarity, formatting hogwildretain_dhcp_lease_info_after_a_reboot [2023/06/08 06:30] – [Method 1: Store the lease database on permanent storage] hogwild
Line 3: Line 3:
 By default, dnsmasq stores DHCP lease data in (volatile) RAM. This means that operations such as a reboot will erase the lease database, forcing a new one to be created. This could be inconvenient, since client devices might receive a new IP address after DHCP renewal. For dnsmasq to maintain its DHCP lease information, the router needs persistent storage, (such as USB). By default, dnsmasq stores DHCP lease data in (volatile) RAM. This means that operations such as a reboot will erase the lease database, forcing a new one to be created. This could be inconvenient, since client devices might receive a new IP address after DHCP renewal. For dnsmasq to maintain its DHCP lease information, the router needs persistent storage, (such as USB).
  
-There are currently two approaches to dealing with this.+There are currently two common methods for dealing with this. 
  
 ===== Method 1: Store the lease database on permanent storage ===== ===== Method 1: Store the lease database on permanent storage =====
Line 11: Line 12:
  \\  \\
  
-  - Under Advanced, go to to [[:advanced-dhcpdns|DHCP/DNS]] menu. In the //Dnsmasq Custom configuration// field, enter: \\ <code ->+  - Under Advanced, go to to [[:advanced-dhcpdns|DHCP/DNS]] menu. In the //Dnsmasq Custom configuration// field, enter: \\ \\ <code ->
 dhcp-leasefile=/mnt/usb/dnsmasq/dnsmasq.leases dhcp-leasefile=/mnt/usb/dnsmasq/dnsmasq.leases
-</code> +</code> \\  
-  - +  - Use a path relative to your own system.  Click Save. \\ \\  
-  - Use a path relative to your own system.  Click Save. \\  +  - Using permanent storage means client devices won't lose connectivity if the router reboots. Because the lease database is not stored in RAM, a reboot won't erase it. This can be useful, for example, when devices are connected to a switch. Moreover, clients won't display in the [[device_list|Device List]] as having an active lease until their current lease expires, and they've requested a new one. FreshTomato will just continue where if left off. \\ \\  
-  - Using permanent storage means client devices won't lose connectivity if the router reboots. Because the lease database is not stored in RAM, a reboot won't erase it. This can be useful, for example, when devices are connected to a switch. Moreover, clients won't display in the [[device_list|Device List]] as having an active lease until their current lease expires, and they've requested a new one. FreshTomato will just continue where if left off. \\  +
   - You will notice that the example points to a USB device labelled "usb". You might have a different name on your system, depending on how the storage was formatted. This also means you can store the data on other permanent storage media, such as a CIFS share. However, for such configurations, it is not wise to use JFFS. This is because JFFS is not recommended for frequent writes (which in this case, would occur every time a new IP is sent).   - You will notice that the example points to a USB device labelled "usb". You might have a different name on your system, depending on how the storage was formatted. This also means you can store the data on other permanent storage media, such as a CIFS share. However, for such configurations, it is not wise to use JFFS. This is because JFFS is not recommended for frequent writes (which in this case, would occur every time a new IP is sent).
 +
  
 ===== Method 2: Copying the lease database to permanent storage at halt time ===== ===== Method 2: Copying the lease database to permanent storage at halt time =====
retain_dhcp_lease_info_after_a_reboot.txt · Last modified: 2023/08/15 18:32 by petervdm