Bug #16870
openOPT interfaces with "Track Interface" IPv6 not included in dhcp6c.conf on boot
0%
Description
Environment:
pfSense CE 2.8.1-RELEASE
WAN: PPPoE with DHCPv6 prefix delegation (/56)
LAN (igc1): Track Interface, Prefix ID 0 — working
OPT1/DIRECT (igc2): Track Interface, Prefix ID 1 — not working after boot
Bug description:
When pfSense boots, OPT interfaces configured with "Track Interface" for IPv6 are not included in /var/etc/dhcp6c.conf , even though the configuration in config.xml is correct.
The config.xml for OPT1 correctly contains:
<ipaddrv6>track6</ipaddrv6>
<track6-interface>wan</track6-interface>
<track6-prefix-id>1</track6-prefix-id>
However, the generated dhcp6c.conf only includes the LAN interface:
prefix-interface igc1 {
sla-id 0;
sla-len 8;
};
OPT1 (igc2) is missing entirely.
Root cause analysis:
The function interface_dhcpv6_configure() is triggered when the WAN comes up during boot. It calls link_interface_to_track6() to build the list of interfaces to include in dhcp6c.conf. This function iterates over all interfaces and checks:
if (!empty($ifcfg['ipaddrv6']) && $ifcfg['track6-interface'] == $int)
The likely cause is a race condition: OPT interfaces are not fully initialized when the WAN comes up, so they are either not yet present or not passing the condition at that moment. The LAN interface works because it is initialized earlier in the boot sequence.
Workaround:
Manually calling interface_dhcpv6_configure() via PHP after boot resolves the issue:
php -r "require_once('interfaces.inc'); interface_dhcpv6_configure('wan', config_get_path('interfaces/wan'));"
After running this and restarting dhcp6c, the dhcp6c.conf correctly includes both interfaces and OPT1 receives its IPv6 prefix from the delegated /56 block.
Expected behavior:
All interfaces configured with "Track Interface" and a valid track6-prefix-id should be included in dhcp6c.conf regardless of boot order.
Suggested fix:
Defer the generation of dhcp6c.conf until all interfaces are initialized, or add a post-boot hook that regenerates it if any Track Interface interfaces are missing.