Project

General

Profile

Download (29.4 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['disablechecksumoffloading'] = isset($config['system']['disablechecksumoffloading']);
62
$pconfig['disablescrub'] = isset($config['system']['disablescrub']);
63
$pconfig['shapertype']             = $config['system']['shapertype'];
64
$pconfig['lb_use_sticky'] = isset($config['system']['lb_use_sticky']);
65

    
66
if ($_POST) {
67

    
68
	unset($input_errors);
69
	$pconfig = $_POST;
70

    
71
	/* input validation */
72
	if ($_POST['ipv6nat_enable'] && !is_ipaddr($_POST['ipv6nat_ipaddr'])) {
73
		$input_errors[] = "You must specify an IP address to NAT IPv6 packets.";
74
	}
75
	if ($_POST['maximumstates'] && !is_numericint($_POST['maximumstates'])) {
76
		$input_errors[] = "The Firewall Maximum States value must be an integer.";
77
	}
78
	if ($_POST['tcpidletimeout'] && !is_numericint($_POST['tcpidletimeout'])) {
79
		$input_errors[] = "The TCP idle timeout must be an integer.";
80
	}
81
	if (($_POST['cert'] && !$_POST['key']) || ($_POST['key'] && !$_POST['cert'])) {
82
		$input_errors[] = "Certificate and key must always be specified together.";
83
	} else if ($_POST['cert'] && $_POST['key']) {
84
		if (!strstr($_POST['cert'], "BEGIN CERTIFICATE") || !strstr($_POST['cert'], "END CERTIFICATE"))
85
			$input_errors[] = "This certificate does not appear to be valid.";
86
		if (!strstr($_POST['key'], "BEGIN RSA PRIVATE KEY") || !strstr($_POST['key'], "END RSA PRIVATE KEY"))
87
			$input_errors[] = "This key does not appear to be valid.";
88
	if ($_POST['altfirmwareurl'])
89
		if ($_POST['firmwareurl'] == "" || $_POST['firmwarename'] == "")
90
		$input_errors[] = "You must specify a base URL and a filename for the alternate firmware.";
91
	if ($_POST['altpkgconfigurl'])
92
		if ($_POST['pkgconfig_base_url'] == "" || $_POST['pkgconfig_filename'] == "")
93
		$input_errors[] = "You must specifiy and base URL and a filename before using an alternate pkg_config.xml.";
94
	}
95
	if ($_POST['maximumstates'] <> "") {
96
		if ($_POST['maximumstates'] < 1000)
97
			$input_errors[] = "States must be above 1000 and below 100000000";
98
		if ($_POST['maximumstates'] > 100000000)
99
			$input_errors[] = "States must be above 1000 and below 100000000";
100
	}
101
	if ($_POST['sshport'] <> "") {
102
		if( ! is_port($_POST['sshport'])) {
103
			$input_errors[] = "You must specify a valid port number";
104
		}
105
	}
106
	if($_POST['sshdkeyonly'] == "yes") {
107
		$config['system']['ssh']['sshdkeyonly'] = "enabled";
108
	} else {
109
		unset($config['system']['ssh']['sshdkeyonly']);
110
	}		
111
	$config['system']['ssh']['authorizedkeys'] = base64_encode($_POST['authorizedkeys']);
112

    
113
}
114

    
115
if ($_POST) {
116
    ob_flush();
117
    flush();
118
	if (!$input_errors) {
119
		if($_POST['disablefilter'] == "yes") {
120
			$config['system']['disablefilter'] = "enabled";
121
		} else {
122
			unset($config['system']['disablefilter']);
123
		}
124
		if($_POST['enablesshd'] == "yes") {
125
			$config['system']['enablesshd'] = "enabled";
126
			touch("{$g['tmp_path']}/start_sshd");
127
		} else {
128
			unset($config['system']['enablesshd']);
129
			mwexec("/usr/bin/killall sshd");
130
		}
131
		$oldsshport = $config['system']['ssh']['port'];
132
		$config['system']['ssh']['port'] = $_POST['sshport'];
133

    
134
		if($_POST['polling_enable'] == "yes") {
135
			$config['system']['polling'] = true;
136
			setup_polling();
137
		} else {
138
			unset($config['system']['polling']);
139
			setup_polling();
140
		}
141

    
142
		if($_POST['lb_use_sticky'] == "yes")
143
			$config['system']['lb_use_sticky'] = true;
144
		else
145
			unset($config['system']['lb_use_sticky']);
146

    
147
		if($_POST['sharednet'] == "yes") {
148
			$config['system']['sharednet'] = true;
149
			system_disable_arp_wrong_if();
150
		} else {
151
			unset($config['system']['sharednet']);
152
			system_enable_arp_wrong_if();
153
		}
154

    
155
		if($_POST['scrubnodf'] == "yes")
156
			$config['system']['scrubnodf'] = "enabled";
157
		else
158
			unset($config['system']['scrubnodf']);
159

    
160
		if($_POST['rfc959workaround'] == "yes")
161
			$config['system']['rfc959workaround'] = "enabled";
162
		else
163
			unset($config['system']['rfc959workaround']);
164

    
165
		if($_POST['ipv6nat_enable'] == "yes") {
166
			$config['diag']['ipv6nat']['enable'] = true;
167
			$config['diag']['ipv6nat']['ipaddr'] = $_POST['ipv6nat_ipaddr'];
168
		} else {
169
			unset($config['diag']['ipv6nat']['enable']);
170
			unset($config['diag']['ipv6nat']['ipaddr']);
171
		}
172
		$oldcert = $config['system']['webgui']['certificate'];
173
		$oldkey = $config['system']['webgui']['private-key'];
174
		$config['system']['webgui']['certificate'] = base64_encode($_POST['cert']);
175
		$config['system']['webgui']['private-key'] = base64_encode($_POST['key']);
176
		if($_POST['disableconsolemenu'] == "yes") {
177
			$config['system']['disableconsolemenu'] = true;
178
			auto_login(true);
179
		} else {
180
			unset($config['system']['disableconsolemenu']);
181
			auto_login(false);
182
		}
183
		unset($config['system']['webgui']['expanddiags']);
184
		$config['system']['optimization'] = $_POST['optimization'];
185

    
186
		if($_POST['disablefirmwarecheck'] == "yes")
187
			$config['system']['disablefirmwarecheck'] = true;
188
		else
189
			unset($config['system']['disablefirmwarecheck']);
190

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

    
196
		if($_POST['harddiskstandby'] <> "") {
197
			$config['system']['harddiskstandby'] = $_POST['harddiskstandby'];
198
			system_set_harddisk_standby();
199
		} else
200
			unset($config['system']['harddiskstandby']);
201

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

    
207
		/* Firewall and ALTQ options */
208
		$config['system']['maximumstates'] = $_POST['maximumstates'];
209

    
210
		if($_POST['enablesshd'] == "yes") {
211
			$config['system']['enablesshd'] = $_POST['enablesshd'];
212
		} else {
213
			unset($config['system']['enablesshd']);
214
		}
215

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

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

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

    
234
		// Traffic shaper
235
		$config['system']['shapertype'] = $_POST['shapertype'];
236
		
237
		$config['ipsec']['preferoldsa'] = $_POST['preferoldsa_enable'] ? true : false;
238
		$config['bridge']['filteringbridge'] = $_POST['filteringbridge_enable'] ? true : false;
239
		$config['filter']['bypassstaticroutes'] = $_POST['bypassstaticroutes'] ? true : false;
240

    
241
		write_config();
242

    
243
		$retval = 0;
244
		config_lock();
245
		$retval = filter_configure();
246
		if(stristr($retval, "error") <> true)
247
		    $savemsg = get_std_save_message($retval);
248
		else
249
		    $savemsg = $retval;
250

    
251
		config_unlock();
252

    
253
		setup_filter_bridge();
254
		
255
		conf_mount_rw();
256

    
257
		setup_serial_port();
258

    
259
		setup_filter_bridge();
260

    
261
		conf_mount_ro();		
262
		
263

    
264
	}
265
}
266

    
267
$pgtitle = "System: Advanced functions";
268
include("head.inc");
269

    
270
?>
271

    
272
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
273

    
274
<?php include("fbegin.inc"); ?>
275
<p class="pgtitle"><?=$pgtitle?></p>
276
<form action="system_advanced.php" method="post" name="iform" id="iform">
277
<?php if ($input_errors) print_input_errors($input_errors); ?>
278
<?php if ($savemsg) print_info_box($savemsg); ?>
279
<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>
280
<br />
281

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

    
461
                <tr>
462
                  <td width="22%" valign="top" class="vncell">Device polling</td>
463
                  <td width="78%" class="vtable">
464
                    <input name="polling_enable" type="checkbox" id="polling_enable" value="yes" <?php if ($pconfig['polling_enable']) echo "checked"; ?>>
465
                    <strong>Use device polling</strong><br>
466
                                        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.
467
                                        Not all NICs support polling; see the pfSense homepage for a list of supported cards.
468
                  </td>
469
                </tr>
470

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

    
670
<script language="JavaScript" type="text/javascript">
671
<!--
672
	enable_change(false);
673
//-->
674
</script>
675

    
676
<?php include("fend.inc"); ?>
677

    
678
</body>
679
</html>
680

    
681
<?php
682

    
683
if (($config['system']['webgui']['certificate'] != $oldcert)
684
		|| ($config['system']['webgui']['private-key'] != $oldkey)) {
685
    ob_flush();
686
    flush();
687
    log_error("webConfigurator certificates have changed.  Restarting webConfigurator.");
688
    sleep(1);
689
	touch("/tmp/restart_webgui");
690
}
691

    
692
?>
(135-135/171)