Re: Selecting a "better" offer from two DHCP servers
Shahid Mahmood
Thu Jun 16 20:28:34 2016
Back to this question again ...
Recap: Two dhcp servers, one sending offer with preferred option, other
without.
If within 1 second of sending discover, two leases were received, then pick
the one with preferred option.
If 1 second has elapsed and no lease with preferred option seen, then just
pick the other one without the preferred option.
(1 sec can be changed to upto 5)
Here is my idea how to implement this:
1. Start dhcpcd with -Q vendor_option -t10
(Hook scripts dump option and variables in a file, say
/tmp/dhcp/dhcpcd_data)
2. Monitor /tmp/dhcp/ for activity (using inotify)
3. *Somehow detect* 2 lease situation, e.g a lease was offered but
rejected, or timeout has occurred, and if so, restart dhcpcd without -Q and
-t (settle on non-preferred lease)
4. Of course, if a lease with vendor_option was received, accept it and
continue normal life.
Q:
Is this good approach?
If so, how can I do step 3? ie detect events such as timeout, reject or
offer received?
If not, is there a better way to do this? e.g is -T worth considering?
Thanks!
-shahid
Archive administrator: postmaster@marples.name