summaryrefslogtreecommitdiffstats
path: root/usr/local/www/vpn_openvpn_server.php
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@world.inf.org>2013-08-25 23:23:54 -0700
committerPhil Davis <phil.davis@world.inf.org>2013-08-25 23:23:54 -0700
commitfaf61f12deb2ef862be5c3487ea3319bb3aeff0c (patch)
tree1a1a86ffd970474c977fe861fdbdc667b7b634b9 /usr/local/www/vpn_openvpn_server.php
parenta91773bb8c73d95f397cfab84836f601c37f330f (diff)
downloadpfsense-faf61f12deb2ef862be5c3487ea3319bb3aeff0c.zip
pfsense-faf61f12deb2ef862be5c3487ea3319bb3aeff0c.tar.gz
Add option to specify client management port for OpenVPN client export use
See forum http://forum.pfsense.org/index.php/topic,63668.0.html and OpenVPN Manager GitHub discussion https://github.com/jochenwierum/openvpn-manager/issues/17 This allows a different client management port to be specified for use by OpenVPN client export when generating a client config for use with OpenVPN manager. Typically a company could have multiple offices with OpenVPN "road-warrior" access. Some users might need to connect to different offices at different times, so they would have multiple OpenVPN client configs installed on their laptop. For this to work with OpenVPN Manager, each client config needs to have a different management channel - only 1 can use the default of "166". The company can chooose a different number in the road-warrior server "client parameters" section at each office. Then the generated client config from each office will have a unique management channel port number.
Diffstat (limited to 'usr/local/www/vpn_openvpn_server.php')
-rw-r--r--usr/local/www/vpn_openvpn_server.php46
1 files changed, 46 insertions, 0 deletions
diff --git a/usr/local/www/vpn_openvpn_server.php b/usr/local/www/vpn_openvpn_server.php
index 78f08a2..c3addba 100644
--- a/usr/local/www/vpn_openvpn_server.php
+++ b/usr/local/www/vpn_openvpn_server.php
@@ -187,6 +187,10 @@ if($_GET['act']=="edit"){
$pconfig['wins_server2'])
$pconfig['wins_server_enable'] = true;
+ $pconfig['client_mgmt_port'] = $a_server[$id]['client_mgmt_port'];
+ if ($pconfig['client_mgmt_port'])
+ $pconfig['client_mgmt_port_enable'] = true;
+
$pconfig['nbdd_server1'] = $a_server[$id]['nbdd_server1'];
if ($pconfig['nbdd_server1'])
$pconfig['nbdd_server_enable'] = true;
@@ -300,6 +304,11 @@ if ($_POST) {
$input_errors[] = gettext("The field 'NetBIOS Data Distribution Server #1' must contain a valid IP address");
}
+ if ($pconfig['client_mgmt_port_enable']) {
+ if ($result = openvpn_validate_port($pconfig['client_mgmt_port'], 'Client management port'))
+ $input_errors[] = $result;
+ }
+
if ($pconfig['maxclients'] && !is_numeric($pconfig['maxclients']))
$input_errors[] = gettext("The field 'Concurrent connections' must be numeric.");
@@ -425,6 +434,9 @@ if ($_POST) {
$server['nbdd_server1'] = $pconfig['nbdd_server1'];
}
+ if ($pconfig['client_mgmt_port_enable'])
+ $server['client_mgmt_port'] = $pconfig['client_mgmt_port'];
+
if ($_POST['duplicate_cn'] == "yes")
$server['duplicate_cn'] = true;
@@ -607,6 +619,14 @@ function wins_server_change() {
document.getElementById("wins_server_data").style.display="none";
}
+function client_mgmt_port_change() {
+
+ if (document.iform.client_mgmt_port_enable.checked)
+ document.getElementById("client_mgmt_port_data").style.display="";
+ else
+ document.getElementById("client_mgmt_port_data").style.display="none";
+}
+
function ntp_server_change() {
if (document.iform.ntp_server_enable.checked)
@@ -1635,6 +1655,31 @@ if ($savemsg)
</table>
</td>
</tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Client Management Port"); ?></td>
+ <td width="78%" class="vtable">
+ <table border="0" cellpadding="2" cellspacing="0">
+ <tr>
+ <td>
+ <?php set_checked($pconfig['client_mgmt_port_enable'],$chk); ?>
+ <input name="client_mgmt_port_enable" type="checkbox" id="client_mgmt_port_enable" value="yes" <?=$chk;?> onClick="client_mgmt_port_change()">
+ </td>
+ <td>
+ <span class="vexpl">
+ <?=gettext("Use a different management port on clients. The default port is 166. Specify a different port if the client machines need to select from multiple OpenVPN links."); ?><br>
+ </span>
+ </td>
+ </tr>
+ </table>
+ <table border="0" cellpadding="2" cellspacing="0" id="client_mgmt_port_data">
+ <tr>
+ <td>
+ <input name="client_mgmt_port" type="text" class="formfld unknown" id="client_mgmt_port" size="30" value="<?=htmlspecialchars($pconfig['client_mgmt_port']);?>">
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
</table>
<table width="100%" border="0" cellpadding="6" cellspacing="0" id="client_opts">
@@ -1751,6 +1796,7 @@ gwredir_change();
dns_domain_change();
dns_server_change();
wins_server_change();
+client_mgmt_port_change();
ntp_server_change();
netbios_change();
tuntap_change();
OpenPOWER on IntegriCloud