Project

General

Profile

Download (30.2 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['ipv6allow'] = isset($config['system']['ipv6allow']);
42
$pconfig['cert'] = base64_decode($config['system']['webgui']['certificate']);
43
$pconfig['key'] = base64_decode($config['system']['webgui']['private-key']);
44
$pconfig['disableconsolemenu'] = isset($config['system']['disableconsolemenu']);
45
$pconfig['harddiskstandby'] = $config['system']['harddiskstandby'];
46
$pconfig['noantilockout'] = isset($config['system']['webgui']['noantilockout']);
47
$pconfig['filteringbridge_enable'] = isset($config['bridge']['filteringbridge']);
48
$pconfig['tcpidletimeout'] = $config['filter']['tcpidletimeout'];
49
$pconfig['maximumstates'] = $config['system']['maximumstates'];
50
$pconfig['disablerendevouz'] = $config['system']['disablerendevouz'];
51
$pconfig['enableserial'] = $config['system']['enableserial'];
52
$pconfig['disablefirmwarecheck'] = isset($config['system']['disablefirmwarecheck']);
53
$pconfig['preferoldsa_enable'] = isset($config['ipsec']['preferoldsa']);
54
$pconfig['enablesshd'] = $config['system']['enablesshd'];
55
$pconfig['sshport'] = $config['system']['ssh']['port'];
56
$pconfig['sshdkeyonly'] = $config['system']['ssh']['sshdkeyonly'];
57
$pconfig['authorizedkeys'] = base64_decode($config['system']['ssh']['authorizedkeys']);
58
$pconfig['sharednet'] = $config['system']['sharednet'];
59
$pconfig['polling_enable'] = isset($config['system']['polling']);
60
$pconfig['bypassstaticroutes'] = isset($config['filter']['bypassstaticroutes']);
61
$pconfig['disablenatreflection'] = $config['system']['disablenatreflection'];
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
                        touch("/var/etc/use_pf_pool__stickyaddr");
146
                } else {
147
			unset($config['system']['lb_use_sticky']);
148
                        unlink_if_exists("/var/etc/use_pf_pool__stickyaddr");
149
                }
150

    
151
		if($config['interfaces']['wan']['ipaddr'] == "pppoe") 
152
			unset($config['system']['lb_use_sticky']);
153

    
154
		if($_POST['sharednet'] == "yes") {
155
			$config['system']['sharednet'] = true;
156
			system_disable_arp_wrong_if();
157
		} else {
158
			unset($config['system']['sharednet']);
159
			system_enable_arp_wrong_if();
160
		}
161

    
162
		if($_POST['scrubnodf'] == "yes")
163
			$config['system']['scrubnodf'] = "enabled";
164
		else
165
			unset($config['system']['scrubnodf']);
166

    
167
		if($_POST['rfc959workaround'] == "yes")
168
			$config['system']['rfc959workaround'] = "enabled";
169
		else
170
			unset($config['system']['rfc959workaround']);
171

    
172
		if($_POST['ipv6nat_enable'] == "yes") {
173
			$config['diag']['ipv6nat']['enable'] = true;
174
			$config['diag']['ipv6nat']['ipaddr'] = $_POST['ipv6nat_ipaddr'];
175
		} else {
176
			unset($config['diag']['ipv6nat']['enable']);
177
			unset($config['diag']['ipv6nat']['ipaddr']);
178
		}
179
		if($_POST['ipv6allow'] == "yes") {
180
			$config['system']['ipv6allow'] = true;
181
		} else {
182
			unset($config['system']['ipv6allow']);
183
		}                
184
		$oldcert = $config['system']['webgui']['certificate'];
185
		$oldkey = $config['system']['webgui']['private-key'];
186
		$config['system']['webgui']['certificate'] = base64_encode($_POST['cert']);
187
		$config['system']['webgui']['private-key'] = base64_encode($_POST['key']);
188
		if($_POST['disableconsolemenu'] == "yes") {
189
			$config['system']['disableconsolemenu'] = true;
190
			auto_login(true);
191
		} else {
192
			unset($config['system']['disableconsolemenu']);
193
			auto_login(false);
194
		}
