Project

General

Profile

Download (30.3 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
		system_advanced.php
5
        part of pfSense
6
        Copyright (C) 2005-2007 Scott Ullrich
7

    
8
	originally part of m0n0wall (http://m0n0.ch/wall)
9
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
10
	All rights reserved.
11

    
12
	Redistribution and use in source and binary forms, with or without
13
	modification, are permitted provided that the following conditions are met:
14

    
15
	1. Redistributions of source code must retain the above copyright notice,
16
	   this list of conditions and the following disclaimer.
17

    
18
	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

    
22
	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
$pconfig['disablefilter'] = $config['system']['disablefilter'];
37
$pconfig['rfc959workaround'] = $config['system']['rfc959workaround'];
38
$pconfig['scrubnodf'] = $config['system']['scrubnodf'];
39
$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
$pconfig['harddiskstandby'] = $config['system']['harddiskstandby'];
45
$pconfig['noantilockout'] = isset($config['system']['webgui']['noantilockout']);
46
$pconfig['filteringbridge_enable'] = isset($config['bridge']['filteringbridge']);
47
$pconfig['tcpidletimeout'] = $config['filter']['tcpidletimeout'];
48
$pconfig['maximumstates'] = $config['system']['maximumstates'];
49
$pconfig['disablerendevouz'] = $config['system']['disablerendevouz'];
50
$pconfig['enableserial'] = $config['system']['enableserial'];
51
$pconfig['disablefirmwarecheck'] = isset($config['system']['disablefirmwarecheck']);
52
$pconfig['preferoldsa_enable'] = isset($config['ipsec']['preferoldsa']);
53
$pconfig['enablesshd'] = $config['system']['enablesshd'];
54
$pconfig['sshport'] = $config['system']['ssh']['port'];
55
$pconfig['sshdkeyonly'] = $config['system']['ssh']['sshdkeyonly'];
56
$pconfig['authorizedkeys'] = base64_decode($config['system']['ssh']['authorizedkeys']);
57
$pconfig['sharednet'] = $config['system']['sharednet'];
58
$pconfig['polling_enable'] = isset($config['system']['polling']);
59
$pconfig['bypassstaticroutes'] = isset($config['filter']['bypassstaticroutes']);
60
$pconfig['disablenatreflection'] = $config['system']['disablenatreflection'];
61
$pconfig['reflectiontimeout'] = $config['system']['reflectiontimeout'];
62
$pconfig['disablechecksumoffloading'] = isset($config['system']['disablechecksumoffloading']);
63
$pconfig['disablescrub'] = isset($config['system']['disablescrub']);
64
$pconfig['shapertype']             = $config['system']['shapertype'];
65
$pconfig['lb_use_sticky'] = isset($config['system']['lb_use_sticky']);
66

    
67
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
	if ($_POST['maximumstates'] && !is_numericint($_POST['maximumstates'])) {
77
		$input_errors[] = "The Firewall Maximum States value must be an integer.";
78
	}
79
	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
	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
	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
	}
96
	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
	if ($_POST['sshport'] <> "") {
103
		if( ! is_port($_POST['sshport'])) {
104
			$input_errors[] = "You must specify a valid port number";
105
		}
106
	}
107
	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

    
114
}
115

    
116
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
		if($_POST['lb_use_sticky'] == "yes")
144
			$config['system']['lb_use_sticky'] = true;
145
		else
146
			unset($config['system']['lb_use_sticky']);
147

    
148
		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
			if($config['diag']) {
171
				if($config['diag']['ipv6nat']) {
172
					unset($config['diag']['ipv6nat']['enable']);
173
					unset($config['diag']['ipv6nat']['ipaddr']);				
174
				}
175
			}
176
		}
177
		$oldcert = $config['system']['webgui']['certificate'];
178
		$oldkey = $config['system']['webgui']['private-key'];
179
		$config['system']['webgui']['certificate'] = base64_encode($_POST['cert']);
180
		$config['system']['webgui']['private-key'] = base64_encode($_POST['key']);
181
		if($_POST['disableconsolemenu'] == "yes") {
182
			$config['system']['disableconsolemenu'] = true;
183
			auto_login(true);
184
		} else {
185
			unset($config['system']['disableconsolemenu']);
186
			auto_login(false);
187
		}
188
		unset($config['system']['webgui']['expanddiags']);
189
		$config['system']['optimization'] = $_POST['optimization'];
190

    
191
		if($_POST['disablefirmwarecheck'] == "yes")
192
			$config['system']['disablefirmwarecheck'] = true;
193
		else
194
			unset($config['system']['disablefirmwarecheck']);
195

    
196
		if ($_POST['enableserial'] == "yes")
197
			$config['system']['enableserial'] = true;
198
		else
199
			unset($config['system']['enableserial']);
200

    
201
		if($_POST['harddiskstandby'] <> "") {
202
			$config['system']['harddiskstandby'] = $_POST['harddiskstandby'];
203
			system_set_harddisk_standby();
204
		} else
205
			unset($config['system']['harddiskstandby']);
206

    
207
		if ($_POST['noantilockout'] == "yes")
208
			$config['system']['webgui']['noantilockout'] = true;
209
		else
210
			unset($config['system']['webgui']['noantilockout']);
211

    
212
		/* Firewall and ALTQ options */
213
		$config['system']['maximumstates'] = $_POST['maximumstates'];
214

    
215
		if($_POST['enablesshd'] == "yes") {
216
			$config['system']['enablesshd'] = $_POST['enablesshd'];
217
		} else {
218
			unset($config['system']['enablesshd']);
219
		}
220

    
221
		if($_POST['disablechecksumoffloading'] == "yes") {
222
			$config['system']['disablechecksumoffloading'] = $_POST['disablechecksumoffloading'];
223
		} else {
224
			unset($config['system']['disablechecksumoffloading']);
225
		}
226

    
227
		if($_POST['disablescrub'] == "yes") {
228
			$config['system']['disablescrub'] = $_POST['disablescrub'];
229
		} else {
230
			unset($config['system']['disablescrub']);
231
		}
232

    
233
		if($_POST['disablenatreflection'] == "yes") {
234
			$config['system']['disablenatreflection'] = $_POST['disablenatreflection'];
235
		} else {
236
			unset($config['system']['disablenatreflection']);
237
		}
238
		
239
		$config['system']['reflectiontimeout'] = $_POST['reflectiontimeout'];
240

    
241
		// Traffic shaper
242
		$config['system']['shapertype'] = $_POST['shapertype'];
243
		
244
		$config['ipsec']['preferoldsa'] = $_POST['preferoldsa_enable'] ? true : false;
245
		$config['bridge']['filteringbridge'] = $_POST['filteringbridge_enable'] ? true : false;
246
		$config['filter']['bypassstaticroutes'] = $_POST['bypassstaticroutes'] ? true : false;
247

    
248
		write_config();
249

    
250
		$retval = 0;
251
		config_lock();
252
		$retval = filter_configure();
253
		if(stristr($retval, "error") <> true)
254
		    $savemsg = get_std_save_message($retval);
255
		else
256
		    $savemsg = $retval;
257

    
258
		config_unlock();
259

    
260
		setup_filter_bridge();
261
		
262
		conf_mount_rw();
263

    
264
		setup_serial_port();
265

    
266
		setup_filter_bridge();
267

    
268
		conf_mount_ro();		
269
		
270

    
271
	}
272
}
273

    
274
$pgtitle = array("System","Advanced functions");
275
include("head.inc");
276

    
277
?>
278

    
279
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
280

    
281
<?php include("fbegin.inc"); ?>
282
<form action="system_advanced.php" method="post" name="iform" id="iform">
283
<?php if ($input_errors) print_input_errors($input_errors); ?>
284
<?php if ($savemsg) print_info_box($savemsg); ?>
285
<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>
286
<br />
287

    
288
<table width="100%" border="0" cellpadding="6" cellspacing="0">
289
	<tbody>
290
		<?php if($g['platform'] == "pfSense" || $g['platform'] == "cdrom"): ?>
291
		<tr>
292
			<td colspan="2" valign="top" class="listtopic">Enable Serial Console</td>
293
		</tr>
