1

I'm trying to setup an OpenVPN server to tunnel all my traffic (IPv4 and IPv6) through it.

Server is Debian 8 and has a native IPv6 /64 subnet: 2a00:xxxx:35:59::/64

I want to use a /112 subnet for my VPN: 2a00:xxxx:35:59::1:0/112

net.ipv6.conf.all.forwarding=1 is enabled.

Server config:

port 1194
proto udp6
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh4096.pem
server 192.168.56.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 208.67.220.220"
duplicate-cn
keepalive 10 120
cipher AES-256-CBC
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3
auth SHA512
tls-cipher TLS-DHE-RSA-WITH-AES-256-GCM-SHA384:TLS-DHE-RSA-WITH-AES-128-GCM-SHA256:TLS-DHE-RSA-WITH-AES-256-CBC-SHA:TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA:TLS-DHE-RSA-WITH-AES-128-CBC-SHA:TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA
client-cert-not-required
auth-user-pass-verify /etc/openvpn/user-auth.py via-env
script-security 3

server-ipv6 2a00:xxxx:0035:0059::1:0/112
ifconfig-ipv6 2a00:xxxx:0035:0059::1:1 2a00:xxxx:0035:0059::1:2
tun-ipv6
push "redirect-gateway def1 bypass-dhcp"
push "route-ipv6 2000::/3"

Without push "route-ipv6 2000::/3" IPv4 traffic is being tunneled and I can ping/access the server via IPv4/IPv6. With this option none of this works.

I think this is a routing problem, I've already tried various iptables configurations (http://pastebin.com/erPPu2Nj) but none of those worked..

1 Answer 1

0

Apparently the OpenVPN-2.3.*-client has a bug which prevents him from using new default-IPv6 routes. Thanks to Gert who implemented this and told me this on the mailing list!

To get my IPv6 working for tunneling, I then had to add these iptables settings:

ip6tables -I FORWARD -i tun0 -o eth0 -s 2a00:xxxx:35:59::1:0/112 -m conntrack --ctstate NEW -j ACCEPT
ip6tables -I FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
ip6tables -t nat -I POSTROUTING -o eth0 -s 2a00:xxxx:35:59::1:0/112 -j MASQUERADE
2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .