Helper script for pfSense. It takes the first address from the top subnet of a delegated ::/56
and assigns it to an interface (typically a WAN interface configured in DHCP6 mode). Useful for situations where ISPs such as Verizon FIOS do not honor ia-na
or provide a GUA to the router itself.
Tested only on pfSense+ 22.05, but should work for CE as well
- Copy the script to your pfSense firewall and make it executable (
chmod u+x /root/assign_gua_from_iapd.sh
) - Make sure the DHCP6 Debug checkbox is enabled at System → Advanced → Networking.
N.B. if you haven't applied my patch from PR #4595 you'll need to comment out line 57 (put
//
at the start of the line, or just delete it) because thecreate_interface_ipv6_cfgcache()
function doesn't exist in the base pfSense (yet).
assign_gua_from_iapd.sh <ifname>
You can schedule this to occur at regular intervals using the Cron package, or use this small patch (apply with System Patches) to have the script automatically hooked into the dhcp6c request/renew process.
Tighter integrations such as devd
will need to wait for FreeBSD 14 which brings a new ADDR_ADD
event. That will be landing with pfSense 22.11, so I will probably update this around then if there's any way to make it more efficient.