294
		<tr>
295
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
296
			<td width="78%" class="vtable">
297
				<input name="enableserial" type="checkbox" id="enableserial" value="yes" <?php if (isset($pconfig['enableserial'])) echo "checked"; ?> onclick="enable_change(false)" />
298
				<strong>This will enable the first serial port with 9600/8/N/1</strong>
299
				<br>
300
				<span class="vexpl">Note:  This will disable the internal video card/keyboard</span>
301
			</td>
302
		</tr>
303
		<tr>
304
			<td width="22%" valign="top">&nbsp;</td>
305
			<td width="78%"><input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /></td>
306
		</tr>
307
		</tr>
308
		<tr>
309
			<td colspan="2" class="list" height="12"></td>
310
		</tr>
311
		<?php endif; ?>
312
		<tr>
313
			<td colspan="2" valign="top" class="listtopic">Secure Shell</td>
314
		</tr>
315
		<tr>
316
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
317
			<td width="78%" class="vtable">
318
				<input name="enablesshd" type="checkbox" id="enablesshd" value="yes" <?php if (isset($pconfig['enablesshd'])) echo "checked"; ?> onclick="enable_change(false)" />
319
				<strong>Enable Secure Shell</strong>
320
			</td>
321
		</tr>
322
 		<tr>
323
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
324
			<td width="78%" class="vtable">
325
				<input name="sshdkeyonly" type="checkbox" id="sshdkeyonly" value="yes" <?php if (isset($pconfig['sshdkeyonly'])) echo "checked"; ?> onclick="enable_change(false)" />
326
				<strong>Disable Password login for Secure Shell (KEY only)</strong>
327
			</td>
328
		</tr>
329
		<tr>
330
			<td width="22%" valign="top" class="vncell">SSH port</td>
331
			<td width="78%" class="vtable">
332
				<input name="sshport" type="text" id="sshport" value="<?php echo $pconfig['sshport']; ?>" onclick="enable_change(false)" />
333
				<br />
334
				<span class="vexpl">Note:  Leave this blank for the default of 22</span>
335
			</td>
336
		</tr>
337
		<tr>
338
			<td width="22%" valign="top" class="vncell"><?=gettext("Authorizedkeys");?></td>
339
			<td width="78%" class="vtable">
340
				<textarea name="authorizedkeys" cols="65" rows="7" id="authorizedkeys" class="formfld_cert"><?=htmlspecialchars($pconfig['authorizedkeys']);?></textarea>
341
				<br />
342
				Paste an authorized keys file here.
343
 			</td>
344
		</tr>
345
		<tr>
346
			<td width="22%" valign="top">&nbsp;</td>
347
			<td width="78%">
348
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
349
			</td>
350
		</tr>
351
		<tr>
352
			<td colspan="2" class="list" height="12">&nbsp;</td>
353
		</tr>
354
		<tr>
355
			<td colspan="2" valign="top" class="listtopic">Shared Physical Network</td>
356
		</tr>
357
		<tr>
358
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
359
			<td width="78%" class="vtable">
360
				<input name="sharednet" type="checkbox" id="sharednet" value="yes" <?php if (isset($pconfig['sharednet'])) echo "checked"; ?> onclick="enable_change(false)" />
361
				<strong>This will suppress ARP messages when interfaces share the same physical network</strong>
362
			</td>
363
		</tr>
364
		<tr>
365
			<td width="22%" valign="top">&nbsp;</td>
366
			<td width="78%">
367
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
368
			</td>
369
		</tr>
370
		<tr>
371
			<td colspan="2" class="list" height="12">&nbsp;</td>
372
		</tr>
373
		<tr>
374
			<td colspan="2" valign="top" class="listtopic">IPv6 tunneling</td>
375
		</tr>
376
		<tr>
377
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
378
			<td width="78%" class="vtable">
379
				<input name="ipv6nat_enable" type="checkbox" id="ipv6nat_enable" value="yes" <?php if ($pconfig['ipv6nat_enable']) echo "checked"; ?> onclick="enable_change(false)" />
380
				<strong>NAT encapsulated IPv6 packets (IP protocol 41/RFC2893) to:</strong>
