1 |
5656fe23
|
Ermal Lu?i
|
<?php
|
2 |
|
|
/*
|
3 |
|
|
vpn_l2tp.php
|
4 |
|
|
part of pfSense
|
5 |
|
|
|
6 |
|
|
Copyright (C) 2005 Scott Ullrich (sullrich@gmail.com)
|
7 |
|
|
All rights reserved.
|
8 |
|
|
|
9 |
|
|
Redistribution and use in source and binary forms, with or without
|
10 |
|
|
modification, are permitted provided that the following conditions are met:
|
11 |
|
|
|
12 |
|
|
1. Redistributions of source code must retain the above copyright notice,
|
13 |
|
|
this list of conditions and the following disclaimer.
|
14 |
|
|
|
15 |
|
|
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 |
|
|
|
19 |
|
|
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 |
047cb829
|
Ermal Lu?i
|
##|+PRIV
|
32 |
|
|
##|*IDENT=page-vpn-vpnl2tp
|
33 |
|
|
##|*NAME=VPN: VPN L2TP page
|
34 |
|
|
##|*DESCR=Allow access to the 'VPN: VPN L2TP' page.
|
35 |
|
|
##|*MATCH=vpn_l2tp.php*
|
36 |
|
|
##|-PRIV
|
37 |
|
|
|
38 |
5656fe23
|
Ermal Lu?i
|
$pgtitle = array(gettext("VPN"), gettext("L2TP"), gettext("L2TP"));
|
39 |
b32dd0a6
|
jim-p
|
$shortcut_section = "l2tps";
|
40 |
5656fe23
|
Ermal Lu?i
|
|
41 |
|
|
require("guiconfig.inc");
|
42 |
483e6de8
|
Scott Ullrich
|
require_once("vpn.inc");
|
43 |
5656fe23
|
Ermal Lu?i
|
|
44 |
|
|
if (!is_array($config['l2tp']['radius'])) {
|
45 |
|
|
$config['l2tp']['radius'] = array();
|
46 |
|
|
}
|
47 |
|
|
$l2tpcfg = &$config['l2tp'];
|
48 |
|
|
|
49 |
|
|
$pconfig['remoteip'] = $l2tpcfg['remoteip'];
|
50 |
|
|
$pconfig['localip'] = $l2tpcfg['localip'];
|
51 |
a56120f2
|
Ermal Lu?i
|
$pconfig['l2tp_subnet'] = $l2tpcfg['l2tp_subnet'];
|
52 |
5656fe23
|
Ermal Lu?i
|
$pconfig['mode'] = $l2tpcfg['mode'];
|
53 |
|
|
$pconfig['interface'] = $l2tpcfg['interface'];
|
54 |
c8cc0c1c
|
smos
|
$pconfig['l2tp_dns1'] = $l2tpcfg['dns1'];
|
55 |
|
|
$pconfig['l2tp_dns2'] = $l2tpcfg['dns2'];
|
56 |
|
|
$pconfig['wins'] = $l2tpcfg['wins'];
|
57 |
5656fe23
|
Ermal Lu?i
|
$pconfig['radiusenable'] = isset($l2tpcfg['radius']['enable']);
|
58 |
|
|
$pconfig['radacct_enable'] = isset($l2tpcfg['radius']['accounting']);
|
59 |
|
|
$pconfig['radiusserver'] = $l2tpcfg['radius']['server'];
|
60 |
|
|
$pconfig['radiussecret'] = $l2tpcfg['radius']['secret'];
|
61 |
|
|
$pconfig['radiusissueips'] = $l2tpcfg['radius']['radiusissueips'];
|
62 |
|
|
$pconfig['n_l2tp_units'] = $l2tpcfg['n_l2tp_units'];
|
63 |
|
|
$pconfig['paporchap'] = $l2tpcfg['paporchap'];
|
64 |
40de0b13
|
Ermal Lu?i
|
$pconfig['secret'] = $l2tpcfg['secret'];
|
65 |
5656fe23
|
Ermal Lu?i
|
|
66 |
|
|
if ($_POST) {
|
67 |
|
|
|
68 |
|
|
unset($input_errors);
|
69 |
|
|
$pconfig = $_POST;
|
70 |
|
|
|
71 |
|
|
/* input validation */
|
72 |
|
|
if ($_POST['mode'] == "server") {
|
73 |
|
|
$reqdfields = explode(" ", "localip remoteip");
|
74 |
346e6203
|
Rafael Lucas
|
$reqdfieldsn = array(gettext("Server address"),gettext("Remote start address"));
|
75 |
5656fe23
|
Ermal Lu?i
|
|
76 |
|
|
if ($_POST['radiusenable']) {
|
77 |
|
|
$reqdfields = array_merge($reqdfields, explode(" ", "radiusserver radiussecret"));
|
78 |
|
|
$reqdfieldsn = array_merge($reqdfieldsn,
|
79 |
346e6203
|
Rafael Lucas
|
array(gettext("RADIUS server address"),gettext("RADIUS shared secret")));
|
80 |
5656fe23
|
Ermal Lu?i
|
}
|
81 |
|
|
|
82 |
|
|
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
|
83 |
|
|
|
84 |
|
|
if (($_POST['localip'] && !is_ipaddr($_POST['localip']))) {
|
85 |
|
|
$input_errors[] = gettext("A valid server address must be specified.");
|
86 |
|
|
}
|
87 |
0a0b17d9
|
Renato Botelho
|
if (is_ipaddr_configured($_POST['localip'])) {
|
88 |
|
|
$input_errors[] = gettext("'Server address' parameter should NOT be set to any IP address currently in use on this firewall.");
|
89 |
|
|
}
|
90 |
a56120f2
|
Ermal Lu?i
|
if (($_POST['l2tp_subnet'] && !is_ipaddr($_POST['remoteip']))) {
|
91 |
5656fe23
|
Ermal Lu?i
|
$input_errors[] = gettext("A valid remote start address must be specified.");
|
92 |
|
|
}
|
93 |
|
|
if (($_POST['radiusserver'] && !is_ipaddr($_POST['radiusserver']))) {
|
94 |
|
|
$input_errors[] = gettext("A valid RADIUS server address must be specified.");
|
95 |
|
|
}
|
96 |
|
|
|
97 |
|
|
/* if this is an AJAX caller then handle via JSON */
|
98 |
|
|
if(isAjax() && is_array($input_errors)) {
|
99 |
|
|
input_errors2Ajax($input_errors);
|
100 |
|
|
exit;
|
101 |
|
|
}
|
102 |
|
|
|
103 |
|
|
if (!$input_errors) {
|
104 |
a56120f2
|
Ermal Lu?i
|
$_POST['remoteip'] = $pconfig['remoteip'] = gen_subnet($_POST['remoteip'], $_POST['l2tp_subnet']);
|
105 |
96033063
|
Erik Fonnesbeck
|
$subnet_start = ip2ulong($_POST['remoteip']);
|
106 |
|
|
$subnet_end = ip2ulong($_POST['remoteip']) + $_POST['n_l2tp_units'] - 1;
|
107 |
5656fe23
|
Ermal Lu?i
|
|
108 |
96033063
|
Erik Fonnesbeck
|
if ((ip2ulong($_POST['localip']) >= $subnet_start) &&
|
109 |
|
|
(ip2ulong($_POST['localip']) <= $subnet_end)) {
|
110 |
5656fe23
|
Ermal Lu?i
|
$input_errors[] = gettext("The specified server address lies in the remote subnet.");
|
111 |
|
|
}
|
112 |
a55e9c70
|
Ermal Lu?i
|
if ($_POST['localip'] == get_interface_ip("lan")) {
|
113 |
5656fe23
|
Ermal Lu?i
|
$input_errors[] = gettext("The specified server address is equal to the LAN interface address.");
|
114 |
|
|
}
|
115 |
|
|
}
|
116 |
|
|
}
|
117 |
|
|
|
118 |
|
|
/* if this is an AJAX caller then handle via JSON */
|
119 |
|
|
if(isAjax() && is_array($input_errors)) {
|
120 |
|
|
input_errors2Ajax($input_errors);
|
121 |
|
|
exit;
|
122 |
|
|
}
|
123 |
|
|
|
124 |
|
|
if (!$input_errors) {
|
125 |
|
|
$l2tpcfg['remoteip'] = $_POST['remoteip'];
|
126 |
|
|
$l2tpcfg['localip'] = $_POST['localip'];
|
127 |
a56120f2
|
Ermal Lu?i
|
$l2tpcfg['l2tp_subnet'] = $_POST['l2tp_subnet'];
|
128 |
5656fe23
|
Ermal Lu?i
|
$l2tpcfg['mode'] = $_POST['mode'];
|
129 |
|
|
$l2tpcfg['interface'] = $_POST['interface'];
|
130 |
|
|
$l2tpcfg['n_l2tp_units'] = $_POST['n_l2tp_units'];
|
131 |
|
|
|
132 |
|
|
$l2tpcfg['radius']['server'] = $_POST['radiusserver'];
|
133 |
|
|
$l2tpcfg['radius']['secret'] = $_POST['radiussecret'];
|
134 |
40de0b13
|
Ermal Lu?i
|
$l2tpcfg['secret'] = $_POST['secret'];
|
135 |
5656fe23
|
Ermal Lu?i
|
|
136 |
c8cc0c1c
|
smos
|
if($_POST['wins'])
|
137 |
|
|
$l2tpcfg['wins'] = $_POST['wins'];
|
138 |
|
|
else
|
139 |
|
|
unset($l2tpcfg['wins']);
|
140 |
|
|
|
141 |
5656fe23
|
Ermal Lu?i
|
$l2tpcfg['paporchap'] = $_POST['paporchap'];
|
142 |
|
|
|
143 |
c8cc0c1c
|
smos
|
|
144 |
|
|
if ($_POST['l2tp_dns1'] == "") {
|
145 |
|
|
if (isset($l2tpcfg['dns1']))
|
146 |
|
|
unset($l2tpcfg['dns1']);
|
147 |
|
|
} else
|
148 |
|
|
$l2tpcfg['dns1'] = $_POST['l2tp_dns1'];
|
149 |
|
|
|
150 |
|
|
if ($_POST['l2tp_dns2'] == "") {
|
151 |
|
|
if (isset($l2tpcfg['dns2']))
|
152 |
|
|
unset($l2tpcfg['dns2']);
|
153 |
|
|
} else
|
154 |
|
|
$l2tpcfg['dns2'] = $_POST['l2tp_dns2'];
|
155 |
|
|
|
156 |
5656fe23
|
Ermal Lu?i
|
if($_POST['radiusenable'] == "yes")
|
157 |
|
|
$l2tpcfg['radius']['enable'] = true;
|
158 |
|
|
else
|
159 |
|
|
unset($l2tpcfg['radius']['enable']);
|
160 |
|
|
|
161 |
|
|
if($_POST['radacct_enable'] == "yes")
|
162 |
|
|
$l2tpcfg['radius']['accounting'] = true;
|
163 |
|
|
else
|
164 |
|
|
unset($l2tpcfg['radius']['accounting']);
|
165 |
|
|
|
166 |
|
|
if($_POST['radiusissueips'] == "yes")
|
167 |
|
|
$l2tpcfg['radius']['radiusissueips'] = true;
|
168 |
|
|
else
|
169 |
|
|
unset($l2tpcfg['radius']['radiusissueips']);
|
170 |
|
|
|
171 |
|
|
write_config();
|
172 |
|
|
|
173 |
|
|
$retval = 0;
|
174 |
|
|
$retval = vpn_l2tp_configure();
|
175 |
|
|
$savemsg = get_std_save_message($retval);
|
176 |
|
|
|
177 |
|
|
/* if ajax is calling, give them an update message */
|
178 |
|
|
if(isAjax())
|
179 |
|
|
print_info_box_np($savemsg);
|
180 |
|
|
}
|
181 |
|
|
}
|
182 |
|
|
|
183 |
|
|
include("head.inc");
|
184 |
|
|
?>
|
185 |
|
|
|
186 |
|
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
|
187 |
|
|
<?php include("fbegin.inc"); ?>
|
188 |
|
|
|
189 |
|
|
<script type="text/javascript">
|
190 |
|
|
<!--
|
191 |
|
|
function get_radio_value(obj)
|
192 |
|
|
{
|
193 |
|
|
for (i = 0; i < obj.length; i++) {
|
194 |
|
|
if (obj[i].checked)
|
195 |
|
|
return obj[i].value;
|
196 |
|
|
}
|
197 |
|
|
return null;
|
198 |
|
|
}
|
199 |
|
|
|
200 |
|
|
function enable_change(enable_over) {
|
201 |
|
|
if ((get_radio_value(document.iform.mode) == "server") || enable_over) {
|
202 |
|
|
document.iform.remoteip.disabled = 0;
|
203 |
|
|
document.iform.localip.disabled = 0;
|
204 |
a56120f2
|
Ermal Lu?i
|
document.iform.l2tp_subnet.disabled = 0;
|
205 |
5656fe23
|
Ermal Lu?i
|
document.iform.radiusenable.disabled = 0;
|
206 |
|
|
document.iform.radiusissueips.disabled = 0;
|
207 |
|
|
document.iform.paporchap.disabled = 0;
|
208 |
|
|
document.iform.interface.disabled = 0;
|
209 |
|
|
document.iform.n_l2tp_units.disabled = 0;
|
210 |
40de0b13
|
Ermal Lu?i
|
document.iform.secret.disabled = 0;
|
211 |
c8cc0c1c
|
smos
|
document.iform.l2tp_dns1.disabled = 0;
|
212 |
|
|
document.iform.l2tp_dns2.disabled = 0;
|
213 |
5656fe23
|
Ermal Lu?i
|
/* fix colors */
|
214 |
|
|
document.iform.remoteip.style.backgroundColor = '#FFFFFF';
|
215 |
|
|
document.iform.localip.style.backgroundColor = '#FFFFFF';
|
216 |
a56120f2
|
Ermal Lu?i
|
document.iform.l2tp_subnet.style.backgroundColor = '#FFFFFF';
|
217 |
5656fe23
|
Ermal Lu?i
|
document.iform.radiusenable.style.backgroundColor = '#FFFFFF';
|
218 |
|
|
document.iform.radiusissueips.style.backgroundColor = '#FFFFFF';
|
219 |
|
|
document.iform.paporchap.style.backgroundColor = '#FFFFFF';
|
220 |
|
|
document.iform.interface.style.backgroundColor = '#FFFFFF';
|
221 |
|
|
document.iform.n_l2tp_units.style.backgroundColor = '#FFFFFF';
|
222 |
40de0b13
|
Ermal Lu?i
|
document.iform.secret.style.backgroundColor = '#FFFFFF';
|
223 |
5656fe23
|
Ermal Lu?i
|
if (document.iform.radiusenable.checked || enable_over) {
|
224 |
|
|
document.iform.radacct_enable.disabled = 0;
|
225 |
|
|
document.iform.radiusserver.disabled = 0;
|
226 |
|
|
document.iform.radiussecret.disabled = 0;
|
227 |
|
|
document.iform.radiusissueips.disabled = 0;
|
228 |
|
|
/* fix colors */
|
229 |
|
|
document.iform.radacct_enable.style.backgroundColor = '#FFFFFF';
|
230 |
|
|
document.iform.radiusserver.style.backgroundColor = '#FFFFFF';
|
231 |
|
|
document.iform.radiussecret.style.backgroundColor = '#FFFFFF';
|
232 |
|
|
document.iform.radiusissueips.style.backgroundColor = '#FFFFFF';
|
233 |
|
|
} else {
|
234 |
|
|
document.iform.radacct_enable.disabled = 1;
|
235 |
|
|
document.iform.radiusserver.disabled = 1;
|
236 |
|
|
document.iform.radiussecret.disabled = 1;
|
237 |
|
|
document.iform.radiusissueips.disabled = 1;
|
238 |
|
|
/* fix colors */
|
239 |
|
|
document.iform.radacct_enable.style.backgroundColor = '#D4D0C8';
|
240 |
|
|
document.iform.radiusserver.style.backgroundColor = '#D4D0C8';
|
241 |
|
|
document.iform.radiussecret.style.backgroundColor = '#D4D0C8';
|
242 |
|
|
document.iform.radiusissueips.style.backgroundColor = '#D4D0C8';
|
243 |
|
|
}
|
244 |
|
|
} else {
|
245 |
|
|
document.iform.interface.disabled = 1;
|
246 |
|
|
document.iform.n_l2tp_units.disabled = 1;
|
247 |
a56120f2
|
Ermal Lu?i
|
document.iform.l2tp_subnet.disabled = 1;
|
248 |
c8cc0c1c
|
smos
|
document.iform.l2tp_dns1.disabled = 1;
|
249 |
|
|
document.iform.l2tp_dns2.disabled = 1;
|
250 |
5656fe23
|
Ermal Lu?i
|
document.iform.paporchap.disabled = 1;
|
251 |
|
|
document.iform.remoteip.disabled = 1;
|
252 |
|
|
document.iform.localip.disabled = 1;
|
253 |
|
|
document.iform.radiusenable.disabled = 1;
|
254 |
|
|
document.iform.radacct_enable.disabled = 1;
|
255 |
|
|
document.iform.radiusserver.disabled = 1;
|
256 |
|
|
document.iform.radiussecret.disabled = 1;
|
257 |
|
|
document.iform.radiusissueips.disabled = 1;
|
258 |
40de0b13
|
Ermal Lu?i
|
document.iform.secret.disabled = 1;
|
259 |
5656fe23
|
Ermal Lu?i
|
/* fix colors */
|
260 |
|
|
document.iform.interface.style.backgroundColor = '#D4D0C8';
|
261 |
|
|
document.iform.n_l2tp_units.style.backgroundColor = '#D4D0C8';
|
262 |
a56120f2
|
Ermal Lu?i
|
document.iform.l2tp_subnet.style.backgroundColor = '#D4D0C8';
|
263 |
5656fe23
|
Ermal Lu?i
|
document.iform.paporchap.style.backgroundColor = '#D4D0C8';
|
264 |
|
|
document.iform.remoteip.style.backgroundColor = '#D4D0C8';
|
265 |
|
|
document.iform.localip.style.backgroundColor = '#D4D0C8';
|
266 |
|
|
document.iform.radiusenable.style.backgroundColor = '#D4D0C8';
|
267 |
|
|
document.iform.radacct_enable.style.backgroundColor = '#D4D0C8';
|
268 |
|
|
document.iform.radiusserver.style.backgroundColor = '#D4D0C8';
|
269 |
|
|
document.iform.radiussecret.style.backgroundColor = '#D4D0C8';
|
270 |
|
|
document.iform.radiusissueips.style.backgroundColor = '#D4D0C8';
|
271 |
40de0b13
|
Ermal Lu?i
|
document.iform.secret.style.backgroundColor = '#D4D0C8';
|
272 |
5656fe23
|
Ermal Lu?i
|
}
|
273 |
|
|
}
|
274 |
|
|
//-->
|
275 |
|
|
</script>
|
276 |
|
|
<form action="vpn_l2tp.php" method="post" name="iform" id="iform">
|
277 |
|
|
<?php if ($input_errors) print_input_errors($input_errors); ?>
|
278 |
|
|
<?php if ($savemsg) print_info_box($savemsg); ?>
|
279 |
|
|
<div id="inputerrors"></div>
|
280 |
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
281 |
|
|
<tr><td class="tabnavtbl">
|
282 |
|
|
<?php
|
283 |
|
|
$tab_array = array();
|
284 |
|
|
$tab_array[0] = array(gettext("Configuration"), true, "vpn_l2tp.php");
|
285 |
|
|
$tab_array[1] = array(gettext("Users"), false, "vpn_l2tp_users.php");
|
286 |
|
|
display_top_tabs($tab_array);
|
287 |
|
|
?>
|
288 |
|
|
</td></tr>
|
289 |
|
|
<tr>
|
290 |
|
|
<td>
|
291 |
|
|
<div id="mainarea">
|
292 |
|
|
<table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
|
293 |
|
|
<tr>
|
294 |
|
|
<td width="22%" valign="top" class="vtable"> </td>
|
295 |
|
|
<td width="78%" class="vtable">
|
296 |
|
|
<input name="mode" type="radio" onclick="enable_change(false)" value="off"
|
297 |
|
|
<?php if (($pconfig['mode'] != "server") && ($pconfig['mode'] != "redir")) echo "checked=\"checked\"";?> />
|
298 |
adf32c24
|
Carlos Eduardo Ramos
|
<?=gettext("Off"); ?></td>
|
299 |
5656fe23
|
Ermal Lu?i
|
</tr>
|
300 |
|
|
<tr>
|
301 |
|
|
<td width="22%" valign="top" class="vtable"> </td>
|
302 |
|
|
<td width="78%" class="vtable">
|
303 |
|
|
<input type="radio" name="mode" value="server" onclick="enable_change(false)" <?php if ($pconfig['mode'] == "server") echo "checked=\"checked\""; ?> />
|
304 |
70addcc5
|
jim-p
|
<?=gettext("Enable L2TP server"); ?></td>
|
305 |
5656fe23
|
Ermal Lu?i
|
</tr>
|
306 |
|
|
|
307 |
|
|
<tr>
|
308 |
|
|
<td width="22%" valign="top" class="vncell"><b><?=gettext("Interface");?></b></td>
|
309 |
|
|
<td width="78%" valign="top" class="vtable">
|
310 |
|
|
|
311 |
|
|
<select name="interface" class="formselect" id="interface">
|
312 |
|
|
<?php
|
313 |
6e8bd1b0
|
Seth Mos
|
$interfaces = get_configured_interface_with_descr();
|
314 |
5656fe23
|
Ermal Lu?i
|
foreach ($interfaces as $iface => $ifacename):
|
315 |
|
|
?>
|
316 |
|
|
<option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected"; ?>>
|
317 |
|
|
<?=htmlspecialchars($ifacename);?>
|
318 |
|
|
</option>
|
319 |
|
|
<?php endforeach; ?>
|
320 |
|
|
</select> <br />
|
321 |
|
|
|
322 |
|
|
</td>
|
323 |
|
|
</tr>
|
324 |
|
|
<tr>
|
325 |
70addcc5
|
jim-p
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Server Address");?></td>
|
326 |
5656fe23
|
Ermal Lu?i
|
<td width="78%" class="vtable">
|
327 |
|
|
<?=$mandfldhtml;?><input name="localip" type="text" class="formfld unknown" id="localip" size="20" value="<?=htmlspecialchars($pconfig['localip']);?>" />
|
328 |
973444a8
|
jim-p
|
<br/>
|
329 |
|
|
<?=gettext("Enter the IP address the L2TP server should give to clients for use as their \"gateway\""); ?>.
|
330 |
|
|
<br/>
|
331 |
|
|
<?=gettext("Typically this is set to an unused IP just outside of the client range"); ?>.
|
332 |
|
|
<br/>
|
333 |
|
|
<br/>
|
334 |
|
|
<?=gettext("NOTE: This should NOT be set to any IP address currently in use on this firewall"); ?>.</td>
|
335 |
5656fe23
|
Ermal Lu?i
|
</tr>
|
336 |
|
|
<tr>
|
337 |
70addcc5
|
jim-p
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Remote Address Range");?></td>
|
338 |
5656fe23
|
Ermal Lu?i
|
<td width="78%" class="vtable">
|
339 |
|
|
<?=$mandfldhtml;?><input name="remoteip" type="text" class="formfld unknown" id="remoteip" size="20" value="<?=htmlspecialchars($pconfig['remoteip']);?>" />
|
340 |
|
|
<br />
|
341 |
|
|
<?=gettext("Specify the starting address for the client IP address subnet.");?><br />
|
342 |
|
|
</td>
|
343 |
|
|
</tr>
|
344 |
a56120f2
|
Ermal Lu?i
|
<tr>
|
345 |
70addcc5
|
jim-p
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Subnet Mask"); ?></td>
|
346 |
a56120f2
|
Ermal Lu?i
|
<td width="78%" class="vtable">
|
347 |
|
|
<select id="l2tp_subnet" name="l2tp_subnet">
|
348 |
|
|
<?php
|
349 |
|
|
for($x=0; $x<33; $x++) {
|
350 |
|
|
if($x == $pconfig['l2tp_subnet'])
|
351 |
|
|
$SELECTED = " SELECTED";
|
352 |
|
|
else
|
353 |
|
|
$SELECTED = "";
|
354 |
|
|
echo "<option value=\"{$x}\"{$SELECTED}>{$x}</option>\n";
|
355 |
|
|
}
|
356 |
|
|
?>
|
357 |
|
|
</select>
|
358 |
ea53e38f
|
Renato Botelho
|
<br><?=gettext("Hint:"); ?> 24 <?=gettext("is"); ?> 255.255.255.0
|
359 |
a56120f2
|
Ermal Lu?i
|
</td>
|
360 |
|
|
</tr>
|
361 |
5656fe23
|
Ermal Lu?i
|
<tr>
|
362 |
adf32c24
|
Carlos Eduardo Ramos
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Number of L2TP users"); ?></td>
|
363 |
5656fe23
|
Ermal Lu?i
|
<td width="78%" class="vtable">
|
364 |
|
|
<select id="n_l2tp_units" name="n_l2tp_units">
|
365 |
|
|
<?php
|
366 |
|
|
for($x=0; $x<255; $x++) {
|
367 |
|
|
if($x == $pconfig['n_l2tp_units'])
|
368 |
|
|
$SELECTED = " SELECTED";
|
369 |
|
|
else
|
370 |
|
|
$SELECTED = "";
|
371 |
|
|
echo "<option value=\"{$x}\"{$SELECTED}>{$x}</option>\n";
|
372 |
|
|
}
|
373 |
|
|
?>
|
374 |
|
|
</select>
|
375 |
ea53e38f
|
Renato Botelho
|
<br><?=gettext("Hint:"); ?> 10 <?=gettext("is ten L2TP clients"); ?>
|
376 |
5656fe23
|
Ermal Lu?i
|
</td>
|
377 |
|
|
</tr>
|
378 |
40de0b13
|
Ermal Lu?i
|
<tr>
|
379 |
|
|
<td width="22%" valign="top" class="vncell"><?=gettext("Secret");?></td>
|
380 |
|
|
<td width="78%" class="vtable">
|
381 |
a3381369
|
Colin Fleming
|
<input type="password" name="secret" id="secret" class="formfld pwd" value="<?php echo htmlspecialchars($pconfig['secret']); ?>">
|
382 |
40de0b13
|
Ermal Lu?i
|
<br />
|
383 |
|
|
<?=gettext("Specify optional secret shared between peers. Required on some devices/setups.");?><br />
|
384 |
|
|
</td>
|
385 |
|
|
</tr>
|
386 |
5656fe23
|
Ermal Lu?i
|
<tr>
|
387 |
70addcc5
|
jim-p
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Authentication Type");?></td>
|
388 |
5656fe23
|
Ermal Lu?i
|
<td width="78%" class="vtable">
|
389 |
|
|
<?=$mandfldhtml;?><select name="paporchap" id="paporchap">
|
390 |
adf32c24
|
Carlos Eduardo Ramos
|
<option value='chap'<?php if($pconfig['paporchap'] == "chap") echo " SELECTED"; ?>><?=gettext("CHAP"); ?></option>
|
391 |
|
|
<option value='pap'<?php if($pconfig['paporchap'] == "pap") echo " SELECTED"; ?>><?=gettext("PAP"); ?></option>
|
392 |
5656fe23
|
Ermal Lu?i
|
</select>
|
393 |
|
|
<br />
|
394 |
|
|
<?=gettext("Specifies which protocol to use for authentication.");?><br />
|
395 |
|
|
</td>
|
396 |
|
|
</tr>
|
397 |
c8cc0c1c
|
smos
|
<tr>
|
398 |
|
|
<td width="22%" valign="top" class="vncell"><?=gettext("L2TP DNS Servers"); ?></td>
|
399 |
|
|
<td width="78%" class="vtable">
|
400 |
|
|
<?=$mandfldhtml;?><input name="l2tp_dns1" type="text" class="formfld unknown" id="l2tp_dns1" size="20" value="<?=htmlspecialchars($pconfig['l2tp_dns1']);?>">
|
401 |
|
|
<br>
|
402 |
|
|
<input name="l2tp_dns2" type="text" class="formfld unknown" id="l2tp_dns2" size="20" value="<?=htmlspecialchars($pconfig['l2tp_dns2']);?>">
|
403 |
|
|
<br>
|
404 |
|
|
<?=gettext("primary and secondary DNS servers assigned to L2TP clients"); ?><br>
|
405 |
|
|
</td>
|
406 |
|
|
</tr>
|
407 |
|
|
<tr>
|
408 |
|
|
<td width="22%" valign="top" class="vncell"><?=gettext("WINS Server"); ?></td>
|
409 |
|
|
<td width="78%" valign="top" class="vtable">
|
410 |
|
|
<input name="wins" class="formfld unknown" id="wins" size="20" value="<?=htmlspecialchars($pconfig['wins']);?>">
|
411 |
|
|
</td>
|
412 |
|
|
</tr>
|
413 |
5656fe23
|
Ermal Lu?i
|
<tr>
|
414 |
adf32c24
|
Carlos Eduardo Ramos
|
<td width="22%" valign="top" class="vncell"><?=gettext("RADIUS"); ?></td>
|
415 |
5656fe23
|
Ermal Lu?i
|
<td width="78%" class="vtable">
|
416 |
|
|
<input name="radiusenable" type="checkbox" id="radiusenable" onclick="enable_change(false)" value="yes" <?php if ($pconfig['radiusenable']) echo "checked=\"checked\""; ?> />
|
417 |
|
|
<strong> <?=gettext("Use a RADIUS server for authentication");?><br /></strong>
|
418 |
|
|
<?=gettext("When set, all users will be authenticated using the RADIUS server specified below. The local user database will not be used.");?><br />
|
419 |
|
|
<br />
|
420 |
|
|
<input name="radacct_enable" type="checkbox" id="radacct_enable" onclick="enable_change(false)" value="yes" <?php if ($pconfig['radacct_enable']) echo "checked=\"checked\""; ?> />
|
421 |
|
|
<strong><?=gettext("Enable RADIUS accounting");?></strong><br />
|
422 |
|
|
<?=gettext("Sends accounting packets to the RADIUS server.");?></td>
|
423 |
|
|
</tr>
|
424 |
|
|
<tr>
|
425 |
70addcc5
|
jim-p
|
<td width="22%" valign="top" class="vncell"><?=gettext("RADIUS Server");?></td>
|
426 |
5656fe23
|
Ermal Lu?i
|
<td width="78%" class="vtable">
|
427 |
|
|
<input name="radiusserver" type="text" class="formfld unknown" id="radiusserver" size="20" value="<?=htmlspecialchars($pconfig['radiusserver']);?>" />
|
428 |
|
|
<br />
|
429 |
|
|
<?=gettext("Enter the IP address of the RADIUS server.");?></td>
|
430 |
|
|
</tr>
|
431 |
|
|
<tr>
|
432 |
70addcc5
|
jim-p
|
<td width="22%" valign="top" class="vncell"><?=gettext("RADIUS Shared Secret");?></td>
|
433 |
5656fe23
|
Ermal Lu?i
|
<td width="78%" valign="top" class="vtable">
|
434 |
|
|
<input name="radiussecret" type="password" class="formfld pwd" id="radiussecret" size="20" value="<?=htmlspecialchars($pconfig['radiussecret']);?>" />
|
435 |
|
|
<br />
|
436 |
|
|
<?=gettext("Enter the shared secret that will be used to authenticate to the RADIUS server.");?></td>
|
437 |
|
|
</tr>
|
438 |
|
|
<tr>
|
439 |
70addcc5
|
jim-p
|
<td width="22%" valign="top" class="vncell"><?=gettext("RADIUS Issued IP's");?></td>
|
440 |
5656fe23
|
Ermal Lu?i
|
<td width="78%" valign="top" class="vtable">
|
441 |
|
|
<input name="radiusissueips" value="yes" type="checkbox" class="formfld" id="radiusissueips"<?php if(isset($pconfig['radiusissueips'])) echo " checked=\"checked\""; ?> />
|
442 |
|
|
<br />
|
443 |
|
|
<?=gettext("Issue IP Addresses via RADIUS server.");?>
|
444 |
|
|
</td>
|
445 |
|
|
</tr>
|
446 |
|
|
<tr>
|
447 |
|
|
<td width="22%" valign="top"> </td>
|
448 |
|
|
<td width="78%">
|
449 |
adf32c24
|
Carlos Eduardo Ramos
|
<input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" onclick="enable_change(true)" />
|
450 |
5656fe23
|
Ermal Lu?i
|
</td>
|
451 |
|
|
</tr>
|
452 |
|
|
<tr>
|
453 |
|
|
<td colspan="2">
|
454 |
|
|
<span class="vexpl">
|
455 |
ea53e38f
|
Renato Botelho
|
<strong class="red"><?=gettext("Note:");?></strong><br />
|
456 |
5656fe23
|
Ermal Lu?i
|
<?=gettext("Don't forget to add a firewall rule to permit traffic from L2TP clients!");?>
|
457 |
|
|
</span>
|
458 |
|
|
</td>
|
459 |
|
|
</tr>
|
460 |
|
|
</table>
|
461 |
|
|
</div>
|
462 |
|
|
</td>
|
463 |
|
|
</tr>
|
464 |
|
|
</table>
|
465 |
|
|
</form>
|
466 |
|
|
|
467 |
|
|
<script type="text/javascript">
|
468 |
|
|
enable_change(false);
|
469 |
|
|
</script>
|
470 |
|
|
|
471 |
|
|
<?php include("fend.inc"); ?>
|
472 |
|
|
</body>
|
473 |
|
|
</html>
|