Project

General

Profile

Download (30.2 KB) Statistics
| Branch: | Tag: | Revision:
1 13128695 Scott Ullrich
<?php
2 b46bfcf5 Bill Marquette
/* $Id$ */
3 5b237745 Scott Ullrich
/*
4 aa9e7aaa Scott Ullrich
		system_advanced.php
5 416ed28d Scott Ullrich
        part of pfSense
6 aa9e7aaa Scott Ullrich
        Copyright (C) 2005-2007 Scott Ullrich
7 13128695 Scott Ullrich
8 416ed28d Scott Ullrich
	originally part of m0n0wall (http://m0n0.ch/wall)
9 5b237745 Scott Ullrich
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
10
	All rights reserved.
11 13128695 Scott Ullrich
12 5b237745 Scott Ullrich
	Redistribution and use in source and binary forms, with or without
13
	modification, are permitted provided that the following conditions are met:
14 13128695 Scott Ullrich
15 5b237745 Scott Ullrich
	1. Redistributions of source code must retain the above copyright notice,
16
	   this list of conditions and the following disclaimer.
17 13128695 Scott Ullrich
18 5b237745 Scott Ullrich
	2. Redistributions in binary form must reproduce the above copyright
19
	   notice, this list of conditions and the following disclaimer in the
20
	   documentation and/or other materials provided with the distribution.
21 13128695 Scott Ullrich
22 5b237745 Scott Ullrich
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
23
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
24
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31
	POSSIBILITY OF SUCH DAMAGE.
32
*/
33
34
require("guiconfig.inc");
35
36 35284e50 Scott Ullrich
$pconfig['disablefilter'] = $config['system']['disablefilter'];
37 38560a25 Bill Marquette
$pconfig['rfc959workaround'] = $config['system']['rfc959workaround'];
38 8f498445 Scott Ullrich
$pconfig['scrubnodf'] = $config['system']['scrubnodf'];
39 5b237745 Scott Ullrich
$pconfig['ipv6nat_enable'] = isset($config['diag']['ipv6nat']['enable']);
40
$pconfig['ipv6nat_ipaddr'] = $config['diag']['ipv6nat']['ipaddr'];
41
$pconfig['cert'] = base64_decode($config['system']['webgui']['certificate']);
42
$pconfig['key'] = base64_decode($config['system']['webgui']['private-key']);
43
$pconfig['disableconsolemenu'] = isset($config['system']['disableconsolemenu']);
44 c11e337b Scott Ullrich
$pconfig['harddiskstandby'] = $config['system']['harddiskstandby'];
45 5b237745 Scott Ullrich
$pconfig['noantilockout'] = isset($config['system']['webgui']['noantilockout']);
46 3962b070 Scott Ullrich
$pconfig['filteringbridge_enable'] = isset($config['bridge']['filteringbridge']);
47 5b237745 Scott Ullrich
$pconfig['tcpidletimeout'] = $config['filter']['tcpidletimeout'];
48 351217ed Scott Ullrich
$pconfig['maximumstates'] = $config['system']['maximumstates'];
49 68bf6021 Scott Ullrich
$pconfig['disablerendevouz'] = $config['system']['disablerendevouz'];
50 2f810bc1 Scott Ullrich
$pconfig['enableserial'] = $config['system']['enableserial'];
51 5c50ae40 Scott Ullrich
$pconfig['disablefirmwarecheck'] = isset($config['system']['disablefirmwarecheck']);
52 d5967a9a Scott Ullrich
$pconfig['preferoldsa_enable'] = isset($config['ipsec']['preferoldsa']);
53 59d09874 Scott Ullrich
$pconfig['enablesshd'] = $config['system']['enablesshd'];
54 74806cee Seth Mos
$pconfig['sshport'] = $config['system']['ssh']['port'];
55 ed4b63b0 Timo Boettcher
$pconfig['sshdkeyonly'] = $config['system']['ssh']['sshdkeyonly'];
56
$pconfig['authorizedkeys'] = base64_decode($config['system']['ssh']['authorizedkeys']);
57 243aa7b9 Scott Ullrich
$pconfig['sharednet'] = $config['system']['sharednet'];
58 8d36fd1d Scott Ullrich
$pconfig['polling_enable'] = isset($config['system']['polling']);
59 bdac13de Scott Ullrich
$pconfig['bypassstaticroutes'] = isset($config['filter']['bypassstaticroutes']);
60 a9b19d7f Scott Ullrich
$pconfig['disablenatreflection'] = $config['system']['disablenatreflection'];
61 507a5e3e Scott Ullrich
$pconfig['reflectiontimeout'] = $config['system']['reflectiontimeout'];
62 1c5ca2e9 Scott Ullrich
$pconfig['disablechecksumoffloading'] = isset($config['system']['disablechecksumoffloading']);
63 ff091d96 Scott Ullrich
$pconfig['disablescrub'] = isset($config['system']['disablescrub']);
64 81a6f5ea Scott Ullrich
$pconfig['shapertype']             = $config['system']['shapertype'];
65 9534ea8b Scott Ullrich
$pconfig['lb_use_sticky'] = isset($config['system']['lb_use_sticky']);
66 a9b19d7f Scott Ullrich
67 5b237745 Scott Ullrich
if ($_POST) {
68
69
	unset($input_errors);
70
	$pconfig = $_POST;
71
72
	/* input validation */
73
	if ($_POST['ipv6nat_enable'] && !is_ipaddr($_POST['ipv6nat_ipaddr'])) {
74
		$input_errors[] = "You must specify an IP address to NAT IPv6 packets.";
75
	}
76 351217ed Scott Ullrich
	if ($_POST['maximumstates'] && !is_numericint($_POST['maximumstates'])) {
77
		$input_errors[] = "The Firewall Maximum States value must be an integer.";
78
	}
79 5b237745 Scott Ullrich
	if ($_POST['tcpidletimeout'] && !is_numericint($_POST['tcpidletimeout'])) {
80
		$input_errors[] = "The TCP idle timeout must be an integer.";
81
	}
82
	if (($_POST['cert'] && !$_POST['key']) || ($_POST['key'] && !$_POST['cert'])) {
83
		$input_errors[] = "Certificate and key must always be specified together.";
84
	} else if ($_POST['cert'] && $_POST['key']) {
85
		if (!strstr($_POST['cert'], "BEGIN CERTIFICATE") || !strstr($_POST['cert'], "END CERTIFICATE"))
86
			$input_errors[] = "This certificate does not appear to be valid.";
87
		if (!strstr($_POST['key'], "BEGIN RSA PRIVATE KEY") || !strstr($_POST['key'], "END RSA PRIVATE KEY"))
88
			$input_errors[] = "This key does not appear to be valid.";
89 a509ff63 Bill Marquette
	if ($_POST['altfirmwareurl'])
90
		if ($_POST['firmwareurl'] == "" || $_POST['firmwarename'] == "")
91
		$input_errors[] = "You must specify a base URL and a filename for the alternate firmware.";
92 66f481cc Colin Smith
	if ($_POST['altpkgconfigurl'])
93
		if ($_POST['pkgconfig_base_url'] == "" || $_POST['pkgconfig_filename'] == "")
94
		$input_errors[] = "You must specifiy and base URL and a filename before using an alternate pkg_config.xml.";
95 5b237745 Scott Ullrich
	}
96 e52f293f Scott Ullrich
	if ($_POST['maximumstates'] <> "") {
97
		if ($_POST['maximumstates'] < 1000)
98
			$input_errors[] = "States must be above 1000 and below 100000000";
99
		if ($_POST['maximumstates'] > 100000000)
100
			$input_errors[] = "States must be above 1000 and below 100000000";
101
	}
102 74806cee Seth Mos
	if ($_POST['sshport'] <> "") {
103
		if( ! is_port($_POST['sshport'])) {
104
			$input_errors[] = "You must specify a valid port number";
105
		}
106
	}
107 ed4b63b0 Timo Boettcher
	if($_POST['sshdkeyonly'] == "yes") {
108
		$config['system']['ssh']['sshdkeyonly'] = "enabled";
109
	} else {
110
		unset($config['system']['ssh']['sshdkeyonly']);
111
	}		
112
	$config['system']['ssh']['authorizedkeys'] = base64_encode($_POST['authorizedkeys']);
113 74806cee Seth Mos
114 5b237745 Scott Ullrich
}
115 b63695db Scott Ullrich
116 aa9e7aaa Scott Ullrich
if ($_POST) {
117
    ob_flush();
118
    flush();
119
	if (!$input_errors) {
120
		if($_POST['disablefilter'] == "yes") {
121
			$config['system']['disablefilter'] = "enabled";
122
		} else {
123
			unset($config['system']['disablefilter']);
124
		}
125
		if($_POST['enablesshd'] == "yes") {
126
			$config['system']['enablesshd'] = "enabled";
127
			touch("{$g['tmp_path']}/start_sshd");
128
		} else {
129
			unset($config['system']['enablesshd']);
130
			mwexec("/usr/bin/killall sshd");
131
		}
132
		$oldsshport = $config['system']['ssh']['port'];
133
		$config['system']['ssh']['port'] = $_POST['sshport'];
134
135
		if($_POST['polling_enable'] == "yes") {
136
			$config['system']['polling'] = true;
137
			setup_polling();
138
		} else {
139
			unset($config['system']['polling']);
140
			setup_polling();
141
		}
142
143 9534ea8b Scott Ullrich
		if($_POST['lb_use_sticky'] == "yes")
144
			$config['system']['lb_use_sticky'] = true;
145
		else
146
			unset($config['system']['lb_use_sticky']);
147
148 aa9e7aaa Scott Ullrich
		if($_POST['sharednet'] == "yes") {
149
			$config['system']['sharednet'] = true;
150
			system_disable_arp_wrong_if();
151
		} else {
152
			unset($config['system']['sharednet']);
153
			system_enable_arp_wrong_if();
154
		}
155
156
		if($_POST['scrubnodf'] == "yes")
157
			$config['system']['scrubnodf'] = "enabled";
158
		else
159
			unset($config['system']['scrubnodf']);
160
161
		if($_POST['rfc959workaround'] == "yes")
162
			$config['system']['rfc959workaround'] = "enabled";
163
		else
164
			unset($config['system']['rfc959workaround']);
165
166
		if($_POST['ipv6nat_enable'] == "yes") {
167
			$config['diag']['ipv6nat']['enable'] = true;
168
			$config['diag']['ipv6nat']['ipaddr'] = $_POST['ipv6nat_ipaddr'];
169
		} else {
170
			unset($config['diag']['ipv6nat']['enable']);
171
			unset($config['diag']['ipv6nat']['ipaddr']);
172
		}
173
		$oldcert = $config['system']['webgui']['certificate'];
174
		$oldkey = $config['system']['webgui']['private-key'];
175
		$config['system']['webgui']['certificate'] = base64_encode($_POST['cert']);
176
		$config['system']['webgui']['private-key'] = base64_encode($_POST['key']);
177
		if($_POST['disableconsolemenu'] == "yes") {
178
			$config['system']['disableconsolemenu'] = true;
179
			auto_login(true);
180
		} else {
181
			unset($config['system']['disableconsolemenu']);
182
			auto_login(false);
183
		}
184
		unset($config['system']['webgui']['expanddiags']);
185
		$config['system']['optimization'] = $_POST['optimization'];
186
187
		if($_POST['disablefirmwarecheck'] == "yes")
188
			$config['system']['disablefirmwarecheck'] = true;
189
		else
190
			unset($config['system']['disablefirmwarecheck']);
191
192
		if ($_POST['enableserial'] == "yes")
193
			$config['system']['enableserial'] = true;
194
		else
195
			unset($config['system']['enableserial']);
196
197
		if($_POST['harddiskstandby'] <> "") {
198
			$config['system']['harddiskstandby'] = $_POST['harddiskstandby'];
199
			system_set_harddisk_standby();
200
		} else
201
			unset($config['system']['harddiskstandby']);
202
203
		if ($_POST['noantilockout'] == "yes")
204
			$config['system']['webgui']['noantilockout'] = true;
205
		else
206
			unset($config['system']['webgui']['noantilockout']);
207
208
		/* Firewall and ALTQ options */
209
		$config['system']['maximumstates'] = $_POST['maximumstates'];
210
211
		if($_POST['enablesshd'] == "yes") {
212
			$config['system']['enablesshd'] = $_POST['enablesshd'];
213
		} else {
214
			unset($config['system']['enablesshd']);
215
		}
216
217
		if($_POST['disablechecksumoffloading'] == "yes") {
218
			$config['system']['disablechecksumoffloading'] = $_POST['disablechecksumoffloading'];
219
		} else {
220
			unset($config['system']['disablechecksumoffloading']);
221
		}
222
223 ff091d96 Scott Ullrich
		if($_POST['disablescrub'] == "yes") {
224
			$config['system']['disablescrub'] = $_POST['disablescrub'];
225
		} else {
226
			unset($config['system']['disablescrub']);
227
		}
228
229 aa9e7aaa Scott Ullrich
		if($_POST['disablenatreflection'] == "yes") {
230
			$config['system']['disablenatreflection'] = $_POST['disablenatreflection'];
231
		} else {
232
			unset($config['system']['disablenatreflection']);
233
		}
234 507a5e3e Scott Ullrich
		
235
		$config['system']['reflectiontimeout'] = $_POST['reflectiontimeout'];
236 aa9e7aaa Scott Ullrich
237 81a6f5ea Scott Ullrich
		// Traffic shaper
238
		$config['system']['shapertype'] = $_POST['shapertype'];
239
		
240 aa9e7aaa Scott Ullrich
		$config['ipsec']['preferoldsa'] = $_POST['preferoldsa_enable'] ? true : false;
241
		$config['bridge']['filteringbridge'] = $_POST['filteringbridge_enable'] ? true : false;
242
		$config['filter']['bypassstaticroutes'] = $_POST['bypassstaticroutes'] ? true : false;
243
244
		write_config();
245
246
		$retval = 0;
247
		config_lock();
248
		$retval = filter_configure();
249
		if(stristr($retval, "error") <> true)
250
		    $savemsg = get_std_save_message($retval);
251
		else
252
		    $savemsg = $retval;
253
254
		config_unlock();
255
256
		setup_filter_bridge();
257
		
258
		conf_mount_rw();
259
260
		setup_serial_port();
261
262
		setup_filter_bridge();
263
264
		conf_mount_ro();		
265
		
266
267
	}
268
}
269
270 d88c6a9f Scott Ullrich
$pgtitle = array("System","Advanced functions");
271 b63695db Scott Ullrich
include("head.inc");
272
273 5b237745 Scott Ullrich
?>
274 b63695db Scott Ullrich
275 5b237745 Scott Ullrich
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
276 9ecd6ab7 Erik Kristensen
277 5b237745 Scott Ullrich
<?php include("fbegin.inc"); ?>
278 9ecd6ab7 Erik Kristensen
<form action="system_advanced.php" method="post" name="iform" id="iform">
279
<?php if ($input_errors) print_input_errors($input_errors); ?>
280
<?php if ($savemsg) print_info_box($savemsg); ?>
281
<p><span class="vexpl"><span class="red"><strong>Note: </strong></span>the options on this page are intended for use by advanced users only.</span></p>
282
<br />
283 416ed28d Scott Ullrich
284 9ecd6ab7 Erik Kristensen
<table width="100%" border="0" cellpadding="6" cellspacing="0">
285
	<tbody>
