d***@telus.net
2017-06-10 00:18:35 UTC
A few months ago, I was trying to get a dual-stack client and server working on Windows 10. I was able to get the client and server to connect and fully work for ipv4, but I was unable to configure the network settings on the server so it would also work for ipv6. I tried several different approaches, but no matter what I tried, the server would not pass the ipv6 traffic. I decided to try again using a linux server. I configured a Ubuntu 16.04 LTS server running the latest version of openvpn from scratch. The server is behind a pfsense router with native dual stack. It has a single ethernet interface with ipv4 and ipv6 dhcp addresses. The client is behind a completely separate pfsense router. It also has native dual stack on a single ethernet interface with ipv4 and ipv6 dhcp addresses. So as to not carry over any possible problems from the previous attempt, I created new keys and new configuration files from scratch. The client and server connect and the vpn will carry ipv4 traffic, but I'm not sure how to configure the server to carry the ipv6 traffic.
Note, I initially started using ULA addressing on the server (fc00::/64). That did not work, so I switched to prefix::/64. In both cases, everything worked properly except for passing ipv6 traffic.
I've tried to make the client and server configurations as minimalist as possible.
Here is the server configuration:
port 1194
proto udp
dev tun
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/server.crt
key /etc/openvpn/keys/server.key
dh /etc/openvpn/keys/dh4096.pem
cipher AES-256-CBC
auth SHA512
server 10.8.0.0 255.255.255.0
server-ipv6 {redacted prefix}::/64
push "redirect-gateway def1 bypass-dhcp"
push "redirect-gateway ipv6"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS6 2001:4860:4860::8888"
ifconfig-pool-persist ipp.txt
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
log openvpn.log
verb 3
Here is the client configuration:
ca ca.crt
cert client.crt
key client.key
remote {redacted ipv4 server address} 1194
comp-lzo
client
dev tun
redirect-gateway def1
remote-cert-tls server
cipher AES-256-CBC
auth SHA512
proto udp
resolv-retry infinite
nobind
persist-key
persist-tun
verb 3
mute 20
Are there any issues in the above configuration files?
I followed some instructions in a tutorial on digital ocean to configure the server firewall using ufw (which is a front-end to iptables). While I'm not exactly sure why or how it works, it works. I can ping the client and server using both ipv4 and ipv6 in both directions. I can look up ipv4 and ipv6 addresses from the client using nslookup. I can ping external addresses and access external websites from the client using ipv4, but not using ipv6. As I said, I initially tried using fc00::/64 but that didn't work so I changed to {delegated prefix}::/64. That made no difference, so I'm not sure whether I should be using ULA or UGA. I'm quite sure the problems is at least in part because the firewall is not configured to pass the ipv6 traffic, but I haven't found any examples showing the ipv6 equivalent of how I configured the firewall for ipv4.
Forwarding of ipv4 and ipv6 is enabled.
Here are the rules I added to ufw for ipv4:
# START OPENVPN RULES
# NAT table rules
*nat
:POSTROUTING ACCEPT [0:0]
# Allow traffic from OpenVPN client to wlp11s0 (change to the interface you discovered!)
-A POSTROUTING -s 10.8.0.0/8 -o wlp11s0 -j MASQUERADE
COMMIT
# END OPENVPN RULES
I tried posting on the forum. I received the usual RTFM replies, but no suggestions about ufw. The OpenVPN documentation and how-tos are sorely lacking for ipv6.
I'm hoping someone out there knows how to do this.
Note, I initially started using ULA addressing on the server (fc00::/64). That did not work, so I switched to prefix::/64. In both cases, everything worked properly except for passing ipv6 traffic.
I've tried to make the client and server configurations as minimalist as possible.
Here is the server configuration:
port 1194
proto udp
dev tun
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/server.crt
key /etc/openvpn/keys/server.key
dh /etc/openvpn/keys/dh4096.pem
cipher AES-256-CBC
auth SHA512
server 10.8.0.0 255.255.255.0
server-ipv6 {redacted prefix}::/64
push "redirect-gateway def1 bypass-dhcp"
push "redirect-gateway ipv6"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS6 2001:4860:4860::8888"
ifconfig-pool-persist ipp.txt
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
log openvpn.log
verb 3
Here is the client configuration:
ca ca.crt
cert client.crt
key client.key
remote {redacted ipv4 server address} 1194
comp-lzo
client
dev tun
redirect-gateway def1
remote-cert-tls server
cipher AES-256-CBC
auth SHA512
proto udp
resolv-retry infinite
nobind
persist-key
persist-tun
verb 3
mute 20
Are there any issues in the above configuration files?
I followed some instructions in a tutorial on digital ocean to configure the server firewall using ufw (which is a front-end to iptables). While I'm not exactly sure why or how it works, it works. I can ping the client and server using both ipv4 and ipv6 in both directions. I can look up ipv4 and ipv6 addresses from the client using nslookup. I can ping external addresses and access external websites from the client using ipv4, but not using ipv6. As I said, I initially tried using fc00::/64 but that didn't work so I changed to {delegated prefix}::/64. That made no difference, so I'm not sure whether I should be using ULA or UGA. I'm quite sure the problems is at least in part because the firewall is not configured to pass the ipv6 traffic, but I haven't found any examples showing the ipv6 equivalent of how I configured the firewall for ipv4.
Forwarding of ipv4 and ipv6 is enabled.
Here are the rules I added to ufw for ipv4:
# START OPENVPN RULES
# NAT table rules
*nat
:POSTROUTING ACCEPT [0:0]
# Allow traffic from OpenVPN client to wlp11s0 (change to the interface you discovered!)
-A POSTROUTING -s 10.8.0.0/8 -o wlp11s0 -j MASQUERADE
COMMIT
# END OPENVPN RULES
I tried posting on the forum. I received the usual RTFM replies, but no suggestions about ufw. The OpenVPN documentation and how-tos are sorely lacking for ipv6.
I'm hoping someone out there knows how to do this.