Project

General

Profile

Download (26.5 KB) Statistics
| Branch: | Tag: | Revision:
1
#!/usr/local/bin/php
2
<?php
3
/* $Id$ */
4
/*
5
	system_advanced.php
6
        part of pfSense
7
        Copyright (C) 2005 Scott Ullrich
8

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

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

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

    
19
	2. Redistributions in binary form must reproduce the above copyright
20
	   notice, this list of conditions and the following disclaimer in the
21
	   documentation and/or other materials provided with the distribution.
22

    
23
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
24
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
25
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
27
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
	POSSIBILITY OF SUCH DAMAGE.
33
*/
34

    
35
require("guiconfig.inc");
36

    
37
$pconfig['disablefilter'] = $config['system']['disablefilter'];
38
$pconfig['disableftpproxy'] = $config['system']['disableftpproxy'];
39
$pconfig['rfc959workaround'] = $config['system']['rfc959workaround'];
40
$pconfig['ipv6nat_enable'] = isset($config['diag']['ipv6nat']['enable']);
41
$pconfig['ipv6nat_ipaddr'] = $config['diag']['ipv6nat']['ipaddr'];
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['tcpidletimeout'] = $config['filter']['tcpidletimeout'];
48
$pconfig['schedulertype'] = $config['system']['schedulertype'];
49
$pconfig['maximumstates'] = $config['system']['maximumstates'];
50
$pconfig['theme'] = $config['system']['theme'];
51
$pconfig['disablerendevouz'] = $config['system']['disablerendevouz'];
52
$pconfig['enableserial'] = $config['system']['enableserial'];
53
$pconfig['disablefirmwarecheck'] = isset($config['system']['disablefirmwarecheck']);
54
$pconfig['preferoldsa_enable'] = isset($config['ipsec']['preferoldsa']);
55
$pconfig['enablesshd'] = $config['system']['enablesshd'];
56
$pconfig['sharednet'] = $config['system']['sharednet'];
57

    
58
if ($_POST) {
59

    
60
	unset($input_errors);
61
	$pconfig = $_POST;
62

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

    
106
		if($_POST['sharednet'] == "yes") {
107
			$config['system']['sharednet'] = true;
108
			system_disable_arp_wrong_if();
109
		} else {
110
			unset($config['system']['sharednet']);
111
			system_enable_arp_wrong_if();
112
		}		
113

    
114
		if($_POST['disableftpproxy'] == "yes") {
115
			$config['system']['disableftpproxy'] = "enabled";
116
			unset($config['system']['rfc959workaround']);
117
			system_start_ftp_helpers();
118
		} else {
119
			unset($config['system']['disableftpproxy']);
120
			system_start_ftp_helpers();
121
		}
122
		if($_POST['rfc959workaround'] == "yes")
123
			$config['system']['rfc959workaround'] = "enabled";
124
		else
125
			unset($config['system']['rfc959workaround']);
126

    
127
		if($_POST['ipv6nat_enable'] == "yes") {
128
			$config['diag']['ipv6nat']['enable'] = true;
129
			$config['diag']['ipv6nat']['ipaddr'] = $_POST['ipv6nat_ipaddr'];
130
		} else {
131
			unset($config['diag']['ipv6nat']['enable']);
132
			unset($config['diag']['ipv6nat']['ipaddr']);
133
		}
134
		$oldcert = $config['system']['webgui']['certificate'];
135
		$oldkey = $config['system']['webgui']['private-key'];
136
		$config['system']['webgui']['certificate'] = base64_encode($_POST['cert']);
137
		$config['system']['webgui']['private-key'] = base64_encode($_POST['key']);
138
		if($_POST['disableconsolemenu'] == "yes")
139
			$config['system']['disableconsolemenu'] = true;
140
		else
141
			unset($config['system']['disableconsolemenu']);
142
		unset($config['system']['webgui']['expanddiags']);
143
		$config['system']['optimization'] = $_POST['optimization'];
144
		
145
		if($_POST['disablefirmwarecheck'] == "yes")
146
			$config['system']['disablefirmwarecheck'] = true;
147
		else
148
			unset($config['system']['disablefirmwarecheck']);
149

    
150
		if ($_POST['enableserial'] == "yes")
151
			$config['system']['enableserial'] = true;
152
		else
153
			unset($config['system']['enableserial']);
154

    
155
		if($_POST['harddiskstandby'] <> "") {
156
			$config['system']['harddiskstandby'] = $_POST['harddiskstandby'];
157
			system_set_harddisk_standby();
158
		} else
159
			unset($config['system']['harddiskstandby']);
160

    
161
		if ($_POST['noantilockout'] == "yes")
162
			$config['system']['webgui']['noantilockout'] = true;
163
		else
164
			unset($config['system']['webgui']['noantilockout']);
165

    
166
		/* Firewall and ALTQ options */
167
		$config['system']['schedulertype'] = $_POST['schedulertype'];
168
		$config['system']['maximumstates'] = $_POST['maximumstates'];
169

    
170
		if($_POST['enablesshd'] == "yes") {
171
			$config['system']['enablesshd'] = $_POST['enablesshd'];
172
		} else {
173
			unset($config['system']['enablesshd']);
174
		}
175

    
176
                $config['ipsec']['preferoldsa'] = $_POST['preferoldsa_enable'] ? true : false;
177
	
178
		/* pfSense themes */
179
		$config['theme'] = $_POST['theme'];
180

    
181
		write_config();
182

    
183
		if (($config['system']['webgui']['certificate'] != $oldcert)
184
				|| ($config['system']['webgui']['private-key'] != $oldkey)) {
185
			system_webgui_start();
186
		}
187

    
188
			
189
		$retval = 0;
190
		config_lock();
191
		$retval = filter_configure();
192
		if(stristr($retval, "error") <> true)
193
		    $savemsg = get_std_save_message($retval);
194
		else
195
		    $savemsg = $retval;
196
		$retval |= interfaces_optional_configure();
197
		config_unlock();
198
		
199
		$etc_ttys  = return_filename_as_array("/etc/ttys");
200
		$boot_loader_rc = return_filename_as_array("/boot/loader.rc");
201
		
202
		conf_mount_rw();
203
		
204
		$fout = fopen("/etc/ttys","w");
205
		if(!$fout) {
206
			echo "Cannot open /etc/ttys for writing.  Floppy inserted?\n";	
207
		} else {		
208
			foreach($etc_ttys as $tty) {
209
				if(stristr($tty,"ttyv0") <> true) {
210
					fwrite($fout, $tty . "\n");				
211
				}
212
			}
213
			if(isset($pconfig['enableserial']))
214
				fwrite($fout, "ttyv0\t\"/usr/libexec/getty Pc\"\tcons25\t\ton\tsecure\n");
215
			fclose($fout);		
216
		}
217
		
218
		$fout = fopen("/boot/loader.rc","w");
219
		if(!is_array($boot_loader_rc))
220
			$boot_loader_rc = array();
221
		foreach($boot_loader_rc as $blrc) {
222
			if(stristr($blrc,"comconsole") <> true) {
223
				fwrite($fout, $blrc . "\n");				
224
			}
225
		}
226
		if(isset($pconfig['enableserial']))
227
			fwrite($fout, "set console=comconsole\n");
228
		fclose($fout);
229
		
230
		mwexec("/etc/sshd");
231
		
232
		conf_mount_ro();
233
	}