286 dbb0b7d6 Holger Bauer
		<?php if($g['platform'] == "pfSense" || $g['platform'] == "cdrom"): ?>
287 9ecd6ab7 Erik Kristensen
		<tr>
288
			<td colspan="2" valign="top" class="listtopic">Enable Serial Console</td>
289
		</tr>
290
		<tr>
291
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
292
			<td width="78%" class="vtable">
293
				<input name="enableserial" type="checkbox" id="enableserial" value="yes" <?php if (isset($pconfig['enableserial'])) echo "checked"; ?> onclick="enable_change(false)" />
294
				<strong>This will enable the first serial port with 9600/8/N/1</strong>
295 b8467d8e Scott Ullrich
				<br>
296 3446ca38 Scott Ullrich
				<span class="vexpl">Note:  This will disable the internal video card/keyboard</span>
297 9ecd6ab7 Erik Kristensen
			</td>
298
		</tr>
299
		<tr>
300
			<td width="22%" valign="top">&nbsp;</td>
301
			<td width="78%"><input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /></td>
302
		</tr>
303
		</tr>
304
		<tr>
305
			<td colspan="2" class="list" height="12"></td>
306 48ce54d0 Scott Ullrich
		</tr>
307 0831bc86 Scott Ullrich
		<?php endif; ?>
