brith2o
I'm running OpenWRT Barrier Breaker r40820.
I have a local br-lan bridge (IPv4 192.168.1.1/24) for my own wired and wireless network, a guest wired and wireless network (br-guest) (IPv4 192.168.3.1/24), and a functioning OpenVPN tun0 adapter to provide VPN service (192.168.2.1/24)
I've got IPv6 working nicely on my local networks. I get a dynamically-assigned /60 from Comcast, and apply individual /64 subnets to my LAN bridge, guest bridge (basically a separate guest wireless network), and the tun0 adapter that OpenVPN uses. Although not at all necessary, for consistency with the private IPv4 addresses, I assign the 4-bit subnet ID of "1" to br-lan, "3" to br-guest, and "2" to the tun0 adapter.
What I'd like to now do is get IPv6 working for my OpenVPN tunnel. I am using OpenVPN 2.3 which fully supports IPv6, but I'm stuck on how to handle dynamically-assigned prefixes.
OpenVPN has the directive
server-ipv6 nnnn:nnnn:nnnn:nnn2::/64
Or expanded directives
tun-ipv6
push tun-ipv6
ifconfig-ipv6 nnnn:nnnn:nnnn:nnn2::1 nnnn:nnnn:nnnn:nnn2::2
ifconfig-ipv6-pool nnnn:nnnn:nnnn:nnn2::8000/64
In the above, the "nnnn:nnnn:nnnn:nnn" part of the address is the dynamic /60 I get from my ISP, the adjacent "2" is the subnet ID I'd like to use for the OpenVPN network.
Since the purpose of the OpenVPN network is to allow me to access machines on br-lan, I would also need to push the correct routes, (e.g. push "route-ipv6 nnnn:nnnn:nnnn:nnn1::/64") and this also contains a dynamically-changing prefix.
I envision two possible solutions:
1. Altering the OpenWRT-generated /temp/etc/openvpn-server.conf file every time the wan interface comes up to rewrite the IPv6-related lines with the correct addresses, then signalling OpenVPN to restart.
OR
2. Using some of the up/down script capabilities of OpenVPN to correctly assign addresses and push routes.
For either of these solutions, I'm really at a loss as how to do it and would love to hear some ideas from the community.