Used two /64 subnets:
* LAN: 2001:db8:0:1::/64
* VPN: 2001:db8:0:ffff::/64
Note: This allows assigning /80 for Docker, which is enough. If you want to make your client additionally e.g. a WLAN router (i.e. use SLAAC behind the VPN client), you may need to have more address space available for the clients in order to provide the required /64s for them.
Divided VPN /64 subnet like this (static allocation for each client):
* Server: 2001:db8:0:ffff:0000::/72
* Client 1: 2001:db8:0:ffff:0100::/72
* Client 2: 2001:db8:0:ffff:0200::/72
* Client 3: 2001:db8:0:ffff:0300::/72
* ...
Finally, allocated the following subnets inside each client (X=client number):
* Tunnel: 2001:db8:0:ffff:0X00::/80
* Docker: 2001:db8:0:ffff:0X01::/80
* ...
Server-side /etc/openvpn/server.conf:
Code: Select all
dev tun0
topology subnet
client-config-dir /etc/openvpn/staticclients
server-ipv6 2001:708:120:f16::/64
push "route-ipv6 2000::/3"
...
Code: Select all
ifconfig-push 192.168.100.10X 255.255.255.255
ifconfig-ipv6-push 2001:db8:0:ffff:X00::/80
iroute-ipv6 2001:db8:0:ffff:X00::/72
Client-side clientX.ovpn:
Code: Select all
port 1194
dev tun
remote server.example.com
tls-client
pull
<ca>
-----BEGIN CERTIFICATE-----
...
Code: Select all
DOCKER_NETWORK_OPTIONS="--ipv6 --fixed-cidr-v6=\"2001:db8:0:ffff:X01::/80\""
If the firewall on your client blocks forwarding between docker and VPN, add following lines *before* "-A FORWARD -j REJECT --reject-with icmp6-adm-prohibited" in /etc/sysconfig/ip6tables:
Code: Select all
-A FORWARD -i docker0 -o tun0 -j ACCEPT
-A FORWARD -i tun0 -o docker0 -j ACCEPT
Code: Select all
# systemctl restart docker
# systemctl restart firewalld
Code: Select all
# docker pull fedora
# docker run -it fedora /bin/bash
# dnf install iproute iputils
# ip -6 a
# traceroute6 google.com