Project

General

Profile

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