308 9ecd6ab7 Erik Kristensen
		<tr>
309
			<td colspan="2" valign="top" class="listtopic">Secure Shell</td>
310
		</tr>
311
		<tr>
312
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
313
			<td width="78%" class="vtable">
314
				<input name="enablesshd" type="checkbox" id="enablesshd" value="yes" <?php if (isset($pconfig['enablesshd'])) echo "checked"; ?> onclick="enable_change(false)" />
315
				<strong>Enable Secure Shell</strong>
316
			</td>
317
		</tr>
318 ed4b63b0 Timo Boettcher
 		<tr>
319
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
320
			<td width="78%" class="vtable">
321
				<input name="sshdkeyonly" type="checkbox" id="sshdkeyonly" value="yes" <?php if (isset($pconfig['sshdkeyonly'])) echo "checked"; ?> onclick="enable_change(false)" />
322 e1cb5d69 Scott Ullrich
				<strong>Disable Password login for Secure Shell (KEY only)</strong>
323 ed4b63b0 Timo Boettcher
			</td>
324
		</tr>
325 74806cee Seth Mos
		<tr>
326
			<td width="22%" valign="top" class="vncell">SSH port</td>
327
			<td width="78%" class="vtable">
328
				<input name="sshport" type="text" id="sshport" value="<?php echo $pconfig['sshport']; ?>" onclick="enable_change(false)" />
