This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
retain_dhcp_lease_info_after_a_reboot [2023/05/24 02:31] – hogwild | retain_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 1: | Line 1: | ||
====== Retain DHCP Lease Information after a Reboot ====== | ====== Retain DHCP Lease Information after a Reboot ====== | ||
- | By default, dnsmasq stores DHCP lease information | + | By default, dnsmasq stores DHCP lease data in (volatile) |
- | There are currently two options to resolve | + | There are currently two common methods for dealing with this. |
- | - Navigate to [[: | ||
- | dhcp-leasefile=/ | ||
- | </ | ||
- | Use a path relative to your own system. | + | ===== Method 1: Store the lease database on permanent storage ===== |
- | The idea is essentially | + | The first method does not use scripting. The goal of the first method |
\\ | \\ | ||
- | 2) A different approach is to keep the lease database in its default location and copy it to permanent storage at " | + | - Under Advanced, go to the [[advanced-dhcpdns|DHCP/ |
+ | dhcp-leasefile=/ | ||
+ | </ | ||
+ | - Use a path relative to your own system. | ||
+ | - Using permanent storage means client devices won't lose connectivity if the router reboots. Because | ||
+ | - Notice that the example points to a USB device labelled | ||
- | Administration/ | + | |
+ | ===== Method 2: Copying the lease database to permanent storage at halt time ===== | ||
+ | |||
+ | \\ The second approach is to keep the lease database in its default location and copy it to permanent storage at " | ||
+ | |||
+ | \\ \\ For example, in the Init field in the [[admin-scripts|Scripts]] menu, enter:\\ | ||
<code -> | <code -> | ||
[ -f / | [ -f / | ||
- | sort -b -k 2 -u -z / | + | sort -b -k 2 -u -z / |
- | sort -b -k 2 -u -z / | + | sort -b -k 2 -u -z / |
- | diff -a /tm | + | diff -a /tmp/ |
- | kill -HUP `ps | grep | + | kill -HUP `ps | grep -E [d]nsmasq | awk '{ print $1 }'` |
- | rm / | + | rm / |
- | rm / | + | rm / |
+ | rm -f / | ||
} | } | ||
</ | </ | ||
- | Administration/Scripts/Halt\\ | + | \\ |
+ | |||
+ | \\ | ||
+ | |||
+ | in the //Halt// field In the [[admin-scripts|Scripts]] menu, enter:\\ | ||
<code -> | <code -> | ||
Line 36: | Line 48: | ||
</ | </ | ||
- | This method | + | \\ |
+ | |||
+ | \\ | ||
+ | |||
+ | Method | ||
+ | |||
+ | \\ | ||
+ | |||
+ | \\ | ||