234
}
235

    
236
$pgtitle = "System: Advanced functions";
237
include("head.inc");
238

    
239
?>
240

    
241
<script language="JavaScript">
242
<!--
243
function enable_change(enable_over) {
244
	if (document.iform.ipv6nat_enable.checked || enable_over) {
245
		document.iform.ipv6nat_ipaddr.disabled = 0;
246
		document.iform.schedulertype.disabled = 0;
247
	} else {
248
		document.iform.ipv6nat_ipaddr.disabled = 1;
249
	}
250
}
251

    
252
var descs=new Array(5);
253
descs[0]="as the name says, it's the normal optimization algorithm";
254
descs[1]="used for high latency links, such as satellite links.  Expires idle connections later than default";
255
descs[2]="expires idle connections quicker. More efficient use of CPU and memory but can drop legitimate connections";
256
descs[3]="tries to avoid dropping any legitimate connections at the expense of increased memory usage and CPU utilization.";
257

    
258
function update_description(itemnum) {
259
        document.forms[0].info.value=descs[itemnum];
260

    
261
}
262

    
263
function openwindow(url) {
264
        var oWin = window.open(url,"pfSensePop","width=620,height=400,top=150,left=150");
265
        if (oWin==null || typeof(oWin)=="undefined") {
266
                return false;
267
        } else {
268
                return true;
269
        }
270
}
271

    
272
// -->
273
</script>
274
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
275
<?php include("fbegin.inc"); ?>
276
<p class="pgtitle"><?=$pgtitle?></p>
277
<form action="system_advanced.php" method="post" name="iform" id="iform">
278
            <?php if ($input_errors) print_input_errors($input_errors); ?>