329
				<br />
330
				<span class="vexpl">Note:  Leave this blank for the default of 22</span>
331
			</td>
332
		</tr>
333 ed4b63b0 Timo Boettcher
		<tr>
334
			<td width="22%" valign="top" class="vncell"><?=gettext("Authorizedkeys");?></td>
335
			<td width="78%" class="vtable">
336
				<textarea name="authorizedkeys" cols="65" rows="7" id="authorizedkeys" class="formfld_cert"><?=htmlspecialchars($pconfig['authorizedkeys']);?></textarea>
337
				<br />
338
				Paste an authorized keys file here.
339
 			</td>
340
		</tr>
341 9ecd6ab7 Erik Kristensen
		<tr>
342
			<td width="22%" valign="top">&nbsp;</td>
343
			<td width="78%">
344
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
345
			</td>
346
		</tr>
347
		<tr>
348
			<td colspan="2" class="list" height="12">&nbsp;</td>
349 48ce54d0 Scott Ullrich
		</tr>
350 9ecd6ab7 Erik Kristensen
		<tr>
351
			<td colspan="2" valign="top" class="listtopic">Shared Physical Network</td>
352
		</tr>
353
		<tr>
354
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
355
			<td width="78%" class="vtable">
356
				<input name="sharednet" type="checkbox" id="sharednet" value="yes" <?php if (isset($pconfig['sharednet'])) echo "checked"; ?> onclick="enable_change(false)" />
357 3d0d1aa8 Colin Smith
				<strong>This will suppress ARP messages when interfaces share the same physical network</strong>
358 9ecd6ab7 Erik Kristensen
			</td>
359
		</tr>
360
		<tr>
361
			<td width="22%" valign="top">&nbsp;</td>
362
			<td width="78%">
363
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
364
			</td>
365
		</tr>
366
		<tr>
367
			<td colspan="2" class="list" height="12">&nbsp;</td>
368
		</tr>
369
		<tr>
370
			<td colspan="2" valign="top" class="listtopic">IPv6 tunneling</td>
371
		</tr>
372
		<tr>
373
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
374
			<td width="78%" class="vtable">
375
				<input name="ipv6nat_enable" type="checkbox" id="ipv6nat_enable" value="yes" <?php if ($pconfig['ipv6nat_enable']) echo "checked"; ?> onclick="enable_change(false)" />
376
				<strong>NAT encapsulated IPv6 packets (IP protocol 41/RFC2893) to:</strong>
377
				<br /> <br />
378 b5c78501 Seth Mos
				<input name="ipv6nat_ipaddr" type="text" class="formfld unknown" id="ipv6nat_ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipv6nat_ipaddr']);?>" />
379 9ecd6ab7 Erik Kristensen
				&nbsp;(IP address)<span class="vexpl"><br /> Don't forget to add a firewall rule to permit IPv6 packets!</span>
380
			</td>
381
		</tr>
382 b0703b01 Scott Ullrich
		<tr>
383
			<td colspan="2" class="list" height="12">&nbsp;</td>
384 48ce54d0 Scott Ullrich
		</tr>
385 02f0c58f Scott Ullrich
		<tr>
386
			<td colspan="2" valign="top" class="listtopic">Filtering Bridge</td>
