| 1 |
5b237745
|
Scott Ullrich
|
<?php
|
| 2 |
|
|
/*
|
| 3 |
|
|
vpn_pptp.php
|
| 4 |
|
|
part of m0n0wall (http://m0n0.ch/wall)
|
| 5 |
e2411886
|
Scott Ullrich
|
|
| 6 |
|
|
Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
|
| 7 |
5b237745
|
Scott Ullrich
|
All rights reserved.
|
| 8 |
e2411886
|
Scott Ullrich
|
|
| 9 |
5b237745
|
Scott Ullrich
|
Redistribution and use in source and binary forms, with or without
|
| 10 |
|
|
modification, are permitted provided that the following conditions are met:
|
| 11 |
e2411886
|
Scott Ullrich
|
|
| 12 |
5b237745
|
Scott Ullrich
|
1. Redistributions of source code must retain the above copyright notice,
|
| 13 |
|
|
this list of conditions and the following disclaimer.
|
| 14 |
e2411886
|
Scott Ullrich
|
|
| 15 |
5b237745
|
Scott Ullrich
|
2. Redistributions in binary form must reproduce the above copyright
|
| 16 |
|
|
notice, this list of conditions and the following disclaimer in the
|
| 17 |
|
|
documentation and/or other materials provided with the distribution.
|
| 18 |
e2411886
|
Scott Ullrich
|
|
| 19 |
5b237745
|
Scott Ullrich
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
| 20 |
|
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
| 21 |
|
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
| 22 |
|
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
| 23 |
|
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
| 24 |
|
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
| 25 |
|
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
| 26 |
|
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
| 27 |
|
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
| 28 |
|
|
POSSIBILITY OF SUCH DAMAGE.
|
| 29 |
|
|
*/
|
| 30 |
|
|
|
| 31 |
|
|
require("guiconfig.inc");
|
| 32 |
|
|
|
| 33 |
|
|
if (!is_array($config['pptpd']['radius'])) {
|
| 34 |
|
|
$config['pptpd']['radius'] = array();
|
| 35 |
|
|
}
|
| 36 |
|
|
$pptpcfg = &$config['pptpd'];
|
| 37 |
|
|
|
| 38 |
|
|
$pconfig['remoteip'] = $pptpcfg['remoteip'];
|
| 39 |
|
|
$pconfig['localip'] = $pptpcfg['localip'];
|
| 40 |
|
|
$pconfig['redir'] = $pptpcfg['redir'];
|
| 41 |
|
|
$pconfig['mode'] = $pptpcfg['mode'];
|
| 42 |
10d470b9
|
Scott Ullrich
|
$pconfig['wins'] = $pptpcfg['wins'];
|
| 43 |
5b237745
|
Scott Ullrich
|
$pconfig['req128'] = isset($pptpcfg['req128']);
|
| 44 |
07cae4b2
|
Scott Ullrich
|
$pconfig['n_pptp_units'] = $pptpcfg['n_pptp_units'];
|
| 45 |
|
|
$pconfig['pptp_subnet'] = $pptpcfg['pptp_subnet'];
|
| 46 |
c8c416db
|
Scott Ullrich
|
$pconfig['pptp_dns1'] = $pptpcfg['dns1'];
|
| 47 |
|
|
$pconfig['pptp_dns2'] = $pptpcfg['dns2'];
|
| 48 |
|
|
$pconfig['radiusenable'] = isset($pptpcfg['radius']['enable']);
|
| 49 |
|
|
$pconfig['radiusissueips'] = isset($pptpcfg['radius']['radiusissueips']);
|
| 50 |
|
|
$pconfig['radiussecenable'] = isset($pptpcfg['radius']['server2']['enable']);
|
| 51 |
|
|
$pconfig['radacct_enable'] = isset($pptpcfg['radius']['accounting']);
|
| 52 |
|
|
$pconfig['radiusserver'] = $pptpcfg['radius']['server']['ip'];
|
| 53 |
|
|
$pconfig['radiusserverport'] = $pptpcfg['radius']['server']['port'];
|
| 54 |
|
|
$pconfig['radiusserveracctport'] = $pptpcfg['radius']['server']['acctport'];
|
| 55 |
|
|
$pconfig['radiussecret'] = $pptpcfg['radius']['server']['secret'];
|
| 56 |
|
|
$pconfig['radiusserver2'] = $pptpcfg['radius']['server2']['ip'];
|
| 57 |
|
|
$pconfig['radiusserver2port'] = $pptpcfg['radius']['server2']['port'];
|
| 58 |
|
|
$pconfig['radiusserver2acctport'] = $pptpcfg['radius']['server2']['acctport'];
|
| 59 |
|
|
$pconfig['radiussecret2'] = $pptpcfg['radius']['server2']['secret2'];
|
| 60 |
|
|
$pconfig['radius_acct_update'] = $pptpcfg['radius']['acct_update'];
|
| 61 |
|
|
$pconfig['radius_nasip'] = $pptpcfg['radius']['nasip'];
|
| 62 |
5b237745
|
Scott Ullrich
|
|
| 63 |
|
|
if ($_POST) {
|
| 64 |
|
|
|
| 65 |
|
|
unset($input_errors);
|
| 66 |
|
|
$pconfig = $_POST;
|
| 67 |
|
|
|
| 68 |
|
|
/* input validation */
|
| 69 |
|
|
if ($_POST['mode'] == "server") {
|
| 70 |
|
|
$reqdfields = explode(" ", "localip remoteip");
|
| 71 |
|
|
$reqdfieldsn = explode(",", "Server address,Remote start address");
|
| 72 |
e2411886
|
Scott Ullrich
|
|
| 73 |
5b237745
|
Scott Ullrich
|
if ($_POST['radiusenable']) {
|
| 74 |
|
|
$reqdfields = array_merge($reqdfields, explode(" ", "radiusserver radiussecret"));
|
| 75 |
e2411886
|
Scott Ullrich
|
$reqdfieldsn = array_merge($reqdfieldsn,
|
| 76 |
5b237745
|
Scott Ullrich
|
explode(",", "RADIUS server address,RADIUS shared secret"));
|
| 77 |
|
|
}
|
| 78 |
e2411886
|
Scott Ullrich
|
|
| 79 |
5b237745
|
Scott Ullrich
|
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
|
| 80 |
e2411886
|
Scott Ullrich
|
|
| 81 |
5b237745
|
Scott Ullrich
|
if (($_POST['localip'] && !is_ipaddr($_POST['localip']))) {
|
| 82 |
|
|
$input_errors[] = "A valid server address must be specified.";
|
| 83 |
|
|
}
|
| 84 |
|
|
if (($_POST['subnet'] && !is_ipaddr($_POST['remoteip']))) {
|
| 85 |
|
|
$input_errors[] = "A valid remote start address must be specified.";
|
| 86 |
|
|
}
|
| 87 |
|
|
if (($_POST['radiusserver'] && !is_ipaddr($_POST['radiusserver']))) {
|
| 88 |
|
|
$input_errors[] = "A valid RADIUS server address must be specified.";
|
| 89 |
|
|
}
|
| 90 |
e2411886
|
Scott Ullrich
|
|
| 91 |
|
|
if (!$input_errors) {
|
| 92 |
5b237745
|
Scott Ullrich
|
$_POST['remoteip'] = $pconfig['remoteip'] = gen_subnet($_POST['remoteip'], $g['pptp_subnet']);
|
| 93 |
|
|
$subnet_start = ip2long($_POST['remoteip']);
|
| 94 |
|
|
$subnet_end = ip2long($_POST['remoteip']) + $g['n_pptp_units'] - 1;
|
| 95 |
e2411886
|
Scott Ullrich
|
|
| 96 |
|
|
if ((ip2long($_POST['localip']) >= $subnet_start) &&
|
| 97 |
5b237745
|
Scott Ullrich
|
(ip2long($_POST['localip']) <= $subnet_end)) {
|
| 98 |
e2411886
|
Scott Ullrich
|
$input_errors[] = "The specified server address lies in the remote subnet.";
|
| 99 |
5b237745
|
Scott Ullrich
|
}
|
| 100 |
|
|
if ($_POST['localip'] == $config['interfaces']['lan']['ipaddr']) {
|
| 101 |
e2411886
|
Scott Ullrich
|
$input_errors[] = "The specified server address is equal to the LAN interface address.";
|
| 102 |
5b237745
|
Scott Ullrich
|
}
|
| 103 |
|
|
}
|
| 104 |
|
|
} else if ($_POST['mode'] == "redir") {
|
| 105 |
|
|
$reqdfields = explode(" ", "redir");
|
| 106 |
|
|
$reqdfieldsn = explode(",", "PPTP redirection target address");
|
| 107 |
e2411886
|
Scott Ullrich
|
|
| 108 |
5b237745
|
Scott Ullrich
|
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
|
| 109 |
e2411886
|
Scott Ullrich
|
|
| 110 |
5b237745
|
Scott Ullrich
|
if (($_POST['redir'] && !is_ipaddr($_POST['redir']))) {
|
| 111 |
|
|
$input_errors[] = "A valid target address must be specified.";
|
| 112 |
|
|
}
|
| 113 |
64cc8755
|
Scott Ullrich
|
} else {
|
| 114 |
|
|
/* turning pptp off, lets dump any custom rules */
|
| 115 |
|
|
$rules = &$config['filter']['rule'];
|
| 116 |
|
|
for($x=0; $x<count($rules); $x++) {
|
| 117 |
|
|
if($rules[$x]['interface'] == "pptp") {
|
| 118 |
|
|
unset($rules[$x]);
|
| 119 |
|
|
}
|
| 120 |
|
|
}
|
| 121 |
963d012d
|
Scott Ullrich
|
unset($config['pptpd']['mode']);
|
| 122 |
07cae4b2
|
Scott Ullrich
|
|
| 123 |
64cc8755
|
Scott Ullrich
|
write_config();
|
| 124 |
5b237745
|
Scott Ullrich
|
}
|
| 125 |
|
|
|
| 126 |
|
|
if (!$input_errors) {
|
| 127 |
|
|
$pptpcfg['remoteip'] = $_POST['remoteip'];
|
| 128 |
|
|
$pptpcfg['redir'] = $_POST['redir'];
|
| 129 |
c8c416db
|
Scott Ullrich
|
$pptpcfg['localip'] = $_POST['localip'];
|
| 130 |
5b237745
|
Scott Ullrich
|
$pptpcfg['mode'] = $_POST['mode'];
|
| 131 |
10d470b9
|
Scott Ullrich
|
$pptpcfg['wins'] = $_POST['wins'];
|
| 132 |
07cae4b2
|
Scott Ullrich
|
$pptpcfg['n_pptp_units'] = $_POST['n_pptp_units'];
|
| 133 |
|
|
$pptpcfg['pptp_subnet'] = $_POST['pptp_subnet'];
|
| 134 |
c8c416db
|
Scott Ullrich
|
$pptpcfg['radius']['server']['ip'] = $_POST['radiusserver'];
|
| 135 |
|
|
$pptpcfg['radius']['server']['port'] = $_POST['radiusserverport'];
|
| 136 |
|
|
$pptpcfg['radius']['server']['acctport'] = $_POST['radiusserveracctport'];
|
| 137 |
|
|
$pptpcfg['radius']['server']['secret'] = $_POST['radiussecret'];
|
| 138 |
|
|
$pptpcfg['radius']['server2']['ip'] = $_POST['radiusserver2'];
|
| 139 |
|
|
$pptpcfg['radius']['server2']['port'] = $_POST['radiusserver2port'];
|
| 140 |
|
|
$pptpcfg['radius']['server2']['acctport'] = $_POST['radiusserver2acctport'];
|
| 141 |
|
|
$pptpcfg['radius']['server2']['secret2'] = $_POST['radiussecret2'];
|
| 142 |
|
|
$pptpcfg['radius']['nasip'] = $_POST['radius_nasip'];
|
| 143 |
|
|
$pptpcfg['radius']['acct_update'] = $_POST['radius_acct_update'];
|
| 144 |
|
|
|
| 145 |
|
|
if ($_POST['pptp_dns1'] == "")
|
| 146 |
|
|
unset($pptpcfg['dns1']);
|
| 147 |
|
|
else
|
| 148 |
|
|
$pptpcfg['dns1'] = $_POST['pptp_dns1'];
|
| 149 |
|
|
|
| 150 |
|
|
if ($_POST['pptp_dns2'] == "")
|
| 151 |
|
|
unset($pptpcfg['dns2']);
|
| 152 |
|
|
else
|
| 153 |
|
|
$pptpcfg['dns2'] = $_POST['pptp_dns2'];
|
| 154 |
33eaec88
|
Scott Ullrich
|
|
| 155 |
|
|
if($_POST['req128'] == "yes")
|
| 156 |
|
|
$pptpcfg['req128'] = true;
|
| 157 |
|
|
else
|
| 158 |
|
|
unset($pptpcfg['req128']);
|
| 159 |
|
|
|
| 160 |
|
|
if($_POST['radiusenable'] == "yes")
|
| 161 |
c8c416db
|
Scott Ullrich
|
$pptpcfg['radius']['server']['enable'] = true;
|
| 162 |
33eaec88
|
Scott Ullrich
|
else
|
| 163 |
c8c416db
|
Scott Ullrich
|
unset($pptpcfg['radius']['server']['enable']);
|
| 164 |
e2411886
|
Scott Ullrich
|
|
| 165 |
07cae4b2
|
Scott Ullrich
|
if($_POST['radiussecenable'] == "yes")
|
| 166 |
c8c416db
|
Scott Ullrich
|
$pptpcfg['radius']['server']['enable'] = true;
|
| 167 |
07cae4b2
|
Scott Ullrich
|
else
|
| 168 |
c8c416db
|
Scott Ullrich
|
unset($pptpcfg['radius']['server2']['enable']);
|
| 169 |
07cae4b2
|
Scott Ullrich
|
|
| 170 |
33eaec88
|
Scott Ullrich
|
if($_POST['radacct_enable'] == "yes")
|
| 171 |
|
|
$pptpcfg['radius']['accounting'] = true;
|
| 172 |
|
|
else
|
| 173 |
|
|
unset($pptpcfg['radius']['accounting']);
|
| 174 |
|
|
|
| 175 |
07cae4b2
|
Scott Ullrich
|
if($_POST['radiusissueips'] == "yes") {
|
| 176 |
|
|
$pptpcfg['radius']['radiusissueips'] = true;
|
| 177 |
|
|
} else
|
| 178 |
|
|
unset($pptpcfg['radius']['radiusissueips']);
|
| 179 |
|
|
|
| 180 |
5b237745
|
Scott Ullrich
|
write_config();
|
| 181 |
e2411886
|
Scott Ullrich
|
|
| 182 |
5b237745
|
Scott Ullrich
|
$retval = 0;
|
| 183 |
3851094f
|
Scott Ullrich
|
|
| 184 |
|
|
config_lock();
|
| 185 |
88964924
|
Scott Ullrich
|
$retval = vpn_setup();
|
| 186 |
3851094f
|
Scott Ullrich
|
config_unlock();
|
| 187 |
|
|
|
| 188 |
5b237745
|
Scott Ullrich
|
$savemsg = get_std_save_message($retval);
|
| 189 |
34947a64
|
Scott Ullrich
|
|
| 190 |
|
|
filter_configure();
|
| 191 |
5b237745
|
Scott Ullrich
|
}
|
| 192 |
|
|
}
|
| 193 |
4df96eff
|
Scott Ullrich
|
|
| 194 |
57a2e25f
|
Scott Ullrich
|
$pgtitle = array("VPN","VPN PPTP");
|
| 195 |
4df96eff
|
Scott Ullrich
|
include("head.inc");
|
| 196 |
|
|
|
| 197 |
5b237745
|
Scott Ullrich
|
?>
|
| 198 |
422f27c0
|
Scott Ullrich
|
|
| 199 |
|
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
| 200 |
e2411886
|
Scott Ullrich
|
<?php include("fbegin.inc"); ?>
|
| 201 |
5b237745
|
Scott Ullrich
|
<script language="JavaScript">
|
| 202 |
|
|
<!--
|
| 203 |
|
|
function get_radio_value(obj)
|
| 204 |
|
|
{
|
| 205 |
|
|
for (i = 0; i < obj.length; i++) {
|
| 206 |
|
|
if (obj[i].checked)
|
| 207 |
|
|
return obj[i].value;
|
| 208 |
|
|
}
|
| 209 |
|
|
return null;
|
| 210 |
|
|
}
|
| 211 |
|
|
|
| 212 |
|
|
function enable_change(enable_over) {
|
| 213 |
|
|
if ((get_radio_value(document.iform.mode) == "server") || enable_over) {
|
| 214 |
|
|
document.iform.remoteip.disabled = 0;
|
| 215 |
|
|
document.iform.localip.disabled = 0;
|
| 216 |
|
|
document.iform.req128.disabled = 0;
|
| 217 |
|
|
document.iform.radiusenable.disabled = 0;
|
| 218 |
a35c2033
|
Martin Fuchs
|
document.iform.radiusissueips.disabled = 0;
|
| 219 |
4dd1d9af
|
Scott Ullrich
|
document.iform.wins.disabled = 0;
|
| 220 |
07cae4b2
|
Scott Ullrich
|
document.iform.n_pptp_units.disabled = 0;
|
| 221 |
|
|
document.iform.pptp_subnet.disabled = 0;
|
| 222 |
c8c416db
|
Scott Ullrich
|
document.iform.pptp_dns1.disabled = 0;
|
| 223 |
|
|
document.iform.pptp_dns2.disabled = 0;
|
| 224 |
e2411886
|
Scott Ullrich
|
|
| 225 |
5b237745
|
Scott Ullrich
|
if (document.iform.radiusenable.checked || enable_over) {
|
| 226 |
07cae4b2
|
Scott Ullrich
|
document.iform.radiussecenable.disabled = 0;
|
| 227 |
5b237745
|
Scott Ullrich
|
document.iform.radacct_enable.disabled = 0;
|
| 228 |
|
|
document.iform.radiusserver.disabled = 0;
|
| 229 |
c8c416db
|
Scott Ullrich
|
document.iform.radiusserverport.disabled = 0;
|
| 230 |
|
|
document.iform.radiusserveracctport.disabled = 0;
|
| 231 |
5b237745
|
Scott Ullrich
|
document.iform.radiussecret.disabled = 0;
|
| 232 |
07cae4b2
|
Scott Ullrich
|
document.iform.radius_nasip.disabled = 0;
|
| 233 |
|
|
document.iform.radius_acct_update.disabled = 0;
|
| 234 |
|
|
document.iform.radiusissueips.disabled = 0;
|
| 235 |
c8c416db
|
Scott Ullrich
|
if (document.iform.radiussecenable.checked || enable_over) {
|
| 236 |
|
|
document.iform.radiusserver2.disabled = 0;
|
| 237 |
|
|
document.iform.radiussecret2.disabled = 0;
|
| 238 |
|
|
document.iform.radiusserver2port.disabled = 0;
|
| 239 |
|
|
document.iform.radiusserver2acctport.disabled = 0;
|
| 240 |
|
|
} else {
|
| 241 |
|
|
|
| 242 |
|
|
document.iform.radiusserver2.disabled = 1;
|
| 243 |
|
|
document.iform.radiussecret2.disabled = 1;
|
| 244 |
|
|
document.iform.radiusserver2port.disabled = 1;
|
| 245 |
|
|
document.iform.radiusserver2acctport.disabled = 1;
|
| 246 |
|
|
}
|
| 247 |
5b237745
|
Scott Ullrich
|
} else {
|
| 248 |
|
|
document.iform.radacct_enable.disabled = 1;
|
| 249 |
|
|
document.iform.radiusserver.disabled = 1;
|
| 250 |
c8c416db
|
Scott Ullrich
|
document.iform.radiusserverport.disabled = 1;
|
| 251 |
a35c2033
|
Martin Fuchs
|
document.iform.radiusissueips.disabled = 1;
|
| 252 |
c8c416db
|
Scott Ullrich
|
document.iform.radiusserveracctport.disabled = 1;
|
| 253 |
5b237745
|
Scott Ullrich
|
document.iform.radiussecret.disabled = 1;
|
| 254 |
07cae4b2
|
Scott Ullrich
|
document.iform.radius_nasip.disabled = 1;
|
| 255 |
|
|
document.iform.radius_acct_update.disabled = 1;
|
| 256 |
|
|
document.iform.radiusissueips.disabled = 1;
|
| 257 |
|
|
}
|
| 258 |
|
|
|
| 259 |
5b237745
|
Scott Ullrich
|
} else {
|
| 260 |
|
|
document.iform.remoteip.disabled = 1;
|
| 261 |
|
|
document.iform.localip.disabled = 1;
|
| 262 |
|
|
document.iform.req128.disabled = 1;
|
| 263 |
07cae4b2
|
Scott Ullrich
|
document.iform.n_pptp_units.disabled = 1;
|
| 264 |
|
|
document.iform.pptp_subnet.disabled = 1;
|
| 265 |
c8c416db
|
Scott Ullrich
|
document.iform.pptp_dns1.disabled = 1;
|
| 266 |
|
|
document.iform.pptp_dns2.disabled = 1;
|
| 267 |
5b237745
|
Scott Ullrich
|
document.iform.radiusenable.disabled = 1;
|
| 268 |
|
|
document.iform.radacct_enable.disabled = 1;
|
| 269 |
|
|
document.iform.radiusserver.disabled = 1;
|
| 270 |
c8c416db
|
Scott Ullrich
|
document.iform.radiusserverport.disabled = 1;
|
| 271 |
a35c2033
|
Martin Fuchs
|
document.iform.radiusissueips.disabled = 1;
|
| 272 |
c8c416db
|
Scott Ullrich
|
document.iform.radiusserveracctport.disabled = 1;
|
| 273 |
5b237745
|
Scott Ullrich
|
document.iform.radiussecret.disabled = 1;
|
| 274 |
07cae4b2
|
Scott Ullrich
|
document.iform.radius_nasip.disabled = 1;
|
| 275 |
|
|
document.iform.radius_acct_update.disabled = 1;
|
| 276 |
|
|
document.iform.radiussecenable.disabled = 1;
|
| 277 |
|
|
document.iform.radiusserver2.disabled = 1;
|
| 278 |
c8c416db
|
Scott Ullrich
|
document.iform.radiusserver2port.disabled = 1;
|
| 279 |
|
|
document.iform.radiusserver2acctport.disabled = 1;
|
| 280 |
07cae4b2
|
Scott Ullrich
|
document.iform.radiussecret2.disabled = 1;
|
| 281 |
4dd1d9af
|
Scott Ullrich
|
document.iform.wins.disabled = 1;
|
| 282 |
07cae4b2
|
Scott Ullrich
|
document.iform.radiusissueips.disabled = 1;
|
| 283 |
5b237745
|
Scott Ullrich
|
}
|
| 284 |
|
|
if ((get_radio_value(document.iform.mode) == "redir") || enable_over) {
|
| 285 |
|
|
document.iform.redir.disabled = 0;
|
| 286 |
|
|
} else {
|
| 287 |
|
|
document.iform.redir.disabled = 1;
|
| 288 |
|
|
}
|
| 289 |
|
|
}
|
| 290 |
|
|
//-->
|
| 291 |
|
|
</script>
|
| 292 |
|
|
<form action="vpn_pptp.php" method="post" name="iform" id="iform">
|
| 293 |
|
|
<?php if ($input_errors) print_input_errors($input_errors); ?>
|
| 294 |
|
|
<?php if ($savemsg) print_info_box($savemsg); ?>
|
| 295 |
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
| 296 |
e2411886
|
Scott Ullrich
|
<tr><td class="tabnavtbl">
|
| 297 |
17982382
|
Scott Ullrich
|
<?php
|
| 298 |
|
|
$tab_array = array();
|
| 299 |
|
|
$tab_array[0] = array("Configuration", true, "vpn_pptp.php");
|
| 300 |
|
|
$tab_array[1] = array("Users", false, "vpn_pptp_users.php");
|
| 301 |
|
|
display_top_tabs($tab_array);
|
| 302 |
|
|
?>
|
| 303 |
5b237745
|
Scott Ullrich
|
</td></tr>
|
| 304 |
e2411886
|
Scott Ullrich
|
<tr>
|
| 305 |
96f8c1e2
|
Bill Marquette
|
<td>
|
| 306 |
|
|
<div id="mainarea">
|
| 307 |
|
|
<table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
|
| 308 |
e2411886
|
Scott Ullrich
|
<tr>
|
| 309 |
5b237745
|
Scott Ullrich
|
<td width="22%" valign="top" class="vtable"> </td>
|
| 310 |
e2411886
|
Scott Ullrich
|
<td width="78%" class="vtable">
|
| 311 |
5b237745
|
Scott Ullrich
|
<input name="mode" type="radio" onclick="enable_change(false)" value="off"
|
| 312 |
|
|
<?php if (($pconfig['mode'] != "server") && ($pconfig['mode'] != "redir")) echo "checked";?>>
|
| 313 |
|
|
Off</td>
|
| 314 |
e2411886
|
Scott Ullrich
|
<tr>
|
| 315 |
5b237745
|
Scott Ullrich
|
<td width="22%" valign="top" class="vtable"> </td>
|
| 316 |
|
|
<td width="78%" class="vtable">
|
| 317 |
c8c416db
|
Scott Ullrich
|
<input type="radio" name="mode" value="redir" onclick="enable_change(false)" <?php if ($pconfig['mode'] == "redir") echo "checked"; ?>>
|
| 318 |
5b237745
|
Scott Ullrich
|
Redirect incoming PPTP connections to:</td>
|
| 319 |
e2411886
|
Scott Ullrich
|
<tr>
|
| 320 |
5b237745
|
Scott Ullrich
|
<td width="22%" valign="top" class="vncellreq">PPTP redirection</td>
|
| 321 |
e2411886
|
Scott Ullrich
|
<td width="78%" class="vtable">
|
| 322 |
b5c78501
|
Seth Mos
|
<?=$mandfldhtml;?><input name="redir" type="text" class="formfld unknown" id="redir" size="20" value="<?=htmlspecialchars($pconfig['redir']);?>">
|
| 323 |
5b237745
|
Scott Ullrich
|
<br>
|
| 324 |
e2411886
|
Scott Ullrich
|
Enter the IP address of a host which will accept incoming
|
| 325 |
5b237745
|
Scott Ullrich
|
PPTP connections.</td>
|
| 326 |
e2411886
|
Scott Ullrich
|
<tr>
|
| 327 |
5b237745
|
Scott Ullrich
|
<td width="22%" valign="top" class="vtable"> </td>
|
| 328 |
|
|
<td width="78%" class="vtable">
|
| 329 |
c8c416db
|
Scott Ullrich
|
<input type="radio" name="mode" value="server" onclick="enable_change(false)" <?php if ($pconfig['mode'] == "server") echo "checked"; ?>>
|
| 330 |
5b237745
|
Scott Ullrich
|
Enable PPTP server</td>
|
| 331 |
c8c416db
|
Scott Ullrich
|
</tr>
|
| 332 |
e2411886
|
Scott Ullrich
|
<tr>
|
| 333 |
5b237745
|
Scott Ullrich
|
<td width="22%" valign="top" class="vncellreq">Server address</td>
|
| 334 |
e2411886
|
Scott Ullrich
|
<td width="78%" class="vtable">
|
| 335 |
b5c78501
|
Seth Mos
|
<?=$mandfldhtml;?><input name="localip" type="text" class="formfld unknown" id="localip" size="20" value="<?=htmlspecialchars($pconfig['localip']);?>">
|
| 336 |
5b237745
|
Scott Ullrich
|
<br>
|
| 337 |
e2411886
|
Scott Ullrich
|
Enter the IP address the PPTP server should use on its side
|
| 338 |
5b237745
|
Scott Ullrich
|
for all clients.</td>
|
| 339 |
|
|
</tr>
|
| 340 |
e2411886
|
Scott Ullrich
|
<tr>
|
| 341 |
|
|
<td width="22%" valign="top" class="vncellreq">Remote address
|
| 342 |
5b237745
|
Scott Ullrich
|
range</td>
|
| 343 |
e2411886
|
Scott Ullrich
|
<td width="78%" class="vtable">
|
| 344 |
b5c78501
|
Seth Mos
|
<?=$mandfldhtml;?><input name="remoteip" type="text" class="formfld unknown" id="remoteip" size="20" value="<?=htmlspecialchars($pconfig['remoteip']);?>">
|
| 345 |
5b237745
|
Scott Ullrich
|
<br>
|
| 346 |
|
|
Specify the starting address for the client IP address subnet.<br>
|
| 347 |
07cae4b2
|
Scott Ullrich
|
</tr>
|
| 348 |
|
|
<tr>
|
| 349 |
|
|
<td width="22%" valign="top" class="vncellreq">Subnet netmask</td>
|
| 350 |
|
|
<td width="78%" class="vtable">
|
| 351 |
|
|
<select id="pptp_subnet" name="pptp_subnet">
|
| 352 |
|
|
<?php
|
| 353 |
|
|
for($x=0; $x<33; $x++) {
|
| 354 |
|
|
if($x == $pconfig['pptp_subnet'])
|
| 355 |
|
|
$SELECTED = " SELECTED";
|
| 356 |
|
|
else
|
| 357 |
|
|
$SELECTED = "";
|
| 358 |
|
|
echo "<option value=\"{$x}\"{$SELECTED}>{$x}</option>\n";
|
| 359 |
|
|
}
|
| 360 |
|
|
?>
|
| 361 |
|
|
</select>
|
| 362 |
|
|
<br>Hint: 24 is 255.255.255.0
|
| 363 |
|
|
</td>
|
| 364 |
|
|
</tr>
|
| 365 |
|
|
<tr>
|
| 366 |
|
|
<td width="22%" valign="top" class="vncellreq">No. PPTP users</td>
|
| 367 |
|
|
<td width="78%" class="vtable">
|
| 368 |
|
|
<select id="n_pptp_units" name="n_pptp_units">
|
| 369 |
|
|
<?php
|
| 370 |
|
|
for($x=0; $x<255; $x++) {
|
| 371 |
|
|
if($x == $pconfig['n_pptp_units'])
|
| 372 |
|
|
$SELECTED = " SELECTED";
|
| 373 |
|
|
else
|
| 374 |
|
|
$SELECTED = "";
|
| 375 |
|
|
echo "<option value=\"{$x}\"{$SELECTED}>{$x}</option>\n";
|
| 376 |
|
|
}
|
| 377 |
|
|
?>
|
| 378 |
|
|
</select>
|
| 379 |
|
|
<br>Hint: 10 is TEN pptp clients
|
| 380 |
|
|
</td>
|
| 381 |
5b237745
|
Scott Ullrich
|
</tr>
|
| 382 |
c8c416db
|
Scott Ullrich
|
<tr>
|
| 383 |
|
|
<td width="22%" valign="top" class="vncellreq">PPTP DNS Servers</td>
|
| 384 |
|
|
<td width="78%" class="vtable">
|
| 385 |
b5c78501
|
Seth Mos
|
<?=$mandfldhtml;?><input name="pptp_dns1" type="text" class="formfld unknown" id="pptp_dns1" size="20" value="<?=htmlspecialchars($pconfig['pptp_dns1']);?>">
|
| 386 |
c8c416db
|
Scott Ullrich
|
<br>
|
| 387 |
b5c78501
|
Seth Mos
|
<input name="pptp_dns2" type="text" class="formfld unknown" id="pptp_dns2" size="20" value="<?=htmlspecialchars($pconfig['pptp_dns2']);?>">
|
| 388 |
c8c416db
|
Scott Ullrich
|
<br>
|
| 389 |
|
|
|
| 390 |
|
|
primary and secondary dns servers for pptp clients<br>
|
| 391 |
|
|
</tr>
|
| 392 |
a35c2033
|
Martin Fuchs
|
<tr>
|
| 393 |
|
|
<td width="22%" valign="top" class="vncell">RADIUS issued IP's</td>
|
| 394 |
|
|
<td width="78%" valign="top" class="vtable">
|
| 395 |
|
|
<input name="radiusissueips" value="yes" type="checkbox" class="formfld" id="radiusissueips"<?php if(isset($pconfig['radiusissueips'])) echo " checked=\"checked\""; ?> />
|
| 396 |
|
|
</td>
|
| 397 |
|
|
</tr>
|
| 398 |
c8c416db
|
Scott Ullrich
|
<tr>
|
| 399 |
|
|
<td width="22%" valign="top" class="vncell">WINS Server</td>
|
| 400 |
|
|
<td width="78%" valign="top" class="vtable">
|
| 401 |
b5c78501
|
Seth Mos
|
<input name="wins" class="formfld unknown" id="wins" size="20" value="<?=htmlspecialchars($pconfig['wins']);?>">
|
| 402 |
c8c416db
|
Scott Ullrich
|
</td>
|
| 403 |
|
|
</tr>
|
| 404 |
e2411886
|
Scott Ullrich
|
<tr>
|
| 405 |
5b237745
|
Scott Ullrich
|
<td width="22%" valign="top" class="vncell">RADIUS</td>
|
| 406 |
e2411886
|
Scott Ullrich
|
<td width="78%" class="vtable">
|
| 407 |
|
|
<input name="radiusenable" type="checkbox" id="radiusenable" onclick="enable_change(false)" value="yes" <?php if ($pconfig['radiusenable']) echo "checked"; ?>>
|
| 408 |
c8c416db
|
Scott Ullrich
|
<strong>Use a RADIUS server for authentication</strong><br>
|
| 409 |
|
|
When set, all users will be authenticated using
|
| 410 |
e2411886
|
Scott Ullrich
|
the RADIUS server specified below. The local user database
|
| 411 |
5b237745
|
Scott Ullrich
|
will not be used.<br>
|
| 412 |
|
|
<br>
|
| 413 |
e2411886
|
Scott Ullrich
|
<input name="radacct_enable" type="checkbox" id="radacct_enable" onclick="enable_change(false)" value="yes" <?php if ($pconfig['radacct_enable']) echo "checked"; ?>>
|
| 414 |
5b237745
|
Scott Ullrich
|
<strong>Enable RADIUS accounting <br>
|
| 415 |
c8c416db
|
Scott Ullrich
|
</strong>Sends accounting packets to the RADIUS server.<br>
|
| 416 |
|
|
<br>
|
| 417 |
|
|
<input name="radiussecenable" type="checkbox" id="radiussecenable" onclick="enable_change(false)" value="yes" <?php if ($pconfig['radiussecenable']) echo "checked"; ?>>
|
| 418 |
|
|
<strong>backup RADIUS server for failover authentication</strong><br>
|
| 419 |
|
|
When set, if primary radius fails all request will go to the backup server</td>
|
| 420 |
|
|
</tr>
|
| 421 |
|
|
<tr>
|
| 422 |
|
|
<td width="22%" valign="top" class="vncell">Radius NAS IP</td>
|
| 423 |
|
|
<td width="78%" valign="top" class="vtable">
|
| 424 |
b5c78501
|
Seth Mos
|
<input name="radius_nasip" class="formfld unknown" id="radius_nasip" size="20" value="<?=htmlspecialchars($pconfig['radius_nasip']);?>">
|
| 425 |
c8c416db
|
Scott Ullrich
|
</td>
|
| 426 |
|
|
</tr>
|
| 427 |
|
|
<tr>
|
| 428 |
|
|
<td width="22%" valign="top" class="vncell">Radius Accounting Update</td>
|
| 429 |
|
|
<td width="78%" valign="top" class="vtable">
|
| 430 |
b5c78501
|
Seth Mos
|
<input name="radius_acct_update" class="formfld unknown" id="radius_acct_update" size="20" value="<?=htmlspecialchars($pconfig['radius_acct_update']);?>">
|
| 431 |
c8c416db
|
Scott Ullrich
|
</td>
|
| 432 |
|
|
</tr>
|
| 433 |
|
|
<tr>
|
| 434 |
|
|
<td width="22%" valign="top" class="vncell">RADIUS issued IP's</td>
|
| 435 |
|
|
<td width="78%" valign="top" class="vtable">
|
| 436 |
|
|
<input name="radiusissueips" value="yes" type="checkbox" class="formfld" id="radiusissueips"<?php if($pconfig['radiusissueips']) echo " CHECKED"; ?>>
|
| 437 |
|
|
<br>Issue IP Addresses via RADIUS server.
|
| 438 |
|
|
</td>
|
| 439 |
5b237745
|
Scott Ullrich
|
</tr>
|
| 440 |
e2411886
|
Scott Ullrich
|
<tr>
|
| 441 |
5b237745
|
Scott Ullrich
|
<td width="22%" valign="top" class="vncell">RADIUS server </td>
|
| 442 |
78cf56c6
|
Scott Ullrich
|
<td width="78%" class="vtable">
|
| 443 |
b5c78501
|
Seth Mos
|
<input name="radiusserver" type="text" class="formfld unknown" id="radiusserver" size="20" value="<?=htmlspecialchars($pconfig['radiusserver']);?>">
|
| 444 |
|
|
<input name="radiusserverport" type="text" class="formfld unknown" id="radiusserverport" size="4" value="<?=htmlspecialchars($pconfig['radiusserverport']);?>">
|
| 445 |
|
|
<input name="radiusserveracctport" type="text" class="formfld unknown" id="radiusserveracctport" size="4" value="<?=htmlspecialchars($pconfig['radiusserveracctport']);?>">
|
| 446 |
5b237745
|
Scott Ullrich
|
<br>
|
| 447 |
e2411886
|
Scott Ullrich
|
Enter the IP address of the RADIUS server.</td>
|
| 448 |
5b237745
|
Scott Ullrich
|
</tr>
|
| 449 |
e2411886
|
Scott Ullrich
|
<tr>
|
| 450 |
5b237745
|
Scott Ullrich
|
<td width="22%" valign="top" class="vncell">RADIUS shared secret</td>
|
| 451 |
78cf56c6
|
Scott Ullrich
|
<td width="78%" valign="top" class="vtable">
|
| 452 |
b5c78501
|
Seth Mos
|
<input name="radiussecret" type="password" class="formfld pwd" id="radiussecret" size="20" value="<?=htmlspecialchars($pconfig['radiussecret']);?>">
|
| 453 |
5b237745
|
Scott Ullrich
|
<br>
|
| 454 |
e2411886
|
Scott Ullrich
|
Enter the shared secret that will be used to authenticate
|
| 455 |
|
|
to the RADIUS server.</td>
|
| 456 |
07cae4b2
|
Scott Ullrich
|
</tr>
|
| 457 |
|
|
<tr>
|
| 458 |
|
|
<td width="22%" valign="top" class="vncell">BACKUP RADIUS server </td>
|
| 459 |
|
|
<td width="78%" class="vtable">
|
| 460 |
b5c78501
|
Seth Mos
|
<input name="radiusserver2" type="text" class="formfld unknown" id="radiusserver2" size="20" value="<?=htmlspecialchars($pconfig['radiusserver2']);?>">
|
| 461 |
|
|
<input name="radiusserver2port" type="text" class="formfld unknown" id="radiusserver2port" size="4" value="<?=htmlspecialchars($pconfig['radiusserver2port']);?>">
|
| 462 |
|
|
<input name="radiusserver2acctport" type="text" class="formfld unknown" id="radiusserver2acctport" size="4" value="<?=htmlspecialchars($pconfig['radiusserver2acctport']);?>">
|
| 463 |
07cae4b2
|
Scott Ullrich
|
<br>
|
| 464 |
|
|
Enter the IP address of the RADIUS server.</td>
|
| 465 |
|
|
</tr>
|
| 466 |
|
|
<tr>
|
| 467 |
|
|
<td width="22%" valign="top" class="vncell">BACKUP RADIUS shared secret</td>
|
| 468 |
|
|
<td width="78%" valign="top" class="vtable">
|
| 469 |
b5c78501
|
Seth Mos
|
<input name="radiussecret2" type="password" class="formfld pwd" id="radiussecret2" size="20" value="<?=htmlspecialchars($pconfig['radiussecret2']);?>">
|
| 470 |
07cae4b2
|
Scott Ullrich
|
<br>
|
| 471 |
|
|
Enter the shared secret that will be used to authenticate
|
| 472 |
|
|
to the RADIUS server.</td>
|
| 473 |
|
|
</tr>
|
| 474 |
e2411886
|
Scott Ullrich
|
<tr>
|
| 475 |
5b237745
|
Scott Ullrich
|
<td height="16" colspan="2" valign="top"></td>
|
| 476 |
|
|
</tr>
|
| 477 |
e2411886
|
Scott Ullrich
|
<tr>
|
| 478 |
5b237745
|
Scott Ullrich
|
<td width="22%" valign="middle"> </td>
|
| 479 |
e2411886
|
Scott Ullrich
|
<td width="78%" class="vtable">
|
| 480 |
|
|
<input name="req128" type="checkbox" id="req128" value="yes" <?php if ($pconfig['req128']) echo "checked"; ?>>
|
| 481 |
5b237745
|
Scott Ullrich
|
<strong>Require 128-bit encryption</strong><br>
|
| 482 |
e2411886
|
Scott Ullrich
|
When set, 128-bit encryption will be accepted. Otherwise,
|
| 483 |
|
|
40-bit and 56-bit encryption will be accepted, too. Note that
|
| 484 |
|
|
encryption will always be forced on PPTP connections (i.e.
|
| 485 |
5b237745
|
Scott Ullrich
|
unencrypted connections will not be accepted).</td>
|
| 486 |
|
|
</tr>
|
| 487 |
e2411886
|
Scott Ullrich
|
<tr>
|
| 488 |
5b237745
|
Scott Ullrich
|
<td width="22%" valign="top"> </td>
|
| 489 |
e2411886
|
Scott Ullrich
|
<td width="78%">
|
| 490 |
|
|
<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
|
| 491 |
5b237745
|
Scott Ullrich
|
</td>
|
| 492 |
|
|
</tr>
|
| 493 |
e2411886
|
Scott Ullrich
|
<tr>
|
| 494 |
|
|
<td width="22%" valign="top"> </td>
|
| 495 |
|
|
<td width="78%"><span class="vexpl"><span class="red"><strong>Note:<br>
|
| 496 |
c55a8ab9
|
Holger Bauer
|
</strong></span>don't forget to <a href="firewall_rules.php?if=pptp">add a firewall rule</a> to permit
|
| 497 |
e2411886
|
Scott Ullrich
|
traffic from PPTP clients!</span></td>
|
| 498 |
|
|
</tr>
|
| 499 |
5b237745
|
Scott Ullrich
|
</table>
|
| 500 |
96f8c1e2
|
Bill Marquette
|
</div>
|
| 501 |
e2411886
|
Scott Ullrich
|
</td>
|
| 502 |
5b237745
|
Scott Ullrich
|
</tr>
|
| 503 |
|
|
</table>
|
| 504 |
|
|
</form>
|
| 505 |
|
|
<script language="JavaScript">
|
| 506 |
|
|
<!--
|
| 507 |
|
|
enable_change(false);
|
| 508 |
|
|
//-->
|
| 509 |
|
|
</script>
|
| 510 |
|
|
<?php include("fend.inc"); ?>
|
| 511 |
9999b3aa
|
Scott Ullrich
|
</body>
|
| 512 |
|
|
</html>
|