195
		unset($config['system']['webgui']['expanddiags']);
196
		$config['system']['optimization'] = $_POST['optimization'];
197

    
198
		if($_POST['disablefirmwarecheck'] == "yes")
199
			$config['system']['disablefirmwarecheck'] = true;
200
		else
201
			unset($config['system']['disablefirmwarecheck']);
202

    
203
		if ($_POST['enableserial'] == "yes")
204
			$config['system']['enableserial'] = true;
205
		else
206
			unset($config['system']['enableserial']);
207

    
208
		if($_POST['harddiskstandby'] <> "") {
209
			$config['system']['harddiskstandby'] = $_POST['harddiskstandby'];
210
			system_set_harddisk_standby();
211
		} else
212
			unset($config['system']['harddiskstandby']);
213

    
214
		if ($_POST['noantilockout'] == "yes")
215
			$config['system']['webgui']['noantilockout'] = true;
216
		else
217
			unset($config['system']['webgui']['noantilockout']);
218

    
219
		/* Firewall and ALTQ options */
220
		$config['system']['maximumstates'] = $_POST['maximumstates'];
221

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

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

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

    
240
		if($_POST['disablenatreflection'] == "yes") {
241
			$config['system']['disablenatreflection'] = $_POST['disablenatreflection'];
242
		} else {
243
			unset($config['system']['disablenatreflection']);
244
		}
245

    
246
		// Traffic shaper
247
		$config['system']['shapertype'] = $_POST['shapertype'];
248
		
249
		$config['ipsec']['preferoldsa'] = $_POST['preferoldsa_enable'] ? true : false;
250
		$config['bridge']['filteringbridge'] = $_POST['filteringbridge_enable'] ? true : false;
251
		$config['filter']['bypassstaticroutes'] = $_POST['bypassstaticroutes'] ? true : false;
252

    
253
		write_config();
254

    
255
		$retval = 0;
256
		config_lock();
257
		$retval = filter_configure();
258
		if(stristr($retval, "error") <> true)
259
		    $savemsg = get_std_save_message($retval);
260
		else
261
		    $savemsg = $retval;
262

    
263
		config_unlock();
264

    
265
		conf_mount_rw();
266

    
267
		setup_serial_port();
268

    
269
		conf_mount_ro();		
270
		
271

    
272
	}
273
}
274

    
275
$pgtitle = "System: Advanced functions";
276
include("head.inc");
277

    
278
?>
279

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

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

    
290
<table width="100%" border="0" cellpadding="6" cellspacing="0">
291
	<tbody>
292
		<?php if($g['platform'] == "pfSense" || $g['platform'] == "cdrom"): ?>
293
		<tr>
294
			<td colspan="2" valign="top" class="listtopic">Enable Serial Console</td>
295
		</tr>
296
		<tr>
297
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
298
			<td width="78%" class="vtable">
299
				<input name="enableserial" type="checkbox" id="enableserial" value="yes" <?php if (isset($pconfig['enableserial'])) echo "checked"; ?> onclick="enable_change(false)" />
300
				<strong>This will enable the first serial port with 9600/8/N/1</strong>
301
				<br>
302
				<span class="vexpl">Note:  This will disable the internal video card/keyboard</span>
303
			</td>
304
		</tr>
305
		<tr>
306
			<td width="22%" valign="top">&nbsp;</td>
307
			<td width="78%"><input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /></td>
308
		</tr>
309
		</tr>
310
		<tr>
311
			<td colspan="2" class="list" height="12"></td>
312
		</tr>
313
		<?php endif; ?>
314
		<tr>
315
			<td colspan="2" valign="top" class="listtopic">Secure Shell</td>
316
		</tr>
317
		<tr>
318
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
319
			<td width="78%" class="vtable">
320
				<input name="enablesshd" type="checkbox" id="enablesshd" value="yes" <?php if (isset($pconfig['enablesshd'])) echo "checked"; ?> onclick="enable_change(false)" />
321
				<strong>Enable Secure Shell</strong>
322
			</td>
323
		</tr>
324
 		<tr>
325
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
326
			<td width="78%" class="vtable">