387
		</tr>
388 48ce54d0 Scott Ullrich
                <tr>
389 3962b070 Scott Ullrich
                  <td width="22%" valign="top" class="vncell">&nbsp;</td>
390 48ce54d0 Scott Ullrich
                  <td width="78%" class="vtable">
391 3962b070 Scott Ullrich
                    <input name="filteringbridge_enable" type="checkbox" id="filteringbridge_enable" value="yes" <?php if ($pconfig['filteringbridge_enable']) echo "checked"; ?>>
392
                    <strong>Enable filtering bridge</strong><span class="vexpl"><br>
393 48ce54d0 Scott Ullrich
                    This will cause bridged packets to pass through the packet
394
                    filter in the same way as routed packets do (by default bridged
395
                    packets are always passed). If you enable this option, you'll
396
                    have to add filter rules to selectively permit traffic from
397 3962b070 Scott Ullrich
                    bridged interfaces.</span></td>
398 48ce54d0 Scott Ullrich
                </tr>
399 9ecd6ab7 Erik Kristensen
		<tr>
400
			<td width="22%" valign="top">&nbsp;</td>
401
			<td width="78%">
402
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
403
			</td>
404
		</tr>
405
		<tr>
406
			<td colspan="2" class="list" height="12">&nbsp;</td>
407
		</tr>
408
		<tr>
409 709cc6e0 Bill Marquette
			<td colspan="2" valign="top" class="listtopic">webConfigurator SSL certificate/key</td>
410 9ecd6ab7 Erik Kristensen
		</tr>
411
		<tr>
412
			<td width="22%" valign="top" class="vncell">Certificate</td>
413
			<td width="78%" class="vtable">
414
				<textarea name="cert" cols="65" rows="7" id="cert" class="formpre"><?=htmlspecialchars($pconfig['cert']);?></textarea>
415
				<br />
416
				Paste a signed certificate in X.509 PEM format here. <a href="javascript:if(openwindow('system_advanced_create_certs.php') == false) alert('Popup blocker detected.  Action aborted.');" >Create</a> certificates automatically.
417
			</td>
418
		</tr>
419
		<tr>
420
			<td width="22%" valign="top" class="vncell">Key</td>
421
			<td width="78%" class="vtable">
422
				<textarea name="key" cols="65" rows="7" id="key" class="formpre"><?=htmlspecialchars($pconfig['key']);?></textarea>
423
				<br />
424
				Paste an RSA private key in PEM format here.
425
			</td>
426
		</tr>
427
		<tr>
428
			<td width="22%" valign="top">&nbsp;</td>
429
			<td width="78%">
430
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
431
			</td>
432
		</tr>
433
		<tr>
434
			<td colspan="2" class="list" height="12">&nbsp;</td>
435
		</tr>
436 9534ea8b Scott Ullrich
437
		<tr>
438
			<td colspan="2" valign="top" class="listtopic">Load Balancing</td>
439
		</tr>
440
		<tr>
441
			<td width="22%" valign="top" class="vncell">Load Balancing</td>
442
			<td width="78%" class="vtable">
443
				<input name="lb_use_sticky" type="checkbox" id="lb_use_sticky" value="yes" <?php if ($pconfig['lb_use_sticky']) echo "checked=\"checked\""; ?> />
444
				<strong>Use sticky connections</strong>
445
				<br />
446
				<span class="vexpl">
447 d9d55d40 Bill Marquette
				Successive connections will be redirected to the servers in a round-robin manner with connections from the same source being sent to the same web server. This "sticky connection" will exist as long as there are states that refer to this connection. Once the states expire, so will the sticky connection. Further connections from that host will be redirected to the next web server in the round robin.
448 9534ea8b Scott Ullrich
				</span>
449
			</td>
450
		</tr>
451
		<tr>
452
			<td width="22%" valign="top">&nbsp;</td>
453
			<td width="78%">
454
				<input type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
455
			</td>
456
		</tr>
457
		<tr>
458
			<td colspan="2" class="list" height="12">&nbsp;</td>
459
		</tr>
460
461 9ecd6ab7 Erik Kristensen
		<tr>
462
			<td colspan="2" valign="top" class="listtopic">Miscellaneous</td>
463
		</tr>
464 8d36fd1d Scott Ullrich
465 9534ea8b Scott Ullrich
		<tr>
466
			<td colspan="2" class="list" height="12">&nbsp;</td>
467
		</tr>
468
469
470 8d36fd1d Scott Ullrich
                <tr>
471
                  <td width="22%" valign="top" class="vncell">Device polling</td>
472
                  <td width="78%" class="vtable">
473
                    <input name="polling_enable" type="checkbox" id="polling_enable" value="yes" <?php if ($pconfig['polling_enable']) echo "checked"; ?>>
474
                    <strong>Use device polling</strong><br>
475 709cc6e0 Bill Marquette
						Device polling is a technique that lets the system periodically poll network devices for new data instead of relying on interrupts. This prevents your webConfigurator, SSH, etc. from being inaccessible due to interrupt floods when under extreme load. Generally this is not recommended.
476 d9d55d40 Bill Marquette
						Not all NICs support polling; see the <?= $g['product_name'] ?> homepage for a list of supported cards.
477 8d36fd1d Scott Ullrich
                  </td>
478
                </tr>
479 48ce54d0 Scott Ullrich
480 9ecd6ab7 Erik Kristensen
		<tr>
