diff --git a/bin/ovpn_genconfig b/bin/ovpn_genconfig index 013e871..9a8443f 100755 --- a/bin/ovpn_genconfig +++ b/bin/ovpn_genconfig @@ -238,7 +238,7 @@ done [ ${#TMP_DNS_SERVERS[@]} -gt 0 ] && OVPN_DNS_SERVERS=("${TMP_DNS_SERVERS[@]}") # Server name is in the form "udp://vpn.example.com:1194" -if [[ "${OVPN_SERVER_URL:-}" =~ ^((udp|tcp)://)?([0-9a-zA-Z\.\-]+)(:([0-9]+))?$ ]]; then +if [[ "${OVPN_SERVER_URL:-}" =~ ^((udp|tcp|udp6|tcp6)://)?([0-9a-zA-Z\.\-]+)(:([0-9]+))?$ ]]; then OVPN_PROTO=${BASH_REMATCH[2]}; OVPN_CN=${BASH_REMATCH[3]}; OVPN_PORT=${BASH_REMATCH[5]}; diff --git a/bin/ovpn_getclient b/bin/ovpn_getclient index d2674da..f57686b 100755 --- a/bin/ovpn_getclient +++ b/bin/ovpn_getclient @@ -37,8 +37,15 @@ nobind dev $OVPN_DEVICE key-direction 1 remote-cert-tls server -remote $OVPN_CN $OVPN_PORT $OVPN_PROTO -$OVPN_ADDITIONAL_CLIENT_CONFIG + +remote $OVPN_CN $OVPN_PORT $OVPN_PROTO" + if [ "$OVPN_PROTO" == "udp6" ]; then + echo "remote $OVPN_CN $OVPN_PORT udp" + fi + if [ "$OVPN_PROTO" == "tcp6" ]; then + echo "remote $OVPN_CN $OVPN_PORT tcp" + fi + echo "$OVPN_ADDITIONAL_CLIENT_CONFIG " if [ "$mode" == "combined" ]; then echo " diff --git a/docs/ipv6.md b/docs/ipv6.md index ff2af45..00ddcb9 100644 --- a/docs/ipv6.md +++ b/docs/ipv6.md @@ -91,4 +91,11 @@ Fire up a web browser and attempt to navigate to [https://ipv6.google.com](https ## Connect to the OpenVPN Server Over IPv6 -Not implemented, yet. +This feature requires a docker daemon with working IPv6 support. + +This will allow connections over IPv4 and IPv6. + +Generate server configuration with the udp6 or tcp6 protocol: + + docker run -v $OVPN_DATA:/etc/openvpn --rm kylemanna/openvpn ovpn_genconfig -u udp6://VPN.SERVERNAME.COM + docker run -v $OVPN_DATA:/etc/openvpn --rm kylemanna/openvpn ovpn_genconfig -u tcp6://VPN.SERVERNAME.COM