Skip to content

Commit 7627f8e

Browse files
authored
Merge pull request #215 from tilosp-docker/dev
Connect to the OpenVPN Server over IPv6
2 parents f487184 + 2663539 commit 7627f8e

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

bin/ovpn_genconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ done
238238
[ ${#TMP_DNS_SERVERS[@]} -gt 0 ] && OVPN_DNS_SERVERS=("${TMP_DNS_SERVERS[@]}")
239239

240240
# Server name is in the form "udp://vpn.example.com:1194"
241-
if [[ "${OVPN_SERVER_URL:-}" =~ ^((udp|tcp)://)?([0-9a-zA-Z\.\-]+)(:([0-9]+))?$ ]]; then
241+
if [[ "${OVPN_SERVER_URL:-}" =~ ^((udp|tcp|udp6|tcp6)://)?([0-9a-zA-Z\.\-]+)(:([0-9]+))?$ ]]; then
242242
OVPN_PROTO=${BASH_REMATCH[2]};
243243
OVPN_CN=${BASH_REMATCH[3]};
244244
OVPN_PORT=${BASH_REMATCH[5]};

bin/ovpn_getclient

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,15 @@ nobind
3737
dev $OVPN_DEVICE
3838
key-direction 1
3939
remote-cert-tls server
40-
remote $OVPN_CN $OVPN_PORT $OVPN_PROTO
41-
$OVPN_ADDITIONAL_CLIENT_CONFIG
40+
41+
remote $OVPN_CN $OVPN_PORT $OVPN_PROTO"
42+
if [ "$OVPN_PROTO" == "udp6" ]; then
43+
echo "remote $OVPN_CN $OVPN_PORT udp"
44+
fi
45+
if [ "$OVPN_PROTO" == "tcp6" ]; then
46+
echo "remote $OVPN_CN $OVPN_PORT tcp"
47+
fi
48+
echo "$OVPN_ADDITIONAL_CLIENT_CONFIG
4249
"
4350
if [ "$mode" == "combined" ]; then
4451
echo "

docs/ipv6.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,11 @@ Fire up a web browser and attempt to navigate to [https://ipv6.google.com](https
9191

9292
## Connect to the OpenVPN Server Over IPv6
9393

94-
Not implemented, yet.
94+
This feature requires a docker daemon with working IPv6 support.
95+
96+
This will allow connections over IPv4 and IPv6.
97+
98+
Generate server configuration with the udp6 or tcp6 protocol:
99+
100+
docker run -v $OVPN_DATA:/etc/openvpn --rm kylemanna/openvpn ovpn_genconfig -u udp6://VPN.SERVERNAME.COM
101+
docker run -v $OVPN_DATA:/etc/openvpn --rm kylemanna/openvpn ovpn_genconfig -u tcp6://VPN.SERVERNAME.COM

0 commit comments

Comments
 (0)