I have a follow-up from what I posted below.

Here are the actual changes I put into /etc/ufw/before.rules. What I posted got 
mangled and it was from the tutorial before I changed it to match my 
configuration.

# START OPENVPN RULES
# NAT table rules
*nat
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -s 10.8.0.0/8 -o eth0 -j MASQUERADE
COMMIT
# END OPENVPN RULES

I found another tutorial from a few years ago for openvpn ipv6 on Debian. It's 
here: https://www.tecmint.com/install-openvpn-in-debian/. Not clear of all of 
the extra scripts are required, but it had some ip*tables rules.

#!/bin/sh
# description: Firewall
IPT=/sbin/iptables
IPT6=/sbin/ip6tables
case "$1" in
start)
$IPT -F INPUT
$IPT -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPT -A INPUT -i eth0 -p tcp --dport 22 -j ACCEPT
$IPT -A INPUT -i eth0 -p icmp -j ACCEPT
$IPT -A INPUT -i eth0 -p udp --dport 1194 -j ACCEPT
$IPT -A INPUT -i tap+ -j ACCEPT
$IPT -A FORWARD -i tap+ -j ACCEPT
$IPT -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPT -t nat -F POSTROUTING
$IPT -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
$IPT -A INPUT -i eth0 -j DROP
$IPT6 -F INPUT
$IPT6 -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPT6 -A INPUT -i eth0 -p tcp --dport 22 -j ACCEPT
$IPT6 -A INPUT -i eth0 -p icmpv6 -j ACCEPT
$IPT6 -A FORWARD -s 2a00:dd80:003d:000c::/64 -i tap0 -o eth0 -j ACCEPT
$IPT6 -A INPUT -i eth0 -j DROP
exit 0
;;
stop)
$IPT -F
$IPT6 -F
exit 0
;;
*)
echo "Usage: /etc/init.d/firewall {start|stop}"
exit 1
;;
esac

I attempted to insert this: $IPT6 -A FORWARD -s 2a00:dd80:003d:000c::/64 -i 
tap0 -o eth0 -j ACCEPT using ufw.

# START OPENVPN RULES
# FILTER table rules
*filter
:FORWARD ACCEPT [0:0]
-A FORWARD -s {prefix}::/64 -i tun0 -o eth0 -j ACCEPT
COMMIT
# END OPENVPN RULES

I'm not sure if it's correct, but presumably not, because it did not make any 
difference.

FYI, the address of the server is {prefix}::1 and the address of the client is 
{prefix}::1000.

-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Friday, June 9, 2017 5:19 PM
To: [email protected]
Subject: [Openvpn-users] Need help with Ubuntu 16.04 LTS OpenVPN 2.4 
Dual-Stack Server Firewall Configuration

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.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openvpn-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-users

Reply via email to