This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
retain_dhcp_lease_info_after_a_reboot [2023/02/07 16:57] – rs232 | retain_dhcp_lease_info_after_a_reboot [2023/08/09 15:41] – [Method 1: Store the lease database on permanent storage] -condense hogwild | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Retain DHCP Lease Information after a Reboot ====== | ====== Retain DHCP Lease Information after a Reboot ====== | ||
- | By default dnsmasq | + | By default, dnsmasq |
- | 1) This isn't a scripting method/ | + | There are currently two common methods |
- | Navigate to [[: | ||
- | <code -> | + | ===== Method 1: Store the lease database on permanent storage ===== |
+ | |||
+ | The first method does not use scripting. The goal of the first method is to store the lease database on permanent storage. | ||
+ | |||
+ | \\ | ||
+ | |||
+ | - Under Advanced, go to the [[advanced-dhcpdns|DHCP/ | ||
dhcp-leasefile=/ | 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 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' | ||
+ | - Notice that the example points to a USB device labelled " | ||
- | Use a path relative to your own system. | ||
- | The idea is essentially to store the lease database | + | ===== Method 2: Copying |
- | \\ | + | \\ The second approach is to keep the lease database in its default location and copy it to permanent storage at " |
- | 2) A different approach is to keep the lease database | + | \\ \\ For example, |
- | Administration/ | + | <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 / | ||
Line 27: | Line 34: | ||
rm / | rm / | ||
rm / | rm / | ||
- | }</ | + | } |
+ | </ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | in the //Halt// field In the [[admin-scripts|Scripts]] menu, enter:\\ | ||
+ | |||
+ | <code -> | ||
+ | cp -f / | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | Method 2 can be used with any type of storage, including JFFS. When using method 2 only with USB, an alternative is to enter the former set of configuration lines into the //Run after mounting// field and the latter set of lines in the //Run before unmounting// | ||
+ | |||
+ | \\ | ||
+ | |||
+ | \\ | ||
- | Administration/ | ||
- | <code ->cp -f / | ||
- | This method 2) can be used with any storage, JFFS included, where for USB (only) an alternative is to performed the save/copy within the '' |