[Bug 3553] Retain lease information for udhcpc across restarts
bugzilla at busybox.net
bugzilla at busybox.net
Tue Apr 12 23:46:48 UTC 2011
https://bugs.busybox.net/show_bug.cgi?id=3553
--- Comment #6 from Denys Vlasenko <vda.linux at googlemail.com> ---
(In reply to comment #3)
> To be clear, I'll quote the ISC dhclient man page, which already has this
> functionality:
>
> In order to keep track of leases across system reboots and server
> restarts, dhclient keeps a list of leases it has been assigned in the
> dhclient.leases(5) file. On startup, after reading the dhclient.conf
> file, dhclient reads the dhclient.leases file to refresh its memory
> about what leases it has been assigned.
>
> When a new lease is acquired, it is appended to the end of the
> dhclient.leases file. In order to prevent the file from becoming
> arbitrarily large, from time to time dhclient creates a new
> dhclient.leases file from its in-core lease database. The old version
> of the dhclient.leases file is retained under the name dhclient.leases~
> until the next time dhclient rewrites the database.
>
> Old leases are kept around in case the DHCP server is unavailable when
> dhclient is first invoked (generally during the initial system boot
> process). In that event, old leases from the dhclient.leases file
> which have not yet expired are tested, and if they are determined to be
> valid, they are used until either they expire or the DHCP server
> becomes available.
>
> A mobile host which may sometimes need to access a network on which no
> DHCP server exists may be preloaded with a lease for a fixed address on
> that network. When all attempts to contact a DHCP server have failed,
> dhclient will try to validate the static lease, and if it succeeds,
> will use that lease until it is restarted.
>
> A mobile host may also travel to some networks on which DHCP is not
> available but BOOTP is. In that case, it may be advantageous to
> arrange with the network administrator for an entry on the BOOTP data‐
> base, so that the host can boot quickly on that network rather than
> cycling through the list of old leases.
>
> So what I'm talking about is the ability to statically maintain (and reuse)
> unexpired leases across reboots.
I see. I think this functionality can be implemented by dhcp script:
> When a new lease is acquired, it is appended to the end of the
> dhclient.leases file...
This can be implemented when "$script bound" is called, by recording values of
$ip, $lease etc.
> Old leases are kept around in case the DHCP server is unavailable when
> dhclient is first invoked (generally during the initial system boot
> process). In that event, old leases from the dhclient.leases file
> which have not yet expired are tested, and if they are determined to be
> valid, they are used...
This can be implemented when "$script leasefail" is called, by analyzing
previously-recorded lease(s), and activating it.
> A mobile host which may sometimes need to access a network on which no
> DHCP server exists may be preloaded with a lease for a fixed address on
> that network. When all attempts to contact a DHCP server have failed,
> dhclient will try to validate the static lease, and if it succeeds
Also can be implemented by script's "leasefail" handler.
--
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the busybox-cvs
mailing list