279
            <?php if ($savemsg) print_info_box($savemsg); ?>
280
            <p><span class="vexpl"><span class="red"><strong>Note: </strong></span>
281
	    the options on this page are intended for use by advanced users only.</span></p><br>
282

    
283
              <table width="100%" border="0" cellpadding="6" cellspacing="0">
284

    
285
		<?php if($g['platform'] == "pfSense" || $g['platform'] == "cdrom"): ?>
286
                <tr>
287
                  <td colspan="2" valign="top" class="listtopic">Enable Serial Console</td>
288
                </tr>
289
                <tr>
290
                  <td width="22%" valign="top" class="vncell">&nbsp;</td>
291
                  <td width="78%" class="vtable">
292
                    <input name="enableserial" type="checkbox" id="enableserial" value="yes" <?php if (isset($pconfig['enableserial'])) echo "checked"; ?> onclick="enable_change(false)">
293
                    <strong>This will enable the first serial port with 9600/8/N/1</strong>
294
                    </td>
295
                </tr>
296
                <tr>
297
                  <td width="22%" valign="top">&nbsp;</td>
298
                  <td width="78%">
299
                    <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
300
                  </td>
301
                </tr>
302
                </tr>
303
                <tr>
304
                  <td colspan="2" class="list" height="12"></td>
305
                </tr>		
306
		<?php endif ?>
307

    
308
                <tr>
309
                  <td colspan="2" valign="top" class="listtopic">Secure Shell</td>
310
                </tr>
311
                <tr>
312
                  <td width="22%" valign="top" class="vncell">&nbsp;</td>
313
                  <td width="78%" class="vtable">
314
                    <input name="enablesshd" type="checkbox" id="enablesshd" value="yes" <?php if (isset($pconfig['enablesshd'])) echo "checked"; ?> onclick="enable_change(false)">
315
                    <strong>Enable Secure Shell</strong>
316
                    </td>
317
                </tr>
318
                <tr>
319
                  <td width="22%" valign="top">&nbsp;</td>
320
                  <td width="78%">
321
                    <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
322
                  </td>
323
                </tr>
324
                </tr>
325
                <tr>
326
                  <td colspan="2" class="list" height="12"></td>
327
                </tr>	
328

    
329
                <tr>
330
                  <td colspan="2" valign="top" class="listtopic">Shared Physical Network</td>
331
                </tr>
332
                <tr>
333
                  <td width="22%" valign="top" class="vncell">&nbsp;</td>
334
                  <td width="78%" class="vtable">
335
                    <input name="sharednet" type="checkbox" id="sharednet" value="yes" <?php if (isset($pconfig['sharednet'])) echo "checked"; ?> onclick="enable_change(false)">
336
                    <strong>This will supress ARP messages when interfaces share the same physical network</strong>
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
                <tr>
347
                  <td colspan="2" class="list" height="12"></td>
