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
retain_dhcp_lease_info_after_a_reboot [2023/08/09 15:39] – [Method 2: Copying the lease database to permanent storage at halt time] -clarify Method 2 uses both sets of lines hogwildretain_dhcp_lease_info_after_a_reboot [2023/08/15 18:32] (current) – [Method 2: Copying the lease database to permanent storage at halt time] petervdm
Line 17: Line 17:
   - 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 [[status-devices|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 [[status-devices|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 storage was formatted. This also means you can store the data on other permanent media, like a CIFS share. However, for such configurations, it is not wise to use JFFS. JFFS is not recommended for frequent writes (which in this case, would occur every time a new IP is sent).+  - Notice that the example points to a USB device labelled "usb". You might have a different name on your system, depending on how storage was formatted. This also means you can store the data on other permanent media, like a CIFS share. However, for such configurations, it is not wise to use JFFS. JFFS is not recommended for frequent writes (which in this case, would occur every time a new IP is sent).
  
  
Line 28: Line 28:
 <code -> <code ->
 [ -f /mnt/usb/dnsmasq.leases ] && { [ -f /mnt/usb/dnsmasq.leases ] && {
- sort -b -k 2 -u -z /tmp/var/lib/misc/dnsmasq.leases > /tmp/dnsmasq.tmp1 +sort -b -k 2 -u -z /tmp/var/lib/misc/dnsmasq.leases > /tmp/dnsmasq.tmp1 
- sort -b -k 2 -u -z /mnt/usb/dnsmasq.leases > /tmp/dnsmasq.tmp2 +sort -b -k 2 -u -z /mnt/usb/dnsmasq.leases > /tmp/dnsmasq.tmp2 
- diff -a /tm +diff -a /tmp/dnsmasq.tmp1 /tmp/dnsmasq.tmp2 | grep -E '^>' | sed 's/^>\ //' >> /tmp/var/lib/misc/dnsmasq.leases 
- kill -HUP `ps | grep  +kill -HUP `ps | grep -E [d]nsmasq | awk '{ print $1 }'` 
- rm /tmp/dnsmasq.tmp1 +rm /tmp/dnsmasq.tmp1 
- rm /tmp/dnsmasq.tmp2+rm /tmp/dnsmasq.tmp2 
 +rm -f /mnt/usb/dnsmasq.leases
 } }
 </code> </code>
retain_dhcp_lease_info_after_a_reboot.1691591955.txt.gz · Last modified: 2023/08/09 15:39 by hogwild