327
				<input name="sshdkeyonly" type="checkbox" id="sshdkeyonly" value="yes" <?php if (isset($pconfig['sshdkeyonly'])) echo "checked"; ?> onclick="enable_change(false)" />
328
				<strong>Disable Password login for Secure Shell (KEY only)</strong>
329
			</td>
330
		</tr>
331
		<tr>
332
			<td width="22%" valign="top" class="vncell">SSH port</td>
333
			<td width="78%" class="vtable">
334
				<input name="sshport" type="text" id="sshport" value="<?php echo $pconfig['sshport']; ?>" onclick="enable_change(false)" />
335
				<br />
336
				<span class="vexpl">Note:  Leave this blank for the default of 22</span>
337
			</td>
338
		</tr>
339
		<tr>
340
			<td width="22%" valign="top" class="vncell"><?=gettext("Authorizedkeys");?></td>
341
			<td width="78%" class="vtable">
342
				<textarea name="authorizedkeys" cols="65" rows="7" id="authorizedkeys" class="formfld_cert"><?=htmlspecialchars($pconfig['authorizedkeys']);?></textarea>
343
				<br />
344
				Paste an authorized keys file here.
345
 			</td>
346
		</tr>
347
		<tr>
348
			<td width="22%" valign="top">&nbsp;</td>
349
			<td width="78%">
350
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
351
			</td>
352
		</tr>
353
		<tr>
354
			<td colspan="2" class="list" height="12">&nbsp;</td>
355
		</tr>
356
		<tr>
357
			<td colspan="2" valign="top" class="listtopic">Shared Physical Network</td>
358
		</tr>
359
		<tr>
360
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
361
			<td width="78%" class="vtable">
362
				<input name="sharednet" type="checkbox" id="sharednet" value="yes" <?php if (isset($pconfig['sharednet'])) echo "checked"; ?> onclick="enable_change(false)" />
363
				<strong>This will suppress ARP messages when interfaces share the same physical network</strong>
364
			</td>
365
		</tr>
366
		<tr>
367
			<td width="22%" valign="top">&nbsp;</td>
368
			<td width="78%">
369
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
370
			</td>
371
		</tr>
372
		<tr>
373
			<td colspan="2" class="list" height="12">&nbsp;</td>
374
		</tr>
375
		<tr>
376
			<td colspan="2" valign="top" class="listtopic">IPv6</td>
377
		</tr>
378
       		<tr>
379
			<td width="22%" valign="top" class="vncell">Allow IPv6</td>
380
			<td width="78%" class="vtable">
381
				<input name="ipv6allow" type="checkbox" id="ipv6allow" value="yes" <?php if ($pconfig['ipv6allow']) echo "checked"; ?> onclick="enable_change(false)" />
382
				<strong>Allow IPv6 traffic</strong>
383
				<br /> <br />
384
				All IPv6 traffic will be blocked unless this box is checked.
385
			</td>
386
		</tr>
387
		<tr>
388
			<td width="22%" valign="top" class="vncell">IPv6 tunneling</td>
389
			<td width="78%" class="vtable">
390
				<input name="ipv6nat_enable" type="checkbox" id="ipv6nat_enable" value="yes" <?php if ($pconfig['ipv6nat_enable']) echo "checked"; ?> onclick="enable_change(false)" />
391
				<strong>NAT encapsulated IPv6 packets (IP protocol 41/RFC2893) to:</strong>
392
				<br /> <br />
393
				<input name="ipv6nat_ipaddr" type="text" class="formfld" id="ipv6nat_ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipv6nat_ipaddr']);?>" />
394
				&nbsp;(IP address)
395
			</td>
396
		</tr>
397
        	<tr>
398
			<td width="22%" valign="top">&nbsp;</td>
399
			<td width="78%">
400
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
401
			</td>
402
		</tr>
403
		<tr>
404
			<td colspan="2" class="list" height="12">&nbsp;</td>
405
		</tr>
406
		<tr>
407
			<td colspan="2" valign="top" class="listtopic">Filtering Bridge</td>
408
		</tr>
409
                <tr>