481
			<td width="22%" valign="top" class="vncell">Console menu </td>
482
			<td width="78%" class="vtable">
483
				<input name="disableconsolemenu" type="checkbox" id="disableconsolemenu" value="yes" <?php if ($pconfig['disableconsolemenu']) echo "checked"; ?>  />
484
				<strong>Disable console menu</strong>
485
				<br />
486
				<span class="vexpl">Changes to this option will take effect after a reboot.</span>
487
			</td>
488
		</tr>
489 48ce54d0 Scott Ullrich
<?php if($g['platform'] == "pfSenseDISABLED"): ?>
490 a509ff63 Bill Marquette
		<tr>
491 9ecd6ab7 Erik Kristensen
			<td width="22%" valign="top" class="vncell">Hard disk standby time </td>
492
			<td width="78%" class="vtable">
493 b5c78501 Seth Mos
				<select name="harddiskstandby" class="formselect">
494 9ecd6ab7 Erik Kristensen
<?php
495
				 	## Values from ATA-2 http://www.t13.org/project/d0948r3-ATA-2.pdf (Page 66)
496
					$sbvals = explode(" ", "0.5,6 1,12 2,24 3,36 4,48 5,60 7.5,90 10,120 15,180 20,240 30,241 60,242");
497
?>
498
					<option value="" <?php if(!$pconfig['harddiskstandby']) echo('selected');?>>Always on</option>
499
<?php
500 5b237745 Scott Ullrich
					foreach ($sbvals as $sbval):
501
						list($min,$val) = explode(",", $sbval); ?>
502 9ecd6ab7 Erik Kristensen
					<option value="<?=$val;?>" <?php if($pconfig['harddiskstandby'] == $val) echo('selected');?>><?=$min;?> minutes</option>
503
<?php 				endforeach; ?>
504
				</select>
505
				<br />
506
				Puts the hard disk into standby mode when the selected amount of time after the last
507
				access has elapsed. <em>Do not set this for CF cards.</em>
508
			</td>
509
		</tr>
510 48ce54d0 Scott Ullrich
<?php endif; ?>
511 e6bbd933 Scott Ullrich
<?php
512
	if($config['interfaces']['lan']) 
513
		$lockout_interface = "LAN";
514
	else 
515
		$lockout_interface = "WAN";
516
?>
517 9ecd6ab7 Erik Kristensen
		<tr>
518 709cc6e0 Bill Marquette
			<td width="22%" valign="top" class="vncell">webConfigurator anti-lockout</td>
519 9ecd6ab7 Erik Kristensen
			<td width="78%" class="vtable">
520
				<input name="noantilockout" type="checkbox" id="noantilockout" value="yes" <?php if ($pconfig['noantilockout']) echo "checked"; ?> />
521 709cc6e0 Bill Marquette
				<strong>Disable webConfigurator anti-lockout rule</strong>
522 9ecd6ab7 Erik Kristensen
				<br />
523 e6bbd933 Scott Ullrich
				By default, access to the webConfigurator on the {$lockout_interface} interface is always permitted, regardless of the user-defined filter
524 709cc6e0 Bill Marquette
				rule set. Enable this feature to control webConfigurator access (make sure to have a filter rule in place that allows you
525 9ecd6ab7 Erik Kristensen
				in, or you will lock yourself out!).
526
				<br />
527 e6bbd933 Scott Ullrich
				Hint: the &quot;set configure IP address&quot; option in the console menu  resets this setting as well.
528 9ecd6ab7 Erik Kristensen
			</td>
529
		</tr>
530 bdac13de Scott Ullrich
		<tr>
531
			<td width="22%" valign="top" class="vncell">Static route filtering</td>
532
			<td width="78%" class="vtable">
533
				<input name="bypassstaticroutes" type="checkbox" id="bypassstaticroutes" value="yes" <?php if ($pconfig['bypassstaticroutes']) echo "checked"; ?> />
534
				<strong>Bypass firewall rules for traffic on the same interface</strong>
535
				<br />
536 48ce54d0 Scott Ullrich
				This option only applies if you have defined one or more static routes. If it is enabled, traffic that enters and
537
 				leaves through the same interface will not be checked by the firewall. This may be desirable in some situations where
538 bdac13de Scott Ullrich
				multiple subnets are connected to the same interface.
539
				<br />
540
			</td>
541
		</tr>
542 9ecd6ab7 Erik Kristensen
		<tr>
543
			<td width="22%" valign="top" class="vncell">IPsec SA preferral</td>
544
			<td width="78%" class="vtable">
545
				<input name="preferoldsa_enable" type="checkbox" id="preferoldsa_enable" value="yes" <?php if ($pconfig['preferoldsa_enable']) echo "checked"; ?> />
546
				<strong>Prefer old IPsec SAs</strong>
547
				<br />
548
				By default, if several SAs match, the newest one is preferred if it's at least 30 seconds old.Select this option to always prefer old SAs over new ones.
549
			</td>
550 48ce54d0 Scott Ullrich
		</tr>
551 9ecd6ab7 Erik Kristensen
		<tr>
552
			<td width="22%" valign="top">&nbsp;</td>
553
			<td width="78%">
554
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
555
			</td>
556
		</tr>
557
		<tr>
558
			<td colspan="2" class="list" height="12">&nbsp;</td>
559
		</tr>
560
		<tr>