381
				<br /> <br />
382
				<input name="ipv6nat_ipaddr" type="text" class="formfld unknown" id="ipv6nat_ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipv6nat_ipaddr']);?>" />
383
				&nbsp;(IP address)<span class="vexpl"><br /> Don't forget to add a firewall rule to permit IPv6 packets!</span>
384
			</td>
385
		</tr>
386
		<tr>
387
			<td colspan="2" class="list" height="12">&nbsp;</td>
388
		</tr>
389
		<tr>
390
			<td colspan="2" valign="top" class="listtopic">Filtering Bridge</td>
391
		</tr>
392
                <tr>
393
                  <td width="22%" valign="top" class="vncell">&nbsp;</td>
394
                  <td width="78%" class="vtable">
395
                    <input name="filteringbridge_enable" type="checkbox" id="filteringbridge_enable" value="yes" <?php if ($pconfig['filteringbridge_enable']) echo "checked"; ?>>
396
                    <strong>Enable filtering bridge</strong><span class="vexpl"><br>
397
                    This will cause bridged packets to pass through the packet
398
                    filter in the same way as routed packets do (by default bridged
399
                    packets are always passed). If you enable this option, you'll
400
                    have to add filter rules to selectively permit traffic from
401
                    bridged interfaces.</span></td>
402
                </tr>
403
		<tr>
404
			<td width="22%" valign="top">&nbsp;</td>
405
			<td width="78%">
406
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
407
			</td>
408
		</tr>
409
		<tr>
410
			<td colspan="2" class="list" height="12">&nbsp;</td>
411
		</tr>
412
		<tr>
413
			<td colspan="2" valign="top" class="listtopic">webConfigurator SSL certificate/key</td>
414
		</tr>
415
		<tr>
416
			<td width="22%" valign="top" class="vncell">Certificate</td>
417
			<td width="78%" class="vtable">
418
				<textarea name="cert" cols="65" rows="7" id="cert" class="formpre"><?=htmlspecialchars($pconfig['cert']);?></textarea>
419
				<br />
420
				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.
421
			</td>
422
		</tr>
423
		<tr>
424
			<td width="22%" valign="top" class="vncell">Key</td>
425
			<td width="78%" class="vtable">
426
				<textarea name="key" cols="65" rows="7" id="key" class="formpre"><?=htmlspecialchars($pconfig['key']);?></textarea>
427
				<br />
428
				Paste an RSA private key in PEM format here.
429
			</td>
430
		</tr>
431
		<tr>
432
			<td width="22%" valign="top">&nbsp;</td>
433
			<td width="78%">
434
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
435
			</td>
436
		</tr>
437
		<tr>
438
			<td colspan="2" class="list" height="12">&nbsp;</td>
439
		</tr>
440

    
441
		<tr>
442
			<td colspan="2" valign="top" class="listtopic">Load Balancing</td>
443
		</tr>
444
		<tr>
445
			<td width="22%" valign="top" class="vncell">Load Balancing</td>
446
			<td width="78%" class="vtable">
447
				<input name="lb_use_sticky" type="checkbox" id="lb_use_sticky" value="yes" <?php if ($pconfig['lb_use_sticky']) echo "checked=\"checked\""; ?> />
448
				<strong>Use sticky connections</strong>
449
				<br />
450
				<span class="vexpl">
451
				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.
452
				</span>
453
			</td>
454
		</tr>
455
		<tr>
456
			<td width="22%" valign="top">&nbsp;</td>
457
			<td width="78%">
458
				<input type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
459
			</td>
460
		</tr>
461
		<tr>
462
			<td colspan="2" class="list" height="12">&nbsp;</td>
463
		</tr>
464

    
465
		<tr>
466
			<td colspan="2" valign="top" class="listtopic">Miscellaneous</td>
467
		</tr>
468

    
469
		<tr>
470
			<td colspan="2" class="list" height="12">&nbsp;</td>
471
		</tr>
472

    
473

    
474
                <tr>
475
                  <td width="22%" valign="top" class="vncell">Device polling</td>
476
                  <td width="78%" class="vtable">
