From b9e9903ddb21665023c9fcc241099476a42a9dbd Mon Sep 17 00:00:00 2001 From: "Dmitriy K." Date: Tue, 17 Jun 2014 11:01:48 +0400 Subject: patchpack1 -Fix #3401 (Added tun option "Disable IPv6" -Added new options: route-nopull, route-noexec, verb; --- usr/local/www/vpn_openvpn_client.php | 109 ++++++++++++++++++++++++++++++++++- usr/local/www/vpn_openvpn_server.php | 56 +++++++++++++++++- 2 files changed, 163 insertions(+), 2 deletions(-) (limited to 'usr') diff --git a/usr/local/www/vpn_openvpn_client.php b/usr/local/www/vpn_openvpn_client.php index d5b479e..f80694b 100644 --- a/usr/local/www/vpn_openvpn_client.php +++ b/usr/local/www/vpn_openvpn_client.php @@ -93,6 +93,7 @@ if($_GET['act']=="new"){ $pconfig['autotls_enable'] = "yes"; $pconfig['interface'] = "wan"; $pconfig['server_port'] = 1194; + $pconfig['verbosity_level'] = 1; // Default verbosity is 1 // OpenVPN Defaults to SHA1 $pconfig['digest'] = "SHA1"; } @@ -152,6 +153,12 @@ if($_GET['act']=="edit"){ // just in case the modes switch $pconfig['autokey_enable'] = "yes"; $pconfig['autotls_enable'] = "yes"; + + // New features + $pconfig['no_tun_ipv6'] = $a_client[$id]['no_tun_ipv6']; + $pconfig['route_no_pull'] = $a_client[$id]['route_no_pull']; + $pconfig['route_no_exec'] = $a_client[$id]['route_no_exec']; + $pconfig['verbosity_level'] = $a_client[$id]['verbosity_level']; } } @@ -311,6 +318,12 @@ if ($_POST) { $client['compression'] = $pconfig['compression']; $client['passtos'] = $pconfig['passtos']; + // New features + $client['no_tun_ipv6'] = $pconfig['no_tun_ipv6']; + $client['route_no_pull'] = $pconfig['route_no_pull']; + $client['route_no_exec'] = $pconfig['route_no_exec']; + $client['verbosity_level'] = $pconfig['verbosity_level']; + if (isset($id) && $a_client[$id]) $a_client[$id] = $client; else @@ -352,6 +365,19 @@ function mode_change() { } } +function dev_mode_change() { + index = document.iform.dev_mode.selectedIndex; + value = document.iform.dev_mode.options[index].value; + switch(value) { + case "tun": + document.getElementById("chkboxNoTunIPv6").style.display=""; + break; + case "tap": + document.getElementById("chkboxNoTunIPv6").style.display="none"; + break; + } +} + function autokey_change() { if (document.iform.autokey_enable.checked) document.getElementById("autokey_opts").style.display="none"; @@ -482,7 +508,7 @@ if ($savemsg) - + + + + + + + + + + +
+ + /> + + + . + +
+ + + + + + + + + + + +
+ + /> + + + --route-up . + +
+ + + + + + + + + + + +
+ + /> + + + . + +
+ + @@ -977,6 +1061,29 @@ if ($savemsg)
+ + + + + +
+ .

+ none -- .
+ default-4 -- .
+ 5 -- .
+ 6-11 -- . + + +
diff --git a/usr/local/www/vpn_openvpn_server.php b/usr/local/www/vpn_openvpn_server.php index e840911..972ceeb 100644 --- a/usr/local/www/vpn_openvpn_server.php +++ b/usr/local/www/vpn_openvpn_server.php @@ -98,6 +98,7 @@ if($_GET['act']=="new"){ $pconfig['local_port'] = openvpn_port_next('UDP'); $pconfig['pool_enable'] = "yes"; $pconfig['cert_depth'] = 1; + $pconfig['verbosity_level'] = 1; // Default verbosity is 1 // OpenVPN Defaults to SHA1 $pconfig['digest'] = "SHA1"; } @@ -205,6 +206,10 @@ if($_GET['act']=="edit"){ $pconfig['autotls_enable'] = "yes"; $pconfig['duplicate_cn'] = isset($a_server[$id]['duplicate_cn']); + + // New features + $pconfig['no_tun_ipv6'] = $a_server[$id]['no_tun_ipv6']; + $pconfig['verbosity_level'] = $a_server[$id]['verbosity_level']; } } if ($_POST) { @@ -428,6 +433,10 @@ if ($_POST) { $server['netbios_enable'] = $pconfig['netbios_enable']; $server['netbios_ntype'] = $pconfig['netbios_ntype']; $server['netbios_scope'] = $pconfig['netbios_scope']; + + // New features + $server['no_tun_ipv6'] = $pconfig['no_tun_ipv6']; + $server['verbosity_level'] = $pconfig['verbosity_level']; if ($pconfig['netbios_enable']) { @@ -671,6 +680,7 @@ function tuntap_change() { value = document.iform.dev_mode.options[index].value; switch(value) { case "tun": + document.getElementById("cbNoTunIPv6").style.display=""; document.getElementById("ipv4_tunnel_network").className="vncellreq"; document.getElementById("serverbridge_dhcp").style.display="none"; document.getElementById("serverbridge_interface").style.display="none"; @@ -679,6 +689,7 @@ function tuntap_change() { document.getElementById("topology_subnet_opt").style.display=""; break; case "tap": + document.getElementById("cbNoTunIPv6").style.display="none"; document.getElementById("ipv4_tunnel_network").className="vncell"; if (!p2p) { document.getElementById("serverbridge_dhcp").style.display=""; @@ -1340,7 +1351,7 @@ if ($savemsg)
- + . @@ -1397,6 +1408,26 @@ if ($savemsg) + + + + + + + + + +
+ + /> + + + . + +
+ + + @@ -1724,6 +1755,29 @@ if ($savemsg)
+ + + + + +
+ .

+ none -- .
+ default-4 -- .
+ 5 -- .
+ 6-11 -- . + + +
-- cgit v1.1