561
			<td colspan="2" valign="top" class="listtopic">Traffic Shaper and Firewall Advanced</td>
562
		</tr>
563 073abaa6 Scott Ullrich
<?php
564
/*
565 81a6f5ea Scott Ullrich
		<tr>
566
			<td width="22%" valign="top" class="vncell">Traffic shaper type</td>
567
			<td width="78%" class="vtable">
568
				<select name="shapertype" class="formselect">
569
					<option value="pfSense"<?php if($pconfig['shapertype'] == 'pfSense') echo " selected"; ?>><?= $g['product_name'] ?> (ALTQ)</option>
570
					<option value="m0n0"<?php if($pconfig['shapertype'] == 'm0n0') echo " selected"; ?>>M0n0wall (dummynet)</option>
571
				</select>
572
			</td>
573
		</tr>
574 073abaa6 Scott Ullrich
*/
575
?>
576 9ecd6ab7 Erik Kristensen
		<tr>
577
			<td width="22%" valign="top" class="vncell">FTP RFC 959 data port violation workaround</td>
578
			<td width="78%" class="vtable">
579
				<input name="rfc959workaround" type="checkbox" id="rfc959workaround" value="yes" <?php if (isset($config['system']['rfc959workaround'])) echo "checked"; ?> onclick="enable_change(false)" />
580
				<strong class="vexpl">Workaround for sites that violate RFC 959 which specifies that the data connection be sourced from the command port - 1 (typically port 20).  This workaround doesn't expose you to any extra risk as the firewall will still only allow connections on a port that the ftp-proxy is listening on.</strong>
581
				<br />
582
			</td>
583
		</tr>
584 8f498445 Scott Ullrich
		<tr>
585
			<td width="22%" valign="top" class="vncell">Clear DF bit instead of dropping</td>
586
			<td width="78%" class="vtable">
587
				<input name="scrubnodf" type="checkbox" id="scrubnodf" value="yes" <?php if (isset($config['system']['scrubnodf'])) echo "checked"; ?> onclick="enable_change(false)" />
588
				<strong class="vexpl">Workaround for operating systems that generate fragmented packets with the don't fragment (DF) bit set.  Linux NFS is known to do this.  This will cause the filter to not drop such packets but instead clear the don't fragment bit.  The filter will also randomize the IP identification field of outgoing packets with this option on, to compensate for operating systems that set the DF bit but set a zero IP identification header field.</strong>
589
				<br />
590
			</td>
591
		</tr>
592 9ecd6ab7 Erik Kristensen
		<tr>
593
			<td width="22%" valign="top" class="vncell">Firewall Optimization Options</td>
594
			<td width="78%" class="vtable">
595
				<select onChange="update_description(this.selectedIndex);" name="optimization" id="optimization">
596
					<option value="normal"<?php if($config['system']['optimization']=="normal") echo " selected"; ?>>normal</option>
597
					<option value="high-latency"<?php if($config['system']['optimization']=="high-latency") echo " selected"; ?>>high-latency</option>
598
					<option value="aggressive"<?php if($config['system']['optimization']=="aggressive") echo " selected"; ?>>aggressive</option>
599
					<option value="conservative"<?php if($config['system']['optimization']=="conservative") echo " selected"; ?>>conservative</option>
600
				</select>
601
				<br />
602 d4fddf14 Scott Ullrich
				<textarea cols="60" rows="2" id="info" name="info"style="padding:5px; border:1px dashed #990000; background-color: #ffffff; color: #000000; font-size: 8pt;"></textarea>
603 9ecd6ab7 Erik Kristensen
				<script language="javascript" type="text/javascript">
604
					update_description(document.forms[0].optimization.selectedIndex);
605
				</script>
606
				<br />
607
				<span class="vexpl"><b>Select which type of state table optimization your would like to use</b></span>
608
			</td>
609
		</tr>
610
		<tr>
611
			<td width="22%" valign="top" class="vncell">Disable Firewall</td>
612
			<td width="78%" class="vtable">
613
				<input name="disablefilter" type="checkbox" id="disablefilter" value="yes" <?php if (isset($config['system']['disablefilter'])) echo "checked"; ?> onclick="enable_change(false)" />
614 a200ac93 Chris Buechler
				<strong>Disable all packet filtering.</strong>
615 9ecd6ab7 Erik Kristensen
				<br />
616 a200ac93 Chris Buechler
				<span class="vexpl">Note:  This converts <?= $g['product_name'] ?> into a routing only platform!<br>
617 8d0abf6b Scott Ullrich
				                    Note:  This will turn off NAT!
618
				</span>
619 9ecd6ab7 Erik Kristensen
			</td>
620
		</tr>
621 ff091d96 Scott Ullrich
		<tr>
622
			<td width="22%" valign="top" class="vncell">Disable Firewall Scrub</td>
623
			<td width="78%" class="vtable">
624
				<input name="disablescrub" type="checkbox" id="disablescrub" value="yes" <?php if (isset($config['system']['disablescrub'])) echo "checked"; ?> onclick="enable_change(false)" />
625
				<strong>Disables the PF scrubbing option which can sometimes interfere with NFS and PPTP traffic.</strong>
626
				<br/>
627
				Click <a href='http://www.openbsd.org/faq/pf/scrub.html' target='_new'>here</a> for more information.
628
			</td>
629
		</tr>
630 9ecd6ab7 Erik Kristensen
		<tr>