477
                    <input name="polling_enable" type="checkbox" id="polling_enable" value="yes" <?php if ($pconfig['polling_enable']) echo "checked"; ?>>
478
                    <strong>Use device polling</strong><br>
479
						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.
480
						Not all NICs support polling; see the <?= $g['product_name'] ?> homepage for a list of supported cards.
481
                  </td>
482
                </tr>
483

    
484
		<tr>
485
			<td width="22%" valign="top" class="vncell">Console menu </td>
486
			<td width="78%" class="vtable">
487
				<input name="disableconsolemenu" type="checkbox" id="disableconsolemenu" value="yes" <?php if ($pconfig['disableconsolemenu']) echo "checked"; ?>  />
488
				<strong>Disable console menu</strong>
489
				<br />
490
				<span class="vexpl">Changes to this option will take effect after a reboot.</span>
491
			</td>
492
		</tr>
493
<?php if($g['platform'] == "pfSenseDISABLED"): ?>
494
		<tr>
495
			<td width="22%" valign="top" class="vncell">Hard disk standby time </td>
496
			<td width="78%" class="vtable">
497
				<select name="harddiskstandby" class="formselect">
498
<?php
499
				 	## Values from ATA-2 http://www.t13.org/project/d0948r3-ATA-2.pdf (Page 66)
500
					$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");
501
?>
502
					<option value="" <?php if(!$pconfig['harddiskstandby']) echo('selected');?>>Always on</option>
503
<?php
504
					foreach ($sbvals as $sbval):
505
						list($min,$val) = explode(",", $sbval); ?>
506
					<option value="<?=$val;?>" <?php if($pconfig['harddiskstandby'] == $val) echo('selected');?>><?=$min;?> minutes</option>
507
<?php 				endforeach; ?>
508
				</select>
509
				<br />
510
				Puts the hard disk into standby mode when the selected amount of time after the last
511
				access has elapsed. <em>Do not set this for CF cards.</em>
512
			</td>
513
		</tr>
514
<?php endif; ?>
515
<?php
516
	if($config['interfaces']['lan']) 
517
		$lockout_interface = "LAN";
518
	else 
519
		$lockout_interface = "WAN";
520
?>
521
		<tr>
522
			<td width="22%" valign="top" class="vncell">webConfigurator anti-lockout</td>
523
			<td width="78%" class="vtable">
524
				<input name="noantilockout" type="checkbox" id="noantilockout" value="yes" <?php if ($pconfig['noantilockout']) echo "checked"; ?> />
525
				<strong>Disable webConfigurator anti-lockout rule</strong>
526
				<br />
527
				By default, access to the webConfigurator on the {$lockout_interface} interface is always permitted, regardless of the user-defined filter
528
				rule set. Enable this feature to control webConfigurator access (make sure to have a filter rule in place that allows you
529
				in, or you will lock yourself out!).
530
				<br />
531
				Hint: the &quot;set configure IP address&quot; option in the console menu  resets this setting as well.
532
			</td>
533
		</tr>
534
		<tr>
535
			<td width="22%" valign="top" class="vncell">Static route filtering</td>
536
			<td width="78%" class="vtable">
537
				<input name="bypassstaticroutes" type="checkbox" id="bypassstaticroutes" value="yes" <?php if ($pconfig['bypassstaticroutes']) echo "checked"; ?> />
538
				<strong>Bypass firewall rules for traffic on the same interface</strong>
539
				<br />
540
				This option only applies if you have defined one or more static routes. If it is enabled, traffic that enters and
541
 				leaves through the same interface will not be checked by the firewall. This may be desirable in some situations where
542
				multiple subnets are connected to the same interface.
543
				<br />
544
			</td>
545
		</tr>
546
		<tr>
547
			<td width="22%" valign="top" class="vncell">IPsec SA preferral</td>
548
			<td width="78%" class="vtable">
549
				<input name="preferoldsa_enable" type="checkbox" id="preferoldsa_enable" value="yes" <?php if ($pconfig['preferoldsa_enable']) echo "checked"; ?> />
550
				<strong>Prefer old IPsec SAs</strong>
551
				<br />
552
				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.
553
			</td>
