I have successfully turned an existing OpenVPN ipv4 tunnel into an ipv6 one with the following configuration files:
server.conf
port 22062
proto tcp6
dev tun
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/server.crt
key /etc/openvpn/easy-rsa/keys/server.key
dh /etc/openvpn/easy-rsa/keys/dh2048.pem
topology subnet
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
duplicate-cn
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
keepalive 5 60
cipher AES-256-CBC
user nobody
group nobody
persist-key
persist-tun
status openvpn-status.log
log-append /var/log/openvpn.log
verb 3
float
ping-timer-rem
resolv-retry infinite
server-ipv6 2001:db8:f00:bebe::/64
push "route-ipv6 ::/0"
push "route-metric 2000"
push "dhcp-option DNS6 2001:4860:4860::8888"
push "dhcp-option DNS6 2001:4860:4860::8844"
client.opvn
client
dev tun-ipv6
proto tcp
remote xxx.xxx.xxx.xxx 22062
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client.crt
key client.key
--remote-cert-tls server
cipher AES-256-CBC
verb 3
auth-nocache
But when the tunnel is active not all internet traffic connects.
I have noticed that ipleak.net shows that when tunnel is NOT active there is a fallback for ipv4 traffic (my local ISP uses ipv6), but when I turn on the tunnel I get the following information from ipleak.net:
- IPv4 test not reachable. (timeout) [with tunnel NOT active it shows my local ipv4 address]
- Fallback: Fail (error) [with tunnel NOT active it shows: Fallback: IPv4 (152 ms)]
I confess to being a little out of my depth here. Any ideas how to resolve this issue?
Best Answer
Solved my own question: the main issue was resolved by reading this: https://community.openvpn.net/openvpn/wiki/IPv6
The public ipv6 address of the server was in the bottom half of 2001:db8:f00:bebe::/64 so changed the server line in server.conf to:
Also - to ensure that all internet traffic on ipv6 goes through OpenVPN server - added this line to server.conf:
And deleted:
that was optional and would take some ipv6 traffic outside OpenVPN server, if I understand well