Run rtsol(8) when media becomes available to complete IPv6
address configuration and acquire a default route faster,
avoiding the wait for the next periodic Router Advertisement.
This emits a single Router Solicitation only if the interface
has the ACCEPT_RTADV nd6 option enabled, although rtsol(8)
also verifies this itself.
The devd(8) rules for dhclient(8) and rtsol(8) were merged into
auto-ip-addr.conf because devd(8) currently does not reliably
support triggering multiple independent actions for the same
event across separate included configuration files.
If such support becomes available in the future, the rules could
be split into separate configuration files for dhclient(8) and
rtsol(8).
Currently, on FreeBSD, IPv6 SLAAC configuration may be significantly delayed when an Ethernet cable is connected after the system has already booted.
This happens because rtsold(8) does not send a Router Solicitation (RS) message upon link/media state change. As a result, IPv6 autoconfiguration depends entirely on periodic Router Advertisements (RA) sent by routers.
This behavior is longstanding and works correctly when the system boots with the Ethernet cable already connected. However, if the cable is plugged in later, the host must wait until the next unsolicited RA arrives. Depending on router configuration, this delay is typically between 3 and 10 minutes.
Usually, we run:
/usr/sbin/rtsold -a -i
Even though rtsold(8) is running and listening on all interfaces, no RS is transmitted after media connection.
Using the -m option improves the situation somewhat because rtsold(8) periodically sends RS messages every minute. However, this still leaves a random delay of up to one minute before SLAAC completes.
In practice, the problem is less visible on busy networks because other hosts frequently send RS messages, which trigger multicast RA responses from the router and indirectly help the FreeBSD host configure itself sooner.
A possible solution would be similar to the existing devd(8) integration used for triggering dhclient on media change. A small devd(8) script could invoke:
rtsol -i <interface>
when link state changes to UP.
This would immediately send a single RS packet and trigger a prompt RA response from the router, provided the interface has the ACCEPT_RTADV nd6 option enabled.
Such behavior would reduce SLAAC configuration time from a random interval (<0;3> or even <0;10> minutes) to effectively immediate configuration after cable insertion.
Edit:
The proposed devd(8) rule should be harmless on systems that do not use ACCEPT_RTADV. In such cases, rtsol(8) immediately exits with:
rtsol: <interface> does not accept Router Advertisement
and no Router Solicitation packet is transmitted.
Unfortunately, there appears to be a separate limitation or design issue in devd(8). LINK_UP events are effectively hijacked by /etc/devd/dhclient.conf, which prevents multiple independent consumers from reliably reacting to the same media-change event.
If this behavior is unintended, it may indicate a devd(8) bug that should be fixed. If it is intentional behavior, then merely splitting the configuration into multiple devd.conf files is not sufficient isolation, since event handling is still not properly composable between independent services such as dhclient and rtsol.