554
		</tr>
555
		<tr>
556
			<td width="22%" valign="top">&nbsp;</td>
557
			<td width="78%">
558
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
559
			</td>
560
		</tr>
561
		<tr>
562
			<td colspan="2" class="list" height="12">&nbsp;</td>
563
		</tr>
564
		<tr>
565
			<td colspan="2" valign="top" class="listtopic">Traffic Shaper and Firewall Advanced</td>
566
		</tr>
567
<?php
568
/*
569
		<tr>
570
			<td width="22%" valign="top" class="vncell">Traffic shaper type</td>
571
			<td width="78%" class="vtable">
572
				<select name="shapertype" class="formselect">
573
					<option value="pfSense"<?php if($pconfig['shapertype'] == 'pfSense') echo " selected"; ?>><?= $g['product_name'] ?> (ALTQ)</option>
574
					<option value="m0n0"<?php if($pconfig['shapertype'] == 'm0n0') echo " selected"; ?>>M0n0wall (dummynet)</option>
575
				</select>
576
			</td>
577
		</tr>
578
*/
579
?>
580
		<tr>
581
			<td width="22%" valign="top" class="vncell">FTP RFC 959 data port violation workaround</td>
582
			<td width="78%" class="vtable">
583
				<input name="rfc959workaround" type="checkbox" id="rfc959workaround" value="yes" <?php if (isset($config['system']['rfc959workaround'])) echo "checked"; ?> onclick="enable_change(false)" />
584
				<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>
585
				<br />
586
			</td>
587
		</tr>
588
		<tr>
589
			<td width="22%" valign="top" class="vncell">Clear DF bit instead of dropping</td>
590
			<td width="78%" class="vtable">
591
				<input name="scrubnodf" type="checkbox" id="scrubnodf" value="yes" <?php if (isset($config['system']['scrubnodf'])) echo "checked"; ?> onclick="enable_change(false)" />
592
				<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>
593
				<br />
594
			</td>
595
		</tr>
596
		<tr>
597
			<td width="22%" valign="top" class="vncell">Firewall Optimization Options</td>
598
			<td width="78%" class="vtable">
599
				<select onChange="update_description(this.selectedIndex);" name="optimization" id="optimization">
600
					<option value="normal"<?php if($config['system']['optimization']=="normal") echo " selected"; ?>>normal</option>
601
					<option value="high-latency"<?php if($config['system']['optimization']=="high-latency") echo " selected"; ?>>high-latency</option>
602
					<option value="aggressive"<?php if($config['system']['optimization']=="aggressive") echo " selected"; ?>>aggressive</option>
603
					<option value="conservative"<?php if($config['system']['optimization']=="conservative") echo " selected"; ?>>conservative</option>
604
				</select>
605
				<br />
606
				<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>
607
				<script language="javascript" type="text/javascript">
608
					update_description(document.forms[0].optimization.selectedIndex);
609
				</script>
610
				<br />
611
				<span class="vexpl"><b>Select which type of state table optimization your would like to use</b></span>
612
			</td>
613
		</tr>
614
		<tr>
615
			<td width="22%" valign="top" class="vncell">Disable Firewall</td>
616
			<td width="78%" class="vtable">
617
				<input name="disablefilter" type="checkbox" id="disablefilter" value="yes" <?php if (isset($config['system']['disablefilter'])) echo "checked"; ?> onclick="enable_change(false)" />
618
				<strong>Disable all packet filtering.</strong>
619
				<br />
620
				<span class="vexpl">Note:  This converts <?= $g['product_name'] ?> into a routing only platform!<br>
621
				                    Note:  This will turn off NAT!
622
				</span>
623
			</td>
624
		</tr>
625
		<tr>
626
			<td width="22%" valign="top" class="vncell">Disable Firewall Scrub</td>
627
			<td width="78%" class="vtable">
628
				<input name="disablescrub" type="checkbox" id="disablescrub" value="yes" <?php if (isset($config['system']['disablescrub'])) echo "checked"; ?> onclick="enable_change(false)" />
629
				<strong>Disables the PF scrubbing option which can sometimes interfere with NFS and PPTP traffic.</strong>