348
                </tr>	
349

    
350
                <tr>
351
                  <td colspan="2" valign="top" class="listtopic">Theme</td>
352
                </tr>
353
                <tr>
354
                  <td width="22%" valign="top" class="vncell">&nbsp;</td>
355
                  <td width="78%" class="vtable">
356
		    <select name="theme">
357
<?php
358
			$files = return_dir_as_array("/usr/local/www/themes/");
359
			foreach($files as $f) {
360
				if ( (substr($f, 0, 1) == "_") && !isset($config['system']['developer']) ) continue;
361
				if($f == "CVS") continue;
362
				$selected = "";
363
				if($f == $config['theme'])
364
					$selected = " SELECTED";
365
				if($config['theme'] == "" and $f == "pfsense")
366
					$selceted = " SELECTED";
367
				echo "<option{$selected}>{$f}</option>\n";
368
			}
369
?>
370
		    </select>
371
                    <strong>This will change the look and feel of pfSense</strong>
372
                    </td>
373
                </tr>
374

    
375

    
376

    
377
                <tr>
378
                  <td width="22%" valign="top">&nbsp;</td>
379
                  <td width="78%">
380
                    <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
381
                  </td>
382
                </tr>
383
                <tr>
384
                  <td colspan="2" class="list" height="12"></td>
385
                </tr>
386

    
387
                <tr>
388
                  <td colspan="2" valign="top" class="listtopic">IPv6 tunneling</td>
389
                </tr>
390
                <tr>
391
                  <td width="22%" valign="top" class="vncell">&nbsp;</td>
392
                  <td width="78%" class="vtable">
393
                    <input name="ipv6nat_enable" type="checkbox" id="ipv6nat_enable" value="yes" <?php if ($pconfig['ipv6nat_enable']) echo "checked"; ?> onclick="enable_change(false)">
394
                    <strong>NAT encapsulated IPv6 packets (IP protocol 41/RFC2893)
395
                    to:</strong><br> <br> <input name="ipv6nat_ipaddr" type="text" class="formfld" id="ipv6nat_ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipv6nat_ipaddr']);?>">
396
                    &nbsp;(IP address)<span class="vexpl"><br>
397
                    Don't forget to add a firewall rule to permit IPv6 packets!</span></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"></td>
407
                </tr>
408
                <tr>
409
                  <td colspan="2" valign="top" class="listtopic">webGUI SSL certificate/key</td>
410
                </tr>
411
                <tr>
412
                  <td width="22%" valign="top" class="vncell">Certificate</td>
413
                  <td width="78%" class="vtable">
414
                    <textarea name="cert" cols="65" rows="7" id="cert" class="formpre"><?=htmlspecialchars($pconfig['cert']);?></textarea>
415
                    <br>
416
                    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.</td>
417
                </tr>
418
                <tr>
419
                  <td width="22%" valign="top" class="vncell">Key</td>
420
                  <td width="78%" class="vtable">
421
                    <textarea name="key" cols="65" rows="7" id="key" class="formpre"><?=htmlspecialchars($pconfig['key']);?></textarea>
422
                    <br>
423
                    Paste an RSA private key in PEM format here.</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"></td>
433
                </tr>
434
                <tr>
435
                  <td colspan="2" valign="top" class="listtopic">Miscellaneous</td>
436
                </tr>
437
				<tr>
438
                  <td width="22%" valign="top" class="vncell">Console menu </td>
439
                  <td width="78%" class="vtable">
440
                    <input name="disableconsolemenu" type="checkbox" id="disableconsolemenu" value="yes" <?php if ($pconfig['disableconsolemenu']) echo "checked"; ?>>
441
                    <strong>Disable console menu</strong><span class="vexpl"><br>
442
                    Changes to this option will take effect after a reboot.</span></td>
443
                </tr>
444
		<tr>
445
                  <td valign="top" class="vncell">Firmware version check </td>
446
                  <td class="vtable">
