OPT interfaces with "Track Interface" IPv6 not included in dhcp6c.conf on boot
-
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 bootBug 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 callslink_interface_to_track6()to build the list of interfaces to include indhcp6c.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 callinginterface_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.confcorrectly 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. -
@altmannmarcelo said in OPT interfaces with "Track Interface" IPv6 not included in dhcp6c.conf on boot:
The function interface_dhcpv6_configure() is triggered when the WAN comes up during boot.
Also when the OPT1 comes up : look down in function interface_configure() as I do presume this function is called when 'any' interface comes up.
What I mean :@altmannmarcelo said in OPT interfaces with "Track Interface" IPv6 not included in dhcp6c.conf on boot:
if (!empty($ifcfg['ipaddrv6']) && $ifcfg['track6-interface'] == $int)
will get executed when OPTx comes up.
Btw : I'm not implying your right or wrong here.
You could test this !
Add logs lines at the begging of the functions, the ones used when an OPTx comes up.I know that something should work, as many pfSense users have more then one LAN type interfaces, and use tracking on more then one LAN type interface : they all receive a prefix.
pfSense isn't know for "IPv6 ok, but just one LAN, one prefix, not more".As soon as I set up my WAN interface as :
( I changed the working /64 to a /63 or 2 prefixes) :
the generated /var/etc/dhcp6v.conf file looks like this :
[26.03.1-RELEASE][root@pfSense.bhf.tld]/var/etc: cat dhcp6c.conf interface ix3 { send ia-na 0; # request stateful address send ia-pd 0; # request prefix delegation request domain-name-servers; request domain-name; script "/var/etc/dhcp6c_wan_dhcp6withoutra_script.sh"; # we'd like nameservers and RTSOLD to do all the work }; id-assoc na 0 { }; id-assoc pd 0 { prefix ::/63 infinity; prefix-interface igc0 { sla-id 0; sla-len 1; }; prefix-interface igc1 { sla-id 1; sla-len 1; }; };I can finish the setup of my OPT2 or igc1 (select tracking6, prefix hex 1 of 1 - where LAN is using 0 - 1), but it doesn't matter, I lose all prefixes, and blow IPv6 networking out of the water.
Because :
I can't test what you are doing : more the one (1) LAN interface using 'tracking6' as for some reason my ISP (router) tells me that I have a /56 avaible with a silly restriction : just one prefix per requesting LAN (LAN of my ISP router) device. Or, I have several LANs for my pfSense, and I want a IPv6 prefix for each LAN. This is a know "ISP router" (Orange, France) issue. -
@Gertjan said in OPT interfaces with "Track Interface" IPv6 not included in dhcp6c.conf on boot:
just one prefix per requesting LAN (LAN of my ISP router) device.
You could use NPT, one /64 would be enough for outbound IPv6 for all your interfaces with ULAs.
Privacy Policy · Cookie Policy