631
			<td width="22%" valign="top" class="vncell">Firewall Maximum States</td>
632
			<td width="78%" class="vtable">
633
				<input name="maximumstates" type="text" id="maximumstates" value="<?php echo $pconfig['maximumstates']; ?>" onclick="enable_change(false)" />
634
				<br />
635
				<strong>Maximum number of connections to hold in the firewall state table.</strong>
636
				<br />
637 639aaa95 Bill Marquette
				<span class="vexpl">Note:  Leave this blank for the default.  On your system the default size is: <?= pfsense_default_state_size() ?></span>
638 9ecd6ab7 Erik Kristensen
			</td>
639
		</tr>
640 a9b19d7f Scott Ullrich
		<tr>
641 b5675af6 Scott Ullrich
			<td width="22%" valign="top">&nbsp;</td>
642
			<td width="78%"><input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /></td>
643 a9b19d7f Scott Ullrich
		</tr>
644 612bb4f3 Scott Ullrich
	<?php if($config['interfaces']['lan']): ?>
645 b5675af6 Scott Ullrich
		<tr>
646
			<td colspan="2" class="list" height="12">&nbsp;</td>
647 48ce54d0 Scott Ullrich
		</tr>
648 a9b19d7f Scott Ullrich
		<tr>
649
			<td colspan="2" valign="top" class="listtopic">Network Address Translation</td>
650 612bb4f3 Scott Ullrich
		</tr>		
651 a9b19d7f Scott Ullrich
		<tr>
652 1b45d566 Scott Ullrich
			<td width="22%" valign="top" class="vncell">Disable NAT Reflection</td>
653 a9b19d7f Scott Ullrich
			<td width="78%" class="vtable">
654
				<input name="disablenatreflection" type="checkbox" id="disablenatreflection" value="yes" <?php if (isset($config['system']['disablenatreflection'])) echo "checked"; ?> onclick="enable_change(false)" />
655 3a9ba28f Scott Ullrich
				<strong>Disables the automatic creation of NAT redirect rules for access to your public IP addresses from within your internal networks.  Note: Reflection only works on port forward type items  and does not work for large ranges > 500 ports.</strong>
656 a9b19d7f Scott Ullrich
			</td>
657
		</tr>
658 507a5e3e Scott Ullrich
		<tr>
659
			<td width="22%" valign="top" class="vncell">Reflection Timeout</td>
660
			<td width="78%" class="vtable">
661 8e7b8da0 Scott Ullrich
				<input name="reflectiontimeout" id="reflectiontimeout" value="<?php echo $config['system']['reflectiontimeout']; ?>" />
662 507a5e3e Scott Ullrich
				<strong>Enter value for Reflection timeout in seconds.</strong>
663
			</td>
664
		</tr>
665 d2eb5def Scott Ullrich
		<tr>
666
			<td width="22%" valign="top">&nbsp;</td>
667
			<td width="78%"><input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /></td>
668
		</tr>
669 612bb4f3 Scott Ullrich
<?php endif; ?>
670
671 d2eb5def Scott Ullrich
		<tr>
672
			<td colspan="2" class="list" height="12">&nbsp;</td>
673
		</tr>
674
		<tr>
675
			<td colspan="2" valign="top" class="listtopic">Hardware Checksum Offloading</td>
676
		</tr>
677
		<tr>
678
			<td width="22%" valign="top" class="vncell">Disable Hardware Checksum Offloading</td>
679
			<td width="78%" class="vtable">
680
				<input name="disablechecksumoffloading" type="checkbox" id="disablechecksumoffloading" value="yes" <?php if (isset($config['system']['disablechecksumoffloading'])) echo "checked"; ?> onclick="enable_change(false)" />
681
				<strong>Checking this option will prevent hardware checksum offloading.  FreeBSD sometimes has difficulties with certain drivers.</strong>
682
			</td>
683
		</tr>		
684 9ecd6ab7 Erik Kristensen
		<tr>
685
			<td width="22%" valign="top">&nbsp;</td>
686
			<td width="78%"><input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /></td>
687
		</tr>
688
		<tr>
689
			<td colspan="2" class="list" height="12">&nbsp;</td>
690
		</tr>
691
	</tbody>
692
</table>
693 5b237745 Scott Ullrich
</form>
694 9ecd6ab7 Erik Kristensen
695
<script language="JavaScript" type="text/javascript">
696 5b237745 Scott Ullrich
<!--
697 9ecd6ab7 Erik Kristensen
	enable_change(false);
698 5b237745 Scott Ullrich
//-->
699
</script>
700 9ecd6ab7 Erik Kristensen
701 5b237745 Scott Ullrich
<?php include("fend.inc"); ?>
702 9ecd6ab7 Erik Kristensen
703 a6318c60 Scott Ullrich
</body>
704
</html>
705
706 8affb1da Scott Ullrich
<?php
707
708 d8e8296d Scott Ullrich
if($_POST['cert'] || $_POST['key']) {
709
	if (($config['system']['webgui']['certificate'] != $oldcert)
710
			|| ($config['system']['webgui']['private-key'] != $oldkey)) {
711
	    ob_flush();
712
	    flush();
713
	    log_error("webConfigurator certificates have changed.  Restarting webConfigurator.");
714
	    sleep(1);
715
		touch("/tmp/restart_webgui");
716
	}
717 04257637 Scott Ullrich
}
718
719 bdac13de Scott Ullrich
?>