447
                    <input name="disablefirmwarecheck" type="checkbox" id="disablefirmwarecheck" value="yes" <?php if ($pconfig['disablefirmwarecheck']) echo "checked"; ?>>
448
                    <strong>Disable firmware version check</strong><span class="vexpl"><br>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></td>
449
		</tr>		
450
		<tr>
451
                  <td width="22%" valign="top" class="vncell">Hard disk standby time </td>
452
                  <td width="78%" class="vtable">
453
                    <select name="harddiskstandby" class="formfld">
454
					<?php
455
                        /* Values from ATA-2
456
                           http://www.t13.org/project/d0948r3-ATA-2.pdf
457
                           Page 66 */
458
						$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");
459
					?>
460
                      <option value="" <?php if(!$pconfig['harddiskstandby']) echo('selected');?>>Always on</option>
461
					<?php
462
					foreach ($sbvals as $sbval):
463
						list($min,$val) = explode(",", $sbval); ?>
464
                      <option value="<?=$val;?>" <?php if($pconfig['harddiskstandby'] == $val) echo('selected');?>><?=$min;?> minutes</option>
465
					<?php endforeach; ?>
466
                    </select>
467
                    <br>
468
                    Puts the hard disk into standby mode when the selected amount of time after the last
469
                    access has elapsed. <em>Do not set this for CF cards.</em></td>
470
				</tr>
471
		<tr>
472
                  <td width="22%" valign="top" class="vncell">webGUI anti-lockout</td>
473
                  <td width="78%" class="vtable">
474
                    <input name="noantilockout" type="checkbox" id="noantilockout" value="yes" <?php if ($pconfig['noantilockout']) echo "checked"; ?>>
475
                    <strong>Disable webGUI anti-lockout rule</strong><br>
476
					By default, access to the webGUI on the LAN interface is always permitted, regardless of the user-defined filter rule set. Enable this feature to control webGUI access (make sure to have a filter rule in place that allows you in, or you will lock yourself out!).<br>
477
					Hint:
478
					the &quot;set LAN IP address&quot; option in the console menu  resets this setting as well.</td>
479
                </tr>
480
		<tr>
481
                  <td width="22%" valign="top" class="vncell">IPsec SA preferral</td>
482
                  <td width="78%" class="vtable">
483
                    <input name="preferoldsa_enable" type="checkbox" id="preferoldsa_enable" value="yes" <?php if ($pconfig['preferoldsa_enable']) echo "checked"; ?>>
484
                    <strong>Prefer old IPsec SAs</strong><br>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.
485
                  </td>
486
                </tr>		
487
                <tr>
488
                  <td width="22%" valign="top">&nbsp;</td>
489
                  <td width="78%">
490
                    <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
491
                  </td>
492
                </tr>
493
                <tr>
494
                  <td colspan="2" class="list" height="12"></td>
495
                </tr>
496
                <tr>
497
                  <td colspan="2" valign="top" class="listtopic">Traffic Shaper and Firewall Advanced</td>
498
                </tr>
499
                <tr>
500
                  <td width="22%" valign="top" class="vncell">FTP Helper</td>
501
                  <td width="78%" class="vtable">
502
                    <input name="disableftpproxy" type="checkbox" id="disableftpproxy" value="yes" <?php if (isset($config['system']['disableftpproxy'])) echo "checked"; ?> onclick="enable_change(false)">
503
                    <strong class="vexpl">Disable the userland FTP-Proxy application</strong><br>
504
                </tr>
505
                <tr>
506
                  <td width="22%" valign="top" class="vncell">FTP RFC 959 data port violation workaround</td>
507
                  <td width="78%" class="vtable">
508
                    <input name="rfc959workaround" type="checkbox" id="rfc959workaround" value="yes" <?php if (isset($config['system']['rfc959workaround'])) echo "checked"; ?> onclick="enable_change(false)">
509
                    <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><br>
510
                </tr>
511

    
512
		<tr>
513
		  <td width="22%" valign="top" class="vncell">Traffic Shaper Scheduler</td>
514
		  <td width="78%" class="vtable">
