Re: Questions about dhcpcd-hooks and IPv6 prefix delegation
Roy Marples
Wed Aug 08 09:10:21 2018
Hi Timo
I'm currently away from a computer until next week. The best answers I can give right now are
1) the order also depends on carrier state. If an interface is down, it won't apply the delegation until it comes back up. This can happen outside of the delegation received being initially applied so there is currently no way of saying that the delegation as a whole is applied.
2) I can work on adding a way to distinguish a delegation changing or renewing when I get back
3) I can add this as well.
On a side note, I don't have the patience to maintain dhcpcd package on Debian so any updates to it there are very much appreciated.
Roy
On 5 August 2018 16:24:46 CEST, Timo Sigurdsson <public_timo.s@xxxxxxxxxxxxxx> wrote:
>Hi,
>
>as I recently moved from a cable based internet connection to a PPPoE
>connection, I also switched from ISC dhcp client to dhcpcd because ISC
>dhcp client won't operate on ppp interfaces.
>
>The transition has been fairly easy, especially since dhcpcd makes
>prefix delegation quite simple compared to ISC dhcp (which will request
>a prefix but leave the delegation part up to you).
>
>Nevertheless, I have a few questions about how to handle things cleanly
>and reliably in hook scripts:
>
>1) I need to restart my firewall whenever prefix delegation is
>completed, i.e. after the last interface has been assigned a subnet of
>the new prefix. Currently, I do that when reason=DELEGATED6 and
>interface matches the last interfaces that I assign a delegated prefix
>to. But I noticed that the order in which the hooks are executed
>doesn't always seem to be the same. Imagine this configuration:
> interface ppp0
> ia_pd 1 enp2s0/1/64 enp3s0/2/64 enp4s0/3/64
>Usually the hooks are called in the order enp2s0 enp3s0 and enp4s0. But
>for some reason, one time hooks on enp4s0 were executed before enp3s0
>even though the order in interface_order was correct (for debugging
>purposes I logged the environment in my hook script upon each call and
>noticed that in the log that the order of execution was different one
>time).
>
>Therefore, I'm looking for a way to reliably execute an action whenever
>the delegation is finished. Is there a good way to achieve this?
>
>2) One of the few things that was nice about ISC's dhcp client was the
>fact that the environment of the hooks not only included the new
>delegated prefix, but it also included the previous prefix. That made
>it easier to distinguish the cases in which the prefix actually changed
>(and was not simply renewed). Since the actions I need to execute only
>need to be executed when a prefix actually changed, I'd like to know
>whether it's possible to get that information in the environment of the
>dhcpcd-hooks. I could of course write the prefix to a lease file and
>compare them upon each invocation, but I was wondering if there is a
>simpler way?
>
>3) In addition, when the hooks are executed with the reason DELEGATED6,
>the environment only contains the subnet prefix which is assigned to
>one of the interfaces configured for delegation but not the full prefix
>which was obtained via DHCPv6. Is there a way to keep that in the
>environment for all delegated interfaces? Again, I can write it to a
>file and read it from there, but if there is a simpler way that doesn't
>require additional files, I'd prefer that.
>
>FYI, I currently use dhcpcd 6.10.1 on Debian Stretch, but I'll package
>the latest release for myself in the next few days if it makes any
>difference.
>
>
>Thanks and regards,
>
>Timo
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
Archive administrator: postmaster@marples.name