From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH] openvpn: Tie client to use IPv4 Date: Mon, 18 Mar 2019 22:39:10 +0000 Message-ID: <1552948750-2167-1-git-send-email-michael.tremer@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1811172619671333996==" List-Id: --===============1811172619671333996== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 4fb2349..282456e 100644 --- a/html/cgi-bin/ovpnmain.cgi +++ b/html/cgi-bin/ovpnmain.cgi @@ -967,14 +967,14 @@ unless(-d "${General::swroot}/ovpn/n2nconf/$cgiparams{'= NAME'}"){mkdir "${General print SERVERCONF "port $cgiparams{'DEST_PORT'}\n";=20 =20 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 =3D '1400'} else {$tunmtu =3D $cgipa= rams{'MTU'}}; print SERVERCONF "tun-mtu $tunmtu\n"; } =20 if ($cgiparams{'PROTOCOL'} eq 'udp') { - print SERVERCONF "proto udp\n";=20 + print SERVERCONF "proto udp4\n"; print SERVERCONF "# Paketsize\n"; if ($cgiparams{'MTU'} eq '') {$tunmtu =3D '1500'} else {$tunmtu =3D $cgipa= rams{'MTU'}}; print SERVERCONF "tun-mtu $tunmtu\n"; @@ -1063,14 +1063,14 @@ unless(-d "${General::swroot}/ovpn/n2nconf/$cgiparams= {'NAME'}"){mkdir "${General print CLIENTCONF "port $cgiparams{'DEST_PORT'}\n";=20 =20 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 =3D '1400'} else {$tunmtu =3D $cgipa= rams{'MTU'}}; print CLIENTCONF "tun-mtu $tunmtu\n"; } =20 if ($cgiparams{'PROTOCOL'} eq 'udp') { - print CLIENTCONF "proto udp\n";=20 + print CLIENTCONF "proto udp4\n"; print CLIENTCONF "# Paketsize\n"; if ($cgiparams{'MTU'} eq '') {$tunmtu =3D '1500'} else {$tunmtu =3D $cgipa= rams{'MTU'}}; print CLIENTCONF "tun-mtu $tunmtu\n"; @@ -2178,14 +2178,14 @@ if ($confighash{$cgiparams{'KEY'}}[3] eq 'net'){ print CLIENTCONF "port $confighash{$cgiparams{'KEY'}}[29]\n";=20 =20 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 =3D '1400'} else {= $tunmtu =3D $confighash{$cgiparams{'KEY'}}[31]}; print CLIENTCONF "tun-mtu $tunmtu\n"; } =20 if ($confighash{$cgiparams{'KEY'}}[28] eq 'udp') { - print CLIENTCONF "proto udp\n";=20 + print CLIENTCONF "proto udp4\n"; print CLIENTCONF "# Paketsize\n"; if ($confighash{$cgiparams{'KEY'}}[31] eq '') {$tunmtu =3D '1500'} else {= $tunmtu =3D $confighash{$cgiparams{'KEY'}}[31]}; print CLIENTCONF "tun-mtu $tunmtu\n"; --=20 2.6.3 --===============1811172619671333996==--