[ipxe-devel] iPXE ipv6 autoconf with multiple Router Advertisements
Sven Wiltink
sven.wiltink at nl.team.blue
Wed Aug 28 16:18:42 UTC 2024
Thanks for pointing that out, that would be when there is no slaac but dhcpv6 is used to configure the address.
What if we keep processing RA packets and the only assumption we have is that in the end we must have a
router and an address. If that assumption is generally false we might have to put it behind a feature flag in the config.
I can only think of such a case when only link local address are used for all pxe components.
Different scenarios:
The now common scenario is that an RA packet is from a default router that either pushes slaac or has the M/O flag
to trigger dhcp. The state is marked with 'hasRouter'. If slaac was performed the 'hasAddress' is also set. When
dhcp returns the 'hasAddress' flag can be set if it was stateful (M flag set).
The RA packet is from a default router without the M flag and without a slaac prefix. No IP can be configured using just
this information so we keep processing. We mark the ipv6conf state with 'hasRouter'.
The RA packet is from a non-default router. When slaac is present we mark the ipv6conf state with 'hasAddress'. In case
the O or M flags are set we start dhcp. When the M flag is set dhcp is stateful. Upon stateful dhcp completion we set
the 'hasAddress' flag on the ipv6conf state.
After processing each RA (either directly or after dhcp has completed) we check if both 'hasRouter' and 'hasAddress' are present.
If they are we mark ipv6conf as successful.
Am I missing any more edge cases?
-Sven
On 28/08/2024, 17:03, "Michael Brown" <mcb30 at ipxe.org <mailto:mcb30 at ipxe.org>> wrote:
On 28/08/2024 16:29, Sven Wiltink wrote:
> Thanks for the quick response. I think it can be well defined when ipv6 conf
> has been completed, but I'm lacking the C programming skills to implement it.
>
> We should be able to define ipv6conf as finished when the following statements are true:
> 1) an RA has been received that pushed a prefix with slaac enabled
> 2) an RA has been received that advertises itself as default router (lifetime > 0)
>
> Once both are true, which can be achieved by the same packet, within the autoconf timeout we are done.
> There is a problem however, the RA packet could trigger dhcpv6 if the O flag is set. In that case
> autoconf is currently terminated when dhcp6 finished. In the new situation that isn't always true as dhcp6
> could still be running before the other RA packet arrives. To prevent this both the processing of the RA
> packets and the ending of dhcp6 should check if all the other parts of autoconf have been completed.
> This means we could define it as finished when:
>
> 1) an RA has been received that pushed a prefix with slaac enabled
> 2) an RA has been received that advertises itself as default router (lifetime > 0)
> 3) dhcpv6 was triggered and completed successfully
>
> I'm not sure how this would work in the code or where to add the state, would like to hear
> your thoughts.
It looks as though you are conceptualising those as AND conditions.
Unfortunately, it's entirely possible that the network is configured
without any SLAAC-enabled prefixes, so your suggested conditions would
cause ipv6conf to never terminate on those networks.
Looking forward to your v2 idea. :)
Thanks,
Michael
More information about the ipxe-devel
mailing list