410
                  <td width="22%" valign="top" class="vncell">&nbsp;</td>
411
                  <td width="78%" class="vtable">
412
                    <strong>Enable filtering bridge</strong><span class="vexpl"><br>
413
                    This setting no longer exists as it is unnecessary. Filtering
414
                    occurs on the member interfaces of the bridge and cannot be
415
                    disabled. </span></td>
416
                </tr>
417
		<tr>
418
			<td width="22%" valign="top">&nbsp;</td>
419
			<td width="78%">
420
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
421
			</td>
422
		</tr>
423
		<tr>
424
			<td colspan="2" class="list" height="12">&nbsp;</td>
425
		</tr>
426
		<tr>
427
			<td colspan="2" valign="top" class="listtopic">webGUI SSL certificate/key</td>
428
		</tr>
429
		<tr>
430
			<td width="22%" valign="top" class="vncell">Certificate</td>
431
			<td width="78%" class="vtable">
432
				<textarea name="cert" cols="65" rows="7" id="cert" class="formpre"><?=htmlspecialchars($pconfig['cert']);?></textarea>
433
				<br />
434
				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.
435
			</td>
436
		</tr>
437
		<tr>
438
			<td width="22%" valign="top" class="vncell">Key</td>
439
			<td width="78%" class="vtable">
440
				<textarea name="key" cols="65" rows="7" id="key" class="formpre"><?=htmlspecialchars($pconfig['key']);?></textarea>
441
				<br />
442
				Paste an RSA private key in PEM format here.
443
			</td>
444
		</tr>
445
		<tr>
446
			<td width="22%" valign="top">&nbsp;</td>
447
			<td width="78%">
448
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
449
			</td>
450
		</tr>
451
		<tr>
452
			<td colspan="2" class="list" height="12">&nbsp;</td>
453
		</tr>
454
		<tr>
455
			<td colspan="2" valign="top" class="listtopic">Load Balancing</td>
456
		</tr>
457
		<tr>
458
			<td width="22%" valign="top" class="vncell">Load Balancing</td>
459
			<td width="78%" class="vtable">
460
				<?php if($config['interfaces']['wan']['ipaddr'] == "pppoe"): ?>
461
					Sticky connections are disabled due to PPPoE being enabled.
462
				<?php else: ?>
463
					<input name="lb_use_sticky" type="checkbox" id="lb_use_sticky" value="yes" <?php if ($pconfig['lb_use_sticky']) echo "checked=\"checked\""; ?> />
464
				<?php endif; ?>
465
				<strong>Use sticky connections</strong>
466
				<br />
467
				<span class="vexpl">
468
				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.
469
				</span>
470
			</td>
471
		</tr>
472
		<tr>
473
			<td width="22%" valign="top">&nbsp;</td>
474
			<td width="78%">
475
				<input type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="enable_change(true)" />
476
			</td>
477
		</tr>
478
		<tr>
479
			<td colspan="2" class="list" height="12">&nbsp;</td>
480
		</tr>
481
		<tr>
482
			<td colspan="2" valign="top" class="listtopic">Miscellaneous</td>
483
		</tr>
484

    
485
                <tr>
486
                  <td width="22%" valign="top" class="vncell">Device polling</td>
487
                  <td width="78%" class="vtable">
488
                    <input name="polling_enable" type="checkbox" id="polling_enable" value="yes" <?php if ($pconfig['polling_enable']) echo "checked"; ?>>
489
                    <strong>Use device polling</strong><br>
490
                                        Device polling is a technique that lets the system periodically poll network devices for new data instead of relying on interrupts. This prevents your webGUI, SSH, etc. from being inaccessible due to interrupt floods when under extreme load. Generally this is not recommended.
491
                                        Not all NICs support polling; see the pfSense homepage for a list of supported cards.
492
                  </td>
493
                </tr>
494

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

    
694
<script language="JavaScript" type="text/javascript">
695
<!--
696
	enable_change(false);
697
//-->
698
</script>
699

    
700
<?php include("fend.inc"); ?>
701

    
702
</body>
703
</html>
704

    
705
<?php
706

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

    
718
?>
(138-138/174)