mh, but with this solution I can only have 16 /64 subnets instead of the 64 available ipv6 subnets in this specific setting. I am looking to a more robust/general way of assign the IPv6 subnet to OpenVPN (i.e. which can consider different subnet sizes on the other interfaces which take a chunk of the available IPv6 prefix and ipv6hints > 16 etc.).
I just came up with the hotplug script below which I will test in the next days. I changed the OpenVPN interface from unmanaged to static. This way, I can configure the subnet hints and sizes as usual in /etc/config/interface and let OpenWRT handle the whole IPv6 subnetting and just grab the IPv6 subnet assigned to the OpenVPN interface by the hotplug script and assign it to the OpenVPN server config. Seems to work at the first glance, but I will test it in more detail.
/etc/config/network
config interface 'LANvpn'
option ifname 'tun1'
option proto 'static'
option ip6assign '64'
option ip6hint '14'
/etc/hotplug.d/iface/30-ipv6pdchange.sh
#!/bin/sh
# if ipv6 address has changed on WAN6 go for it
if [ "$INTERFACE" = "wan6" -a "$IFUPDATE_ADDRESSES" = "1" ]
then
# source network functions
source /lib/functions/network.sh
# get IPv6 of openvpn interface
network_get_ipaddr6 IPV6_OVPN "LANvpn"
# get subnet size of OpenVPN interface
NET_ASSIGN="$(uci get network.LANvpn.ip6assign)"
# set openvpn server-ipv6 option
uci set openvpn.LAN.server_ipv6="$IPV6_OVPN/$NET_ASSIGN"
uci commit openvpn
# reload openvpn
/etc/init.d/openvpn reload
fi