From 1580d3b1a39bb44e0498d4b223ea1167c4a17705 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Mon, 18 Mar 2019 22:39:10 +0000 Subject: [PATCH] openvpn: Tie client to use IPv4 OpenVPN might try to connect via IPv6 in rare occasions. To avoid that, we can tell it to use IPv4 exclusively. Signed-off-by: Michael Tremer --- html/cgi-bin/ovpnmain.cgi | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi index 7e274b36a..5985d534c 100644 --- a/html/cgi-bin/ovpnmain.cgi +++ b/html/cgi-bin/ovpnmain.cgi @@ -970,14 +970,14 @@ unless(-d "${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}"){mkdir "${General print SERVERCONF "port $cgiparams{'DEST_PORT'}\n"; if ($cgiparams{'PROTOCOL'} eq 'tcp') { - print SERVERCONF "proto tcp-server\n"; + print SERVERCONF "proto tcp4-server\n"; print SERVERCONF "# Packet size\n"; if ($cgiparams{'MTU'} eq '') {$tunmtu = '1400'} else {$tunmtu = $cgiparams{'MTU'}}; print SERVERCONF "tun-mtu $tunmtu\n"; } if ($cgiparams{'PROTOCOL'} eq 'udp') { - print SERVERCONF "proto udp\n"; + print SERVERCONF "proto udp4\n"; print SERVERCONF "# Paketsize\n"; if ($cgiparams{'MTU'} eq '') {$tunmtu = '1500'} else {$tunmtu = $cgiparams{'MTU'}}; print SERVERCONF "tun-mtu $tunmtu\n"; @@ -1069,14 +1069,14 @@ unless(-d "${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}"){mkdir "${General print CLIENTCONF "port $cgiparams{'DEST_PORT'}\n"; if ($cgiparams{'PROTOCOL'} eq 'tcp') { - print CLIENTCONF "proto tcp-client\n"; + print CLIENTCONF "proto tcp4-client\n"; print CLIENTCONF "# Packet size\n"; if ($cgiparams{'MTU'} eq '') {$tunmtu = '1400'} else {$tunmtu = $cgiparams{'MTU'}}; print CLIENTCONF "tun-mtu $tunmtu\n"; } if ($cgiparams{'PROTOCOL'} eq 'udp') { - print CLIENTCONF "proto udp\n"; + print CLIENTCONF "proto udp4\n"; print CLIENTCONF "# Paketsize\n"; if ($cgiparams{'MTU'} eq '') {$tunmtu = '1500'} else {$tunmtu = $cgiparams{'MTU'}}; print CLIENTCONF "tun-mtu $tunmtu\n"; @@ -2239,14 +2239,14 @@ if ($confighash{$cgiparams{'KEY'}}[3] eq 'net'){ print CLIENTCONF "port $confighash{$cgiparams{'KEY'}}[29]\n"; if ($confighash{$cgiparams{'KEY'}}[28] eq 'tcp') { - print CLIENTCONF "proto tcp-client\n"; + print CLIENTCONF "proto tcp4-client\n"; print CLIENTCONF "# Packet size\n"; if ($confighash{$cgiparams{'KEY'}}[31] eq '') {$tunmtu = '1400'} else {$tunmtu = $confighash{$cgiparams{'KEY'}}[31]}; print CLIENTCONF "tun-mtu $tunmtu\n"; } if ($confighash{$cgiparams{'KEY'}}[28] eq 'udp') { - print CLIENTCONF "proto udp\n"; + print CLIENTCONF "proto udp4\n"; print CLIENTCONF "# Paketsize\n"; if ($confighash{$cgiparams{'KEY'}}[31] eq '') {$tunmtu = '1500'} else {$tunmtu = $confighash{$cgiparams{'KEY'}}[31]}; print CLIENTCONF "tun-mtu $tunmtu\n"; -- 2.39.2