630
				<br/>
631
				Click <a href='http://www.openbsd.org/faq/pf/scrub.html' target='_new'>here</a> for more information.
632
			</td>
633
		</tr>
634
		<tr>
635
			<td width="22%" valign="top" class="vncell">Firewall Maximum States</td>
636
			<td width="78%" class="vtable">
637
				<input name="maximumstates" type="text" id="maximumstates" value="<?php echo $pconfig['maximumstates']; ?>" onclick="enable_change(false)" />
638
				<br />
639
				<strong>Maximum number of connections to hold in the firewall state table.</strong>
640
				<br />
641
				<span class="vexpl">Note:  Leave this blank for the default.  On your system the default size is: <?= pfsense_default_state_size() ?></span>
642
			</td>
643
		</tr>
644
		<tr>
645
			<td width="22%" valign="top">&nbsp;</td>
646
			<td width="78%"><input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /></td>
647
		</tr>
648
	<?php if($config['interfaces']['lan']): ?>
649
		<tr>
650
			<td colspan="2" class="list" height="12">&nbsp;</td>
651
		</tr>
652
		<tr>
653
			<td colspan="2" valign="top" class="listtopic">Network Address Translation</td>
654
		</tr>		
655
		<tr>
656
			<td width="22%" valign="top" class="vncell">Disable NAT Reflection</td>
657
			<td width="78%" class="vtable">
658
				<input name="disablenatreflection" type="checkbox" id="disablenatreflection" value="yes" <?php if (isset($config['system']['disablenatreflection'])) echo "checked"; ?> onclick="enable_change(false)" />
659
				<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>
660
			</td>
661
		</tr>
662
		<tr>
663
			<td width="22%" valign="top" class="vncell">Reflection Timeout</td>
664
			<td width="78%" class="vtable">
665
				<input name="reflectiontimeout" id="reflectiontimeout" value="<?php echo $config['system']['reflectiontimeout']; ?>" />
666
				<strong>Enter value for Reflection timeout in seconds.</strong>
667
			</td>
668
		</tr>
669
		<tr>
670
			<td width="22%" valign="top">&nbsp;</td>
671
			<td width="78%"><input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /></td>
672
		</tr>
673
<?php endif; ?>
674

    
675
		<tr>
676
			<td colspan="2" class="list" height="12">&nbsp;</td>
677
		</tr>
678
		<tr>
679
			<td colspan="2" valign="top" class="listtopic">Hardware Checksum Offloading</td>
680
		</tr>
681
		<tr>
682
			<td width="22%" valign="top" class="vncell">Disable Hardware Checksum Offloading</td>
683
			<td width="78%" class="vtable">
684
				<input name="disablechecksumoffloading" type="checkbox" id="disablechecksumoffloading" value="yes" <?php if (isset($config['system']['disablechecksumoffloading'])) echo "checked"; ?> onclick="enable_change(false)" />
685
				<strong>Checking this option will prevent hardware checksum offloading.  FreeBSD sometimes has difficulties with certain drivers.</strong>
686
			</td>
687
		</tr>		
688
		<tr>
689
			<td width="22%" valign="top">&nbsp;</td>
690
			<td width="78%"><input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /></td>
691
		</tr>
692
		<tr>
693
			<td colspan="2" class="list" height="12">&nbsp;</td>
694
		</tr>
695
	</tbody>
696
</table>
697
</form>
698

    
699
<script language="JavaScript" type="text/javascript">
700
<!--
701
	enable_change(false);
702
//-->
703
</script>
704

    
705
<?php include("fend.inc"); ?>
706

    
707
</body>
708
</html>
709

    
710
<?php
711

    
712
if($_POST['cert'] || $_POST['key']) {
713
	if (($config['system']['webgui']['certificate'] != $oldcert)
714
			|| ($config['system']['webgui']['private-key'] != $oldkey)) {
715
	    ob_flush();
716
	    flush();
717
	    log_error("webConfigurator certificates have changed.  Restarting webConfigurator.");
718
	    sleep(1);
719
		touch("/tmp/restart_webgui");
720
	}
721
}
722

    
723
?>
(146-146/193)