diff options
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/openvpn.inc | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc index 0591e56..4d307c2 100644 --- a/etc/inc/openvpn.inc +++ b/etc/inc/openvpn.inc @@ -55,6 +55,22 @@ $openvpn_prots = array("UDP", "UDP6", "TCP", "TCP6"); global $openvpn_dev_mode; $openvpn_dev_mode = array("tun", "tap"); +global $openvpn_verbosity_level; +$openvpn_verbosity_level = array( + 0 => "none", + 1 => "default", + 2 => "2", + 3 => "3 (recommended)", + 4 => "4", + 5 => "5", + 6 => "6", + 7 => "7", + 8 => "8", + 9 => "9", + 10 => "10", + 11 => "11" +); + /* * The User Auth mode below is disabled because * OpenVPN erroneously requires that we provide @@ -460,11 +476,18 @@ function openvpn_reconfigure($mode, $settings) { } } - $conf = "dev {$devname}\n"; + + $conf = "dev {$devname}\n"; + if (isset($settings['verbosity_level'])) { + $conf .= "verb {$settings['verbosity_level']}\n"; + } + $conf .= "dev-type {$settings['dev_mode']}\n"; switch($settings['dev_mode']) { case "tun": - $conf .= "tun-ipv6\n"; + if (!$settings['no_tun_ipv6']) { + $conf .= "tun-ipv6\n"; + } break; } $conf .= "dev-node /dev/{$tunname}\n"; @@ -768,6 +791,19 @@ function openvpn_reconfigure($mode, $settings) { $conf .= "topology subnet\n"; } + // New client features + if ($mode == "client") { + // Dont pull routes checkbox + if ($settings['route_no_pull']) { + $conf .= "route-nopull\n"; + } + + // Dont add/remove routes checkbox + if ($settings['route_no_exec']) { + $conf .= "route-noexec\n"; + } + } + openvpn_add_custom($settings, $conf); openvpn_create_dirs(); |