diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc
index b9689ba583..add1d51ef0 100644
--- a/etc/inc/openvpn.inc
+++ b/etc/inc/openvpn.inc
@@ -309,9 +309,12 @@ EOD;
$conf .= "push \"route $ip $mask\"\n";
}
- // The port we'll listen at
+ // The local port to listen on
$conf .= "lport {$settings['local_port']}\n";
+ // The management port to listen on
+ $conf .= "management 127.0.0.1 {$settings['local_port']}\n";
+
if (!empty($settings['maxclients']))
$conf .= "max-clients {$settings['maxclients']}\n";
diff --git a/usr/local/www/fbegin.inc b/usr/local/www/fbegin.inc
index 9400d0f8c7..16784128d5 100755
--- a/usr/local/www/fbegin.inc
+++ b/usr/local/www/fbegin.inc
@@ -236,7 +236,7 @@ if ($_REQUEST['noticeaction'] == 'acknowledge') {
=output_menu_item("/status_interfaces.php", "Interfaces");?>
=output_menu_item("/diag_ipsec.php", "IPsec");?>
=output_menu_item("/status_slbd_pool.php", "Load Balancer");?>
- =output_menu_item("/status_ovpn.php", "OpenVPN");?>
+ =output_menu_item("/status_openvpn.php", "OpenVPN");?>
=output_menu_item("/diag_pkglogs.php", "Package Logs");?>
diff --git a/usr/local/www/status_openvpn.php b/usr/local/www/status_openvpn.php
new file mode 100644
index 0000000000..c8e3da43ec
--- /dev/null
+++ b/usr/local/www/status_openvpn.php
@@ -0,0 +1,158 @@
+
+
+
+
+
+ |
+ Client connections for =$server['name'];?>
+ |
+
+
+ | Common Name |
+ Real Address |
+ Virtual Address |
+ Connected Since |
+ Bytes Sent |
+ Bytes Received |
+
+
+
+
+ |
+ =$conn['common_name'];?>
+ |
+
+ =$conn['remote_host'];?>
+ |
+
+ =$conn['virtual_addr'];?>
+ |
+
+ =$conn['connect_time'];?>
+ |
+
+ =$conn['bytes_sent'];?>
+ |
+
+ =$conn['bytes_recv'];?>
+ |
+
+
+ |
+
+
+
+
+
+
+
+
+
diff --git a/usr/local/www/status_ovpn.php b/usr/local/www/status_ovpn.php
deleted file mode 100644
index fed06ed50a..0000000000
--- a/usr/local/www/status_ovpn.php
+++ /dev/null
@@ -1,130 +0,0 @@
-#!/usr/local/bin/php
-.
- Copyright (C) 2005-2006 Peter Allgeyer .
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-##|+PRIV
-##|*IDENT=page-status-openvpn
-##|*NAME=Status: OpenVPN page
-##|*DESCR=Allow access to the 'Status: OpenVPN' page.
-##|*MATCH=status_ovpn.php*
-##|-PRIV
-
-
-$pgtitle = array("Status", "OpenVPN");
-require("guiconfig.inc");
-
-$client_list = array();
-$virtip_list = array();
-
-function dump_log($type) {
- global $g, $config;
-
- unset($client_list);
- $client_list = array();
-
- unset($virtip_list);
- $virtip_list = array();
-
- $max = ($type == 'tun') ? 17 : 4;
- for ($i = 0; $i < $max; $i++) {
- if (file_exists("/var/log/openvpn.log")) {
-
- unset($string);
- unset($logarr);
-
- exec("/bin/cat /var/log/openvpn.log", $logarr);
-
- foreach ($logarr as $logent) {
- $logent = preg_split("/,/", $logent, 5);
- $string = preg_split("/:/", $logent[1]);
-
- /* search for ip address in second column */
- if (isset($string[0]) && is_ipaddr($string[0]))
- array_push($client_list, $logent);
-
- /* search for ip address in first column */
- else if (is_ipaddr($logent[0]))
- array_push($virtip_list, $logent);
- }
- }
- }
-
- if (count($client_list > 1)) {
- foreach ($client_list as $cent) {
- echo "\n";
- echo "| " . htmlspecialchars($cent[0]) . " | \n";
- echo "" . htmlspecialchars($cent[1]) . " | \n";
-
- unset($found);
- if (isset($virtip_list)) {
- foreach ($virtip_list as $vent) {
- if ($cent[1] == $vent[2]) {
- $found = 1;
- echo "" . htmlspecialchars($vent[0]) . " | \n";
- }
- }
- }
- if (!isset($found))
- echo "-- | \n";
-
- $date = preg_split("/\s+/", $cent[4]);
- echo "" . htmlspecialchars($date[1]) . " " . htmlspecialchars($date[2]) . " " . htmlspecialchars($date[3]) . " | \n";
- echo "" . htmlspecialchars($cent[2]) . " | \n";
- echo "" . htmlspecialchars($cent[3]) . " | \n";
- echo "
\n";
- }
- }
-}
-
-?>
-
-
-
- |
- OpenVPN server status entries |
-
-
- | Common Name |
- Real Address |
- Virtual Address |
- Connected Since |
- Bytes Received |
- Bytes Sent |
-
-
-
-
-
-Note:
-Please note that status entries are updated once every minute only.
-
-