Re: Questions about dhcpcd-hooks and IPv6 prefix delegation
Timo Sigurdsson
Wed Aug 29 21:39:31 2018
Hi Roy,
thanks for your answer and sorry for my silence. I was travelling for a while.
Nevertheless, you're reply clarified a few things for me.
Roy Marples schrieb am 14.08.2018 21:15:
> dhcpcd doesn't really do anything different from dhclient.
> The old prefix delegation is available in the BOUND6 event as well as
> the RENEW6 and REBIND6 events.
I see. In this case the absence of the old prefix is specific to my new
provider. My previous cable provider's DHCP server reported the old
prefix, too, but my new DSL provider apparently doesn't. Ok, then.
> The numbers - ia_pd_1_prefix1 - represent the index of the pd within the
> message. If the server re-arranges the message for laughs, dhcpcd will
> report different numbers here. That probably won't happen, but it's
> worth noting.
I see. So far it's always been the same variable for me, but it's certainly
a notable "gotcha" if you decide to distribute my script as an example.
> I suspect your current approach of just using the BOUND6, RENEW6 and
> REBIND6 events is the best solution. [...] Neither would I use the
> DELEGATED6 event because that could cause a lot of DNS updates.
Playing around with this setup a bit more, I realized I need to make
this a tad more complex and involve the DELEGATED6 event as well. You
are right about interfaces coming and going. Not that I have virtual
or other dynamic interfaces, but I noticed one time when I had
disconnected a switch that is usually connected to one of the interfaces
that get a subnet assigned to that it was skipped during the BOUND6 event
and a subnet address was only assigned much later after I hooked up the
switch again. Now, for my DNS configuration this wouldn't be a problem.
But my firewall needs to be made aware of that change, so I need to cover
this corner case as well.
Therefore, I decided to stick to my current approach of trying to handle
everything during the BOUND6, RENEW6 and REBIND6 events, but also write
a state file for each interface at that point if they are up and have an
address assigned. This way, I can perform a check during the DELEGATED6
event and if the state file for the interface is missing or has an old
address in it, I know that this particular interface wasn't up/ready when
the lease was obtained and that I need to perform a reload of the firewall
again. During normal operation, this case shouldn't happen, but if an
interface was down for some reason before, then this case covered as well.
> If you do get this working, would you mind sharing the script? I might
> consider adding it as an example to the distribution.
Sure. I'll make some more adjustments the next few days and then I can
send you the script and you can see if it's useful for a wider audience
or not.
Best regards,
Timo
Archive administrator: postmaster@marples.name