1 simple wan - lan relay. ra is provided by upstream
wan.master=1, ra=relay, dhcpv6=relay, rdp proxy=1
lan.ra=relay, dhcpv6=relay, rdp proxy=1
2 advanced wan - lan relay, ra is provided by upstream
if network.wan6(or auto generated wan_6).reqprefix=auto, then it could provide pd prefix. (needs to be "no" to disable pd)
if pd prefix is enabled(you see IPv6-PD), you can only allocate to lan with non-empty ip6hint, with ra=server,dhcpv6=server. so it isnt the /64 ra range.
if you still want isp ra, so I learned from this article (https://blog.pzc.moe/articles/notes/odhcpd-relay-mode-discuss/ ) method 1 using ip -6 route replace with metric.
my rewritten version without owipcalc, put it under /etc/hotplug.d/iface and chmod +x:
#!/bin/sh
[ "$ACTION" = ifdown -a "$INTERFACE" = "wan6" ] && DN=1
[ "$ACTION" = ifdown -a "$INTERFACE" = "wan_6" ] && DN=1
[ "$ACTION" = ifup -a "$INTERFACE" = "wan6" ] && UP=1
[ "$ACTION" = ifup -a "$INTERFACE" = "wan_6" ] && UP=1
# hacky
[ "$ACTION" = ifup -a "$INTERFACE" = "lan" ] && INTERFACE="wan_6" && UP=1
[ "$DN" = 1 -o "$UP" = 1 ] || exit 0
LAN="lan"
RTMETRIC=127
. /lib/functions/network.sh
network_get_physdev lan_dev $LAN || exit 0
ip -6 route flush dev "$lan_dev" metric $RTMETRIC
[ "$UP" = 1 ] || exit 0
network_get_subnet6 wan_subnet "$INTERFACE" || return
wan_network=$(echo "${wan_subnet}" | awk -F: '{print $1 ":" $2 ":" $3 ":" $4 "::/64"}')
ip -6 route replace "$wan_network" dev "$lan_dev" metric $RTMETRIC
3 convert /64 ra as pd
pd function needs a pd prefix (or /64 ra as fake pd using extendprefix config),
and set wan ra=disabled,dhcpv6=disabled,ndp=disabled,
and set lan ra=server,dhcpv6=server,ndp=disabled.
Note that if you use pppoe, /lib/netifd/ppp6-up has $AUTOIPV6 function,
while autoipv6 comes from ppp_generic_setup in /lib/netifd/proto/ppp.sh,
and luci often hints you to use ipv6=auto (but creating wan6 needs wan.ipv6=1, it maps to Manual in luci)
if [ "$ipv6" = 0 ]; then
ipv6=""
elif [ -z "$ipv6" -o "$ipv6" = auto ]; then
ipv6=1
autoipv6=1
fi
if [ "$autoipv6" != 1 ]; then
reqprefix=""
norelease=""
fi
so if you want convert the /64 ra to pd, use ipv6=1, manually create @wan with dhcpv6 client protocol, and set
network.wan6.reqprefix='no'
network.wan6.extendprefix='1'
untested autoipv6: you can set reqprefix and extendprefix as above on wan,
but luci dont provide ui interface for that. uci set command is the only way.
3.1 you can still reqprefix=auto and extendprefix=1 at the same time, while still converting /64 ra as pd
in /lib/netifd/dhcpv6.script, just below "RFC 7278",
-a -z "$PREFIXES" means if no pd, the script will help you convert ra as pd (but if you already has one, skip)
but you have two prefix and how to allocate becomes your own problem, so it is untested.
ps:
limit lan to not use ULA. wan or wan6.peerdns=0 is also important.
uci add_list network.lan.ip6class='wan6'
uci add_list network.lan.ip6class='wan_6'