Project

General

Profile

Download (27.1 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['sharednet'] = $config['system']['sharednet'];
56
$pconfig['polling_enable'] = isset($config['system']['polling']);
57
$pconfig['bypassstaticroutes'] = isset($config['filter']['bypassstaticroutes']);
58
$pconfig['disablenatreflection'] = $config['system']['disablenatreflection'];
59
$pconfig['disablechecksumoffloading'] = isset($config['system']['disablechecksumoffloading']);
60
$pconfig['disablescrub'] = isset($config['system']['disablescrub']);
61
$pconfig['shapertype']             = $config['system']['shapertype'];
62

    
63
if ($_POST) {
64

    
65
	unset($input_errors);
66
	$pconfig = $_POST;
67

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

    
104
}
105

    
106
if ($_POST) {
107
    ob_flush();
108
    flush();
109
	if (!$input_errors) {
110
		if($_POST['disablefilter'] == "yes") {
111
			$config['system']['disablefilter'] = "enabled";
112
		} else {
113
			unset($config['system']['disablefilter']);
114
		}
115
		if($_POST['enablesshd'] == "yes") {
116
			$config['system']['enablesshd'] = "enabled";
117
			touch("{$g['tmp_path']}/start_sshd");
118
		} else {
119
			unset($config['system']['enablesshd']);
120
			mwexec("/usr/bin/killall sshd");
121
		}
122
		$oldsshport = $config['system']['ssh']['port'];
123
		$config['system']['ssh']['port'] = $_POST['sshport'];
124

    
125
		if($_POST['polling_enable'] == "yes") {
126
			$config['system']['polling'] = true;
127
			setup_polling();
128
		} else {
129
			unset($config['system']['polling']);
130
			setup_polling();
131
		}
132

    
133
		if($_POST['sharednet'] == "yes") {
134
			$config['system']['sharednet'] = true;
135
			system_disable_arp_wrong_if();
136
		} else {
137
			unset($config['system']['sharednet']);
138
			system_enable_arp_wrong_if();
139
		}
140

    
141
		if($_POST['scrubnodf'] == "yes")
142
			$config['system']['scrubnodf'] = "enabled";
143
		else
144
			unset($config['system']['scrubnodf']);
145

    
146
		if($_POST['rfc959workaround'] == "yes")
147
			$config['system']['rfc959workaround'] = "enabled";
148
		else
149
			unset($config['system']['rfc959workaround']);
150

    
151
		if($_POST['ipv6nat_enable'] == "yes") {
152
			$config['diag']['ipv6nat']['enable'] = true;
153
			$config['diag']['ipv6nat']['ipaddr'] = $_POST['ipv6nat_ipaddr'];
154
		} else {
155
			unset($config['diag']['ipv6nat']['enable']);
156
			unset($config['diag']['ipv6nat']['ipaddr']);
157
		}
158
		$oldcert = $config['system']['webgui']['certificate'];
159
		$oldkey = $config['system']['webgui']['private-key'];
160
		$config['system']['webgui']['certificate'] = base64_encode($_POST['cert']);
161
		$config['system']['webgui']['private-key'] = base64_encode($_POST['key']);
162
		if($_POST['disableconsolemenu'] == "yes") {
163
			$config['system']['disableconsolemenu'] = true;
164
			auto_login(true);
165
		} else {
166
			unset($config['system']['disableconsolemenu']);
167
			auto_login(false);
168
		}
169
		unset($config['system']['webgui']['expanddiags']);
170
		$config['system']['optimization'] = $_POST['optimization'];
171

    
172
		if($_POST['disablefirmwarecheck'] == "yes")
173
			$config['system']['disablefirmwarecheck'] = true;
174
		else
175
			unset($config['system']['disablefirmwarecheck']);
176

    
177
		if ($_POST['enableserial'] == "yes")
178
			$config['system']['enableserial'] = true;
179
		else
180
			unset($config['system']['enableserial']);
181

    
182
		if($_POST['harddiskstandby'] <> "") {
183
			$config['system']['harddiskstandby'] = $_POST['harddiskstandby'];
184
			system_set_harddisk_standby();
185
		} else
186
			unset($config['system']['harddiskstandby']);
187

    
188
		if ($_POST['noantilockout'] == "yes")
189
			$config['system']['webgui']['noantilockout'] = true;
190
		else
191
			unset($config['system']['webgui']['noantilockout']);
192

    
193
		/* Firewall and ALTQ options */
194
		$config['system']['maximumstates'] = $_POST['maximumstates'];
195

    
196
		if($_POST['enablesshd'] == "yes") {
197
			$config['system']['enablesshd'] = $_POST['enablesshd'];
198
		} else {
199
			unset($config['system']['enablesshd']);
200
		}
201

    
202
		if($_POST['disablechecksumoffloading'] == "yes") {
203
			$config['system']['disablechecksumoffloading'] = $_POST['disablechecksumoffloading'];
204
		} else {
205
			unset($config['system']['disablechecksumoffloading']);
206
		}
207

    
208
		if($_POST['disablescrub'] == "yes") {
209
			$config['system']['disablescrub'] = $_POST['disablescrub'];
210
		} else {
211
			unset($config['system']['disablescrub']);
212
		}
213

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

    
220
		// Traffic shaper
221
		$config['system']['shapertype'] = $_POST['shapertype'];
222
		
223
		$config['ipsec']['preferoldsa'] = $_POST['preferoldsa_enable'] ? true : false;
224
		$config['bridge']['filteringbridge'] = $_POST['filteringbridge_enable'] ? true : false;
225
		$config['filter']['bypassstaticroutes'] = $_POST['bypassstaticroutes'] ? true : false;
226

    
227
		write_config();
228

    
229
		$retval = 0;
230
		config_lock();
231
		$retval = filter_configure();
232
		if(stristr($retval, "error") <> true)
233
		    $savemsg = get_std_save_message($retval);
234
		else
235
		    $savemsg = $retval;
236

    
237
		config_unlock();
238

    
239
		setup_filter_bridge();
240
		
241
		conf_mount_rw();
242

    
243
		setup_serial_port();
244

    
245
		setup_filter_bridge();
246

    
247
		conf_mount_ro();		
248
		
249

    
250
	}
251
}
252

    
253
$pgtitle = "System: Advanced functions";
254
include("head.inc");
255

    
256
?>
257

    
258
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
259

    
260
<?php include("fbegin.inc"); ?>
261
<p class="pgtitle"><?=$pgtitle?></p>
262
<form action="system_advanced.php" method="post" name="iform" id="iform">
263
<?php if ($input_errors) print_input_errors($input_errors); ?>
264
<?php if ($savemsg) print_info_box($savemsg); ?>
265
<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>
266
<br />
267

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

    
409
                <tr>
410
                  <td width="22%" valign="top" class="vncell">Device polling</td>
411
                  <td width="78%" class="vtable">
412
                    <input name="polling_enable" type="checkbox" id="polling_enable" value="yes" <?php if ($pconfig['polling_enable']) echo "checked"; ?>>
413
                    <strong>Use device polling</strong><br>
414
                                        Device polling is a technique that lets the system periodically poll network devices for new
415
                                        data instead of relying on interrupts. This can reduce CPU load and therefore increase
416
                                        throughput, at the expense of a slightly higher forwarding delay (the devices are polled 1000 times
417
                                        per second). Not all NICs support polling; see the pfSense homepage for a list of supported cards.
418
                  </td>
419
                </tr>
420

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

    
620
<script language="JavaScript" type="text/javascript">
621
<!--
622
	enable_change(false);
623
//-->
624
</script>
625

    
626
<?php include("fend.inc"); ?>
627

    
628
</body>
629
</html>
630

    
631
<?php
632

    
633
if (($config['system']['webgui']['certificate'] != $oldcert)
634
		|| ($config['system']['webgui']['private-key'] != $oldkey)) {
635
    ob_flush();
636
    flush();
637
    log_error("webConfigurator certificates have changed.  Restarting webConfigurator.");
638
    sleep(1);
639
	touch("/tmp/restart_webgui");
640
}
641

    
642
?>
(136-136/175)