Project

General

Profile

Download (24.2 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
	system_advanced.php
5
        part of pfSense
6
        Copyright (C) 2005 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['ipv6nat_enable'] = isset($config['diag']['ipv6nat']['enable']);
39
$pconfig['ipv6nat_ipaddr'] = $config['diag']['ipv6nat']['ipaddr'];
40
$pconfig['cert'] = base64_decode($config['system']['webgui']['certificate']);
41
$pconfig['key'] = base64_decode($config['system']['webgui']['private-key']);
42
$pconfig['disableconsolemenu'] = isset($config['system']['disableconsolemenu']);
43
$pconfig['harddiskstandby'] = $config['system']['harddiskstandby'];
44
$pconfig['noantilockout'] = isset($config['system']['webgui']['noantilockout']);
45
$pconfig['filteringbridge_enable'] = isset($config['bridge']['filteringbridge']);
46
$pconfig['tcpidletimeout'] = $config['filter']['tcpidletimeout'];
47
$pconfig['maximumstates'] = $config['system']['maximumstates'];
48
$pconfig['theme'] = $config['system']['theme'];
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

    
58
$pconfig['disablenatreflection'] = $config['system']['disablenatreflection'];
59

    
60
if ($_POST) {
61

    
62
	unset($input_errors);
63
	$pconfig = $_POST;
64

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

    
101
	if (!$input_errors) {
102
		if($_POST['disablefilter'] == "yes") {
103
			$config['system']['disablefilter'] = "enabled";
104
		} else {
105
			unset($config['system']['disablefilter']);
106
		}
107
		if($_POST['enablesshd'] == "yes") {
108
			$config['system']['enablesshd'] = "enabled";
109
			touch("{$g['tmp_path']}/start_sshd");
110
		} else {
111
			unset($config['system']['enablesshd']);
112
			mwexec("/usr/bin/killall sshd");
113
		}		
114
		$oldsshport = $config['system']['ssh']['port'];
115
		$config['system']['ssh']['port'] = $_POST['sshport'];
116

    
117
		if($_POST['polling_enable'] == "yes") { 
118
			$config['system']['polling'] = true;
119
			setup_polling();
120
		} else {
121
			unset($config['system']['polling']);
122
			setup_polling();
123
		}
124

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

    
133
		if($_POST['rfc959workaround'] == "yes")
134
			$config['system']['rfc959workaround'] = "enabled";
135
		else
136
			unset($config['system']['rfc959workaround']);
137

    
138
		if($_POST['ipv6nat_enable'] == "yes") {
139
			$config['diag']['ipv6nat']['enable'] = true;
140
			$config['diag']['ipv6nat']['ipaddr'] = $_POST['ipv6nat_ipaddr'];
141
		} else {
142
			unset($config['diag']['ipv6nat']['enable']);
143
			unset($config['diag']['ipv6nat']['ipaddr']);
144
		}
145
		$oldcert = $config['system']['webgui']['certificate'];
146
		$oldkey = $config['system']['webgui']['private-key'];
147
		$config['system']['webgui']['certificate'] = base64_encode($_POST['cert']);
148
		$config['system']['webgui']['private-key'] = base64_encode($_POST['key']);
149
		if($_POST['disableconsolemenu'] == "yes") {
150
			$config['system']['disableconsolemenu'] = true;
151
			auto_login(true);
152
		} else {
153
			unset($config['system']['disableconsolemenu']);
154
			auto_login(false);
155
		}
156
		unset($config['system']['webgui']['expanddiags']);
157
		$config['system']['optimization'] = $_POST['optimization'];
158
		
159
		if($_POST['disablefirmwarecheck'] == "yes")
160
			$config['system']['disablefirmwarecheck'] = true;
161
		else
162
			unset($config['system']['disablefirmwarecheck']);
163

    
164
		if ($_POST['enableserial'] == "yes")
165
			$config['system']['enableserial'] = true;
166
		else
167
			unset($config['system']['enableserial']);
168

    
169
		if($_POST['harddiskstandby'] <> "") {
170
			$config['system']['harddiskstandby'] = $_POST['harddiskstandby'];
171
			system_set_harddisk_standby();
172
		} else
173
			unset($config['system']['harddiskstandby']);
174

    
175
		if ($_POST['noantilockout'] == "yes")
176
			$config['system']['webgui']['noantilockout'] = true;
177
		else
178
			unset($config['system']['webgui']['noantilockout']);
179

    
180
		/* Firewall and ALTQ options */
181
		$config['system']['maximumstates'] = $_POST['maximumstates'];
182

    
183
		if($_POST['enablesshd'] == "yes") {
184
			$config['system']['enablesshd'] = $_POST['enablesshd'];
185
		} else {
186
			unset($config['system']['enablesshd']);
187
		}
188

    
189
		if($_POST['disablenatreflection'] == "yes") {
190
			$config['system']['disablenatreflection'] = $_POST['disablenatreflection'];
191
		} else {
192
			unset($config['system']['disablenatreflection']);
193
		}
194
	
195
                $config['ipsec']['preferoldsa'] = $_POST['preferoldsa_enable'] ? true : false;
196
	
197
		$config['bridge']['filteringbridge'] = $_POST['filteringbridge_enable'] ? true : false;	
198
	
199
		/* pfSense themes */
200
		$config['theme'] = $_POST['theme'];
201

    
202
		write_config();
203
			
204
		$retval = 0;
205
		config_lock();
206
		$retval = filter_configure();
207
		if(stristr($retval, "error") <> true)
208
		    $savemsg = get_std_save_message($retval);
209
		else
210
		    $savemsg = $retval;
211
		$retval |= interfaces_optional_configure();
212
		config_unlock();
213
			
214
		setup_serial_port();
215
		
216
		setup_filter_bridge();
217
		
218
	}
219
}
220

    
221
$pgtitle = "System: Advanced functions";
222
include("head.inc");
223

    
224
?>
225

    
226
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
227

    
228
<?php include("fbegin.inc"); ?>
229

    
230
<p class="pgtitle"><?=$pgtitle?></p>
231

    
232
<form action="system_advanced.php" method="post" name="iform" id="iform">
233
<?php if ($input_errors) print_input_errors($input_errors); ?>
234
<?php if ($savemsg) print_info_box($savemsg); ?>
235
<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>
236
<br />
237

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

    
412
                <tr>
413
                  <td width="22%" valign="top" class="vncell">Device polling</td>
414
                  <td width="78%" class="vtable">
415
                    <input name="polling_enable" type="checkbox" id="polling_enable" value="yes" <?php if ($pconfig['polling_enable']) echo "checked"; ?>>
416
                    <strong>Use device polling</strong><br>
417
                                        Device polling is a technique that lets the system periodically poll network devices for new
418
                                        data instead of relying on interrupts. This can reduce CPU load and therefore increase
419
                                        throughput, at the expense of a slightly higher forwarding delay (the devices are polled 1000 times
420
                                        per second). Not all NICs support polling; see the pfSense homepage for a list of supported cards.
421
                  </td>
422
                </tr>
423
		
424
		<tr>
425
			<td width="22%" valign="top" class="vncell">Console menu </td>
426
			<td width="78%" class="vtable">
427
				<input name="disableconsolemenu" type="checkbox" id="disableconsolemenu" value="yes" <?php if ($pconfig['disableconsolemenu']) echo "checked"; ?>  />
428
				<strong>Disable console menu</strong>
429
				<br />
430
				<span class="vexpl">Changes to this option will take effect after a reboot.</span>
431
			</td>
432
		</tr>
433
		<tr>
434
			<td valign="top" class="vncell">Firmware version check</td>
435
			<td class="vtable">
436
				<input name="disablefirmwarecheck" type="checkbox" id="disablefirmwarecheck" value="yes" <?php if ($pconfig['disablefirmwarecheck']) echo "checked"; ?>  />
437
				<strong>Disable firmware version check</strong>
438
				<br />
439
				<span class="vexpl">This will cause pfSense not to check for newer firmware versions when the <a href="system_firmware.php">System: Firmware</a> page is viewed.</span>
440
			</td>
441
		</tr>
442
<?php if($g['platform'] == "pfSense"): ?>		
443
		<tr>
444
			<td width="22%" valign="top" class="vncell">Hard disk standby time </td>
445
			<td width="78%" class="vtable">
446
				<select name="harddiskstandby" class="formfld">
447
<?php
448
				 	## Values from ATA-2 http://www.t13.org/project/d0948r3-ATA-2.pdf (Page 66)
449
					$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");
450
?>
451
					<option value="" <?php if(!$pconfig['harddiskstandby']) echo('selected');?>>Always on</option>
452
<?php
453
					foreach ($sbvals as $sbval):
454
						list($min,$val) = explode(",", $sbval); ?>
455
					<option value="<?=$val;?>" <?php if($pconfig['harddiskstandby'] == $val) echo('selected');?>><?=$min;?> minutes</option>
456
<?php 				endforeach; ?>
457
				</select>
458
				<br />
459
				Puts the hard disk into standby mode when the selected amount of time after the last
460
				access has elapsed. <em>Do not set this for CF cards.</em>
461
			</td>
462
		</tr>
463
<?php endif; ?>		
464
		<tr>
465
			<td width="22%" valign="top" class="vncell">webGUI anti-lockout</td>
466
			<td width="78%" class="vtable">
467
				<input name="noantilockout" type="checkbox" id="noantilockout" value="yes" <?php if ($pconfig['noantilockout']) echo "checked"; ?> />
468
				<strong>Disable webGUI anti-lockout rule</strong>
469
				<br />
470
				By default, access to the webGUI on the LAN interface is always permitted, regardless of the user-defined filter 
471
				rule set. Enable this feature to control webGUI access (make sure to have a filter rule in place that allows you 
472
				in, or you will lock yourself out!).
473
				<br />
474
				Hint: the &quot;set LAN IP address&quot; option in the console menu  resets this setting as well.
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
		<tr>
499
			<td width="22%" valign="top" class="vncell">FTP RFC 959 data port violation workaround</td>
500
			<td width="78%" class="vtable">
501
				<input name="rfc959workaround" type="checkbox" id="rfc959workaround" value="yes" <?php if (isset($config['system']['rfc959workaround'])) echo "checked"; ?> onclick="enable_change(false)" />
502
				<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>
503
				<br />
504
			</td>
505
		</tr>
506
		<tr>
507
			<td width="22%" valign="top" class="vncell">Firewall Optimization Options</td>
508
			<td width="78%" class="vtable">
509
				<select onChange="update_description(this.selectedIndex);" name="optimization" id="optimization">
510
					<option value="normal"<?php if($config['system']['optimization']=="normal") echo " selected"; ?>>normal</option>
511
					<option value="high-latency"<?php if($config['system']['optimization']=="high-latency") echo " selected"; ?>>high-latency</option>
512
					<option value="aggressive"<?php if($config['system']['optimization']=="aggressive") echo " selected"; ?>>aggressive</option>
513
					<option value="conservative"<?php if($config['system']['optimization']=="conservative") echo " selected"; ?>>conservative</option>
514
				</select>
515
				<br />
516
				<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>
517
				<script language="javascript" type="text/javascript">
518
					update_description(document.forms[0].optimization.selectedIndex);
519
				</script>
520
				<br />
521
				<span class="vexpl"><b>Select which type of state table optimization your would like to use</b></span>
522
			</td>
523
		</tr>
524
		<tr>
525
			<td width="22%" valign="top" class="vncell">Disable Firewall</td>
526
			<td width="78%" class="vtable">
527
				<input name="disablefilter" type="checkbox" id="disablefilter" value="yes" <?php if (isset($config['system']['disablefilter'])) echo "checked"; ?> onclick="enable_change(false)" />
528
				<strong>Disable the firewalls filter altogether.</strong>
529
				<br />
530
				<span class="vexpl">Note:  This basically converts pfSense into a routing only platform!<br>
531
				                    Note:  This will turn off NAT!
532
				</span>
533
			</td>
534
		</tr>
535
		<tr>
536
			<td width="22%" valign="top" class="vncell">Firewall Maximum States</td>
537
			<td width="78%" class="vtable">
538
				<input name="maximumstates" type="text" id="maximumstates" value="<?php echo $pconfig['maximumstates']; ?>" onclick="enable_change(false)" />
539
				<br />
540
				<strong>Maximum number of connections to hold in the firewall state table.</strong>
541
				<br />
542
				<span class="vexpl">Note:  Leave this blank for the default of 10000</span>
543
			</td>
544
		</tr>
545
		<tr>
546
			<td width="22%" valign="top">&nbsp;</td>
547
			<td width="78%"><input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /></td>
548
		</tr>
549
		<tr>
550
			<td colspan="2" class="list" height="12">&nbsp;</td>
551
		</tr>		
552
		<tr>
553
			<td colspan="2" valign="top" class="listtopic">Network Address Translation</td>
554
		</tr>
555
		<tr>
556
			<td width="22%" valign="top" class="vncell">Disable NAT Reflection</td>
557
			<td width="78%" class="vtable">
558
				<input name="disablenatreflection" type="checkbox" id="disablenatreflection" value="yes" <?php if (isset($config['system']['disablenatreflection'])) echo "checked"; ?> onclick="enable_change(false)" />
559
				<strong>Disables the automatic creation of NAT redirect rules for access to your public IP addresses from within your internal networks</strong>
560
			</td>
561
		</tr>
562
		<tr>
563
			<td width="22%" valign="top">&nbsp;</td>
564
			<td width="78%"><input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /></td>
565
		</tr>
566
		<tr>
567
			<td colspan="2" class="list" height="12">&nbsp;</td>
568
		</tr>
569
	</tbody>
570
</table>
571
</form>
572

    
573
<script language="JavaScript" type="text/javascript">
574
<!--
575
	enable_change(false);
576
	//enable_altfirmwareurl(false);
577
	//enable_altpkgconfigurl(false);
578
//-->
579
</script>
580

    
581
<?php include("fend.inc"); ?>
582

    
583
<?php
584

    
585
if (($config['system']['webgui']['certificate'] != $oldcert)
586
		|| ($config['system']['webgui']['private-key'] != $oldkey)) {
587
	touch("/tmp/restart_webgui");
588
}
589

    
590
?>
591
</body>
592
</html>
(123-123/159)