I have this working now, though I have not yet set it up to happen at boot time.
Starlink offers a /64 IPv6 address, using Router Advertisements (RA). RA's are handled by the kernel, per /proc/sys/net/ipv6/conf/<interface>/accept_ra, documented in the kernel source Documentation/networking/ip-sysctl.txt. By default this is true, so that my computer got a global IPv6 address.
Starlink also offers a /56 prefix, but you have to ask for it by sending a "Solicit XID" ICMPv6 packet with an IA_PD option, typically from a DHCP client. To receive the replies, you need to allow dhcpv6-client packets, e.g. with ip6tables -I INPUT -p udp --dport 546 -j ACCEPT.
I installed wide-dhcpv6 with the following config
interface eth7 {
send ia-pd 0;
request domain-name-servers;
script "/etc/wide-dhcpv6/my-dhcp6c-script" ;
};
id-assoc pd {
prefix-interface eth0 {
sla-id 0;
sla-len 8;
};
};
The sla-id's must match.
My upstream interface is eth7, the local one eth0.
This gives a global address to eth0.
dhcp6c doesn't actually tell you the prefix, though, except with debugging turned on. It passes parameters such as domain-name-servers to an optional script. I modified dhcp6c so it would also pass the prefix and associated lifetimes.
I run radvd with a config file
interface eth0 {
AdvSendAdvert on;
MinRtrAdvInterval 30;
MaxRtrAdvInterval 100;
AdvDefaultLifetime 300;
prefix 2605:xxxx:xxx:xx00::/64 {
AdvOnLink on;
AdvAutonomous on;
AdvRouterAddr off;
AdvValidLifetime 300;
AdvPreferredLifetime 150;
};
};
building that with my-dhcp6c-script to fill in the values for prefix and lifetime. With that running, devices on my local network get a global IPv6 address. They also get a default route to the link-local address on eth0, using the sla-id of 0.
For forwarding to work, it must be allowed in ip6tables. It must also be set in /proc/sys/net/ipv6/conf/all/forwarding. Normally, accept_ra is disabled if forwarding is enabled. Since kernel 2.6, an accept_ra of 2 allows it regardless, so I have net.ipv6.conf.all.forwarding=1 and net.ipv6.conf.eth7.accept_ra=2 in /etc/sysctl.conf, which sets them at boot time.
See patch for dhcp6c
See Starlink's article