515
		    <select id="schedulertype" name="schedulertype" <?= $style ?>>
516
			    <option value="priq"<?php if($pconfig['schedulertype'] == 'priq') echo " SELECTED"; ?>>Priority based queueing</option>
517
			    <option value="cbq"<?php if($pconfig['schedulertype'] == 'cbq') echo " SELECTED"; ?>>Class based queueing</option>
518
			    <option value="hfsc"<?php if($pconfig['schedulertype'] == 'hfsc') echo " SELECTED"; ?>>Hierarchical Fair Service Curve queueing</option>
519
		    </select>
520
		    <br> <span class="vexpl"><b>Select which type of queueing you would like to use</b>
521
		  <?php if (is_array($config['shaper']['queue']) > 0): ?>
522
			<script language="javascript">
523
			document.iform.schedulertype.disabled = 1;
524
			</script>
525
			<br>
526
			NOTE: This option is disabled since there are queues defined.
527
		  <?php endif; ?>
528
		    </span></td>
529
		</tr>
530

    
531
		<tr>
532
                  <td width="22%" valign="top" class="vncell">Firewall Optimization Options</td>
533
                  <td width="78%" class="vtable">
534
			<select onChange="update_description(this.selectedIndex);" name="optimization" id="optimization">
535
			<br>
536
			<option value="normal"<?php if($config['system']['optimization']=="normal") echo " SELECTED"; ?>>normal</option>
537
			<option value="high-latency"<?php if($config['system']['optimization']=="high-latency") echo " SELECTED"; ?>>high-latency</option>
538
			<option value="aggressive"<?php if($config['system']['optimization']=="aggressive") echo " SELECTED"; ?>>aggressive</option>
539
			<option value="conservative"<?php if($config['system']['optimization']=="conservative") echo " SELECTED"; ?>>conservative</option>
540
			</select><br>
541
			<textarea cols="60" rows="2" id="info" name="info"style="border:1px dashed #000066; background-color: #ffffff; color: #000000; font-size: 8pt;">
542
			</textarea>
543
			<script language="javascript">
544
			update_description(document.forms[0].optimization.selectedIndex);
545
			</script>
546
			<br><span class="vexpl"><b>Select which type of state table optimization your would like to use</b></td>
547
                </tr>
548

    
549
                <tr>
550
                  <td width="22%" valign="top" class="vncell">Disable Firewall</td>
551
                  <td width="78%" class="vtable">
552
                    <input name="disablefilter" type="checkbox" id="disablefilter" value="yes" <?php if (isset($config['system']['disablefilter'])) echo "checked"; ?> onclick="enable_change(false)">
553
                    <strong>Disable the firewalls filter altogether.</strong><br>
554
                    <span class="vexpl">Note:  This basically converts pfSense into a routing only platform!</span></td>
555
                </tr>
556

    
557
                <tr>
558
                  <td width="22%" valign="top" class="vncell">Firewall Maximum States</td>
559
                  <td width="78%" class="vtable">
560
                    <input name="maximumstates" type="input" id="maximumstates" value="<?php echo $pconfig['maximumstates']; ?>" onclick="enable_change(false)"><br>
561
                    <strong>Maximum number of connections to hold in the firewall state table.</strong><br>
562
                    <span class="vexpl">Note:  Leave this blank for the default of 10000</span></td>
563
                </tr>
564

    
565
                <tr>
566
                  <td width="22%" valign="top">&nbsp;</td>
567
                  <td width="78%">
568
                    <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
569
                  </td>
570
                </tr>
571
                <tr>
572
                  <td colspan="2" class="list" height="12"></td>
573
                </tr>
574

    
575

    
576

    
577

    
578

    
579

    
580
              </table>
581
</form>
582
            <script language="JavaScript">
583
<!--
584
enable_change(false);
585
//enable_altfirmwareurl(false);
586
//enable_altpkgconfigurl(false);
587
//-->
588
</script>
589
<?php include("fend.inc"); ?>
590
</body>
591
</html>
(115-115/144)