Project

General

Profile

Download (27 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['filteringbridge_enable'] = isset($config['bridge']['filteringbridge']);
41
$pconfig['ipv6nat_enable'] = isset($config['diag']['ipv6nat']['enable']);
42
$pconfig['ipv6nat_ipaddr'] = $config['diag']['ipv6nat']['ipaddr'];
43
$pconfig['cert'] = base64_decode($config['system']['webgui']['certificate']);
44
$pconfig['key'] = base64_decode($config['system']['webgui']['private-key']);
45
$pconfig['disableconsolemenu'] = isset($config['system']['disableconsolemenu']);
46
$pconfig['disablefirmwarecheck'] = isset($config['system']['disablefirmwarecheck']);
47
$pconfig['altfirmwareurl'] = $config['system']['altfirmwareurl']['enabled'];
48
$pconfig['firmware_base_url'] = $config['system']['alt_firmware_url']['firmware_base_url'];
49
$pconfig['firmwarename'] = $config['system']['alt_firmware_url']['firmware_filename'];
50
$pconfig['altpkgconfigurl'] = $config['system']['alt_pkgconfig_url']['enabled'];
51
$pconfig['pkgconfig_base_url'] = $config['system']['alt_pkgconfig_url']['pkgconfig_base_url'];
52
$pconfig['pkgconfig_filename'] = $config['system']['alt_pkgconfig_url']['pkgconfig_filename'];
53
$pconfig['expanddiags'] = isset($config['system']['webgui']['expanddiags']);
54
$pconfig['harddiskstandby'] = $config['system']['harddiskstandby'];
55
$pconfig['noantilockout'] = isset($config['system']['webgui']['noantilockout']);
56
$pconfig['tcpidletimeout'] = $config['filter']['tcpidletimeout'];
57
$pconfig['schedulertype'] = $config['system']['schedulertype'];
58
$pconfig['maximumstates'] = $config['system']['maximumstates'];
59
$pconfig['disablerendevouz'] = $config['system']['disablerendevouz'];
60

    
61
if ($_POST) {
62

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

    
66
	/* input validation */
67
	if ($_POST['ipv6nat_enable'] && !is_ipaddr($_POST['ipv6nat_ipaddr'])) {
68
		$input_errors[] = "You must specify an IP address to NAT IPv6 packets.";
69
	}
70
	if ($_POST['maximumstates'] && !is_numericint($_POST['maximumstates'])) {
71
		$input_errors[] = "The Firewall Maximum States value must be an integer.";
72
	}
73
	if ($_POST['tcpidletimeout'] && !is_numericint($_POST['tcpidletimeout'])) {
74
		$input_errors[] = "The TCP idle timeout must be an integer.";
75
	}
76
	if (($_POST['cert'] && !$_POST['key']) || ($_POST['key'] && !$_POST['cert'])) {
77
		$input_errors[] = "Certificate and key must always be specified together.";
78
	} else if ($_POST['cert'] && $_POST['key']) {
79
		if (!strstr($_POST['cert'], "BEGIN CERTIFICATE") || !strstr($_POST['cert'], "END CERTIFICATE"))
80
			$input_errors[] = "This certificate does not appear to be valid.";
81
		if (!strstr($_POST['key'], "BEGIN RSA PRIVATE KEY") || !strstr($_POST['key'], "END RSA PRIVATE KEY"))
82
			$input_errors[] = "This key does not appear to be valid.";
83
	if ($_POST['altfirmwareurl'])
84
		if ($_POST['firmwareurl'] == "" || $_POST['firmwarename'] == "")
85
		$input_errors[] = "You must specify a base URL and a filename for the alternate firmware.";
86

    
87
	if ($_POST['altpkgconfigurl'])
88
		if ($_POST['pkgconfig_base_url'] == "" || $_POST['pkgconfig_filename'] == "")
89
		$input_errors[] = "You must specifiy and base URL and a filename before using an alternate pkg_config.xml.";
90
	}
91

    
92
	if (!$input_errors) {
93
		if($_POST['disablefilter'] == "yes") {
94
			$config['system']['disablefilter'] = "enabled";
95
		} else {
96
			unset($config['system']['disablefilter']);
97
		}
98
		if($_POST['disableftpproxy'] == "yes") {
99
			$config['system']['disableftpproxy'] = "enabled";
100
			unset($config['system']['rfc959workaround']);
101
		} else {
102
			unset($config['system']['disableftpproxy']);
103
		}
104
		if($_POST['rfc959workaround'] == "yes") {
105
			$config['system']['rfc959workaround'] = "enabled";
106
		}
107
		$config['bridge']['filteringbridge'] = $_POST['filteringbridge_enable'] ? true : false;
108
		$config['diag']['ipv6nat']['enable'] = $_POST['ipv6nat_enable'] ? true : false;
109
		$config['diag']['ipv6nat']['ipaddr'] = $_POST['ipv6nat_ipaddr'];
110
		$oldcert = $config['system']['webgui']['certificate'];
111
		$oldkey = $config['system']['webgui']['private-key'];
112
		$config['system']['webgui']['certificate'] = base64_encode($_POST['cert']);
113
		$config['system']['webgui']['private-key'] = base64_encode($_POST['key']);
114
		$config['system']['disableconsolemenu'] = $_POST['disableconsolemenu'] ? true : false;
115
		$config['system']['disablefirmwarecheck'] = $_POST['disablefirmwarecheck'] ? true : false;
116
		$config['system']['altfirmwareurl'] = $_POST['altfirmwareurl'] ? true : false;
117
		if ($_POST['altfirmwareurl']) {
118
			$config['system']['alt_firmware_url'] = array();
119
			$config['system']['alt_firmware_url']['enabled'] = "";
120
			$config['system']['alt_firmware_url']['firmware_base_url'] = $_POST['firmwareurl'];
121
			$config['system']['alt_firmware_url']['firmware_filename'] = $_POST['firmwarename'];
122
		} elseif (isset($config['system']['alt_firmware_url']['firmware_base_url']) || isset($config['system']['alt_firmware_url']['firmware_filename'])) {
123
			unset($config['system']['alt_firmware_url']['enabled']);
124
		} else {
125
			unset($config['system']['alt_firmware_url']);
126
		}
127

    
128
		if ($_POST['altpkgconfigurl']) {
129
			$config['system']['alt_pkgconfig_url'] = array();
130
			$config['system']['alt_pkgconfig_url']['enabled'] = "";
131
			$config['system']['alt_pkgconfig_url']['pkgconfig_base_url'] = $_POST['pkgconfig_base_url'];
132
			$config['system']['alt_pkgconfig_url']['pkgconfig_filename'] = $_POST['pkgconfig_filename'];
133
		} elseif (isset($config['system']['alt_pkgconfig_url']['pkgconfig_base_url']) || isset($config['system']['alt_pkgconfig_url']['pkgconfig_filename'])) {
134
			unset($config['system']['alt_pkgconfig_url']['enabled']);
135
		} else {
136
			unset($config['system']['alt_pkgconfig_url']);
137
		}
138

    
139
		$config['system']['webgui']['expanddiags'] = $_POST['expanddiags'] ? true : false;
140
		$config['system']['optimization'] = $_POST['optimization'];
141
		$config['system']['disablerendevouz'] = $_POST['disablerendevouz'];
142

    
143
		$oldharddiskstandby = $config['system']['harddiskstandby'];
144
		$config['system']['harddiskstandby'] = $_POST['harddiskstandby'];
145
		$config['system']['webgui']['noantilockout'] = $_POST['noantilockout'] ? true : false;
146

    
147
		/* Firewall and ALTQ options */
148
		$config['system']['schedulertype'] = $_POST['schedulertype'];
149
		$config['system']['maximumstates'] = $_POST['maximumstates'];
150

    
151
		write_config();
152

    
153
		if (($config['system']['webgui']['certificate'] != $oldcert)
154
				|| ($config['system']['webgui']['private-key'] != $oldkey)) {
155
//			touch($d_sysrebootreqd_path);
156
			system_webgui_start();
157
		} else if (($g['platform'] == "generic-pc") && ($config['system']['harddiskstandby'] != $oldharddiskstandby)) {
158
			if (!$config['system']['harddiskstandby']) {
159
				// Reboot needed to deactivate standby due to a stupid ATA-protocol
160
				touch($d_sysrebootreqd_path);
161
				unset($config['system']['harddiskstandby']);
162
			} else {
163
				// No need to set the standby-time if a reboot is needed anyway
164
				system_set_harddisk_standby();
165
			}
166
		}
167

    
168
		$retval = 0;
169
		if (!file_exists($d_sysrebootreqd_path)) {
170
			config_lock();
171
			$retval = filter_configure();
172
			if(stristr($retval, "error") <> true)
173
			    $savemsg = get_std_save_message($retval);
174
			else
175
			    $savemsg = $retval;
176
			$retval |= interfaces_optional_configure();
177
			config_unlock();
178
		}
179
	}
180
}
181
?>
182
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
183
<html>
184
<head>
185
<title><?=gentitle("System: Advanced functions");?></title>
186
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
187
<link href="gui.css" rel="stylesheet" type="text/css">
188
<script language="JavaScript">
189
<!--
190
function enable_change(enable_over) {
191
	if (document.iform.ipv6nat_enable.checked || enable_over) {
192
		document.iform.ipv6nat_ipaddr.disabled = 0;
193
		document.iform.schedulertype.disabled = 0;
194
	} else {
195
		document.iform.ipv6nat_ipaddr.disabled = 1;
196
	}
197
}
198
function enable_altfirmwareurl(enable_over) {
199
        if (document.iform.altfirmwareurl.checked || enable_over) {
200
                document.iform.firmwareurl.disabled = 0;
201
                document.iform.firmwarename.disabled = 0;
202
        } else {
203
                document.iform.firmwareurl.disabled = 1;
204
                document.iform.firmwarename.disabled = 1;
205
        }
206
}
207
function enable_altpkgconfigurl(enable_over) {
208
	if (document.iform.altpkgconfigurl.checked || enable_over) {
209
		document.iform.pkgconfig_base_url.disabled = 0;
210
		document.iform.pkgconfig_filename.disabled = 0;
211
	} else {
212
		document.iform.pkgconfig_base_url.disabled = 1;
213
		document.iform.pkgconfig_filename.disabled = 1;
214
	}
215
}
216

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

    
223
function update_description(itemnum) {
224
        document.forms[0].info.value=descs[itemnum];
225

    
226
}
227

    
228
// -->
229
</script>
230
</head>
231

    
232
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
233
<form action="system_advanced.php" method="post" name="iform" id="iform">
234
<?php include("fbegin.inc"); ?>
235
      <p class="pgtitle">System: Advanced functions</p>
236
            <?php if ($input_errors) print_input_errors($input_errors); ?>
237
            <?php if ($savemsg) print_info_box($savemsg); ?>
238
            <p><span class="vexpl"><span class="red"><strong>Note: </strong></span>the
239
              options on this page are intended for use by advanced users only,
240
              and there's <strong>NO</strong> support for them.</span></p><br>
241

    
242
              <table width="100%" border="0" cellpadding="6" cellspacing="0">
243

    
244
                <tr>
245
                  <td colspan="2" valign="top" class="listtopic">Disable Rendezvous</td>
246
                </tr>
247
                <tr>
248
                  <td width="22%" valign="top" class="vncell">&nbsp;</td>
249
                  <td width="78%" class="vtable">
250
                    <input name="disablerendevouz" type="checkbox" id="disablerendevouz" value="yes" <?php if ($pconfig['disablerendevouz']) echo "checked"; ?> onclick="enable_change(false)">
251
                    <strong>Disable the Rendevouz automatic discovery protocol.</strong>
252
                    </td>
253
                </tr>
254
                <tr>
255
                  <td width="22%" valign="top">&nbsp;</td>
256
                  <td width="78%">
257
                    <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
258
                  </td>
259
                </tr>
260
                <tr>
261
                  <td colspan="2" class="list" height="12"></td>
262
                </tr>
263

    
264
                <tr>
265
                  <td colspan="2" valign="top" class="listtopic">IPv6 tunneling</td>
266
                </tr>
267
                <tr>
268
                  <td width="22%" valign="top" class="vncell">&nbsp;</td>
269
                  <td width="78%" class="vtable">
270
                    <input name="ipv6nat_enable" type="checkbox" id="ipv6nat_enable" value="yes" <?php if ($pconfig['ipv6nat_enable']) echo "checked"; ?> onclick="enable_change(false)">
271
                    <strong>NAT encapsulated IPv6 packets (IP protocol 41/RFC2893)
272
                    to:</strong><br> <br> <input name="ipv6nat_ipaddr" type="text" class="formfld" id="ipv6nat_ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipv6nat_ipaddr']);?>">
273
                    &nbsp;(IP address)<span class="vexpl"><br>
274
                    Don't forget to add a firewall rule to permit IPv6 packets!</span></td>
275
                </tr>
276
                <tr>
277
                  <td width="22%" valign="top">&nbsp;</td>
278
                  <td width="78%">
279
                    <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
280
                  </td>
281
                </tr>
282
                <tr>
283
                  <td colspan="2" class="list" height="12"></td>
284
                </tr>
285
		<tr>
286
                  <td colspan="2" valign="top" class="listtopic">Filtering bridge</td>
287
                </tr>
288
                <tr>
289
                  <td width="22%" valign="top" class="vncell">&nbsp;</td>
290
                  <td width="78%" class="vtable">
291
                    <input name="filteringbridge_enable" type="checkbox" id="filteringbridge_enable" value="yes" <?php if ($pconfig['filteringbridge_enable']) echo "checked"; ?>>
292
                    <strong>Enable filtering bridge</strong><span class="vexpl"><br>
293
                    This will cause bridged packets to pass through the packet
294
                    filter in the same way as routed packets do (by default bridged
295
                    packets are always passed). If you enable this option, you'll
296
                    have to add filter rules to selectively permit traffic from
297
                    bridged interfaces.</span></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"></td>
307
                </tr>
308
                <tr>
309
                  <td colspan="2" valign="top" class="listtopic">webGUI SSL certificate/key</td>
310
                </tr>
311
                <tr>
312
                  <td width="22%" valign="top" class="vncell">Certificate</td>
313
                  <td width="78%" class="vtable">
314
                    <textarea name="cert" cols="65" rows="7" id="cert" class="formpre"><?=htmlspecialchars($pconfig['cert']);?></textarea>
315
                    <br>
316
                    Paste a signed certificate in X.509 PEM format here. <A target="_new" HREF='system_advanced_create_certs.php'>Create</a> certificates automatically.</td>
317
                </tr>
318
                <tr>
319
                  <td width="22%" valign="top" class="vncell">Key</td>
320
                  <td width="78%" class="vtable">
321
                    <textarea name="key" cols="65" rows="7" id="key" class="formpre"><?=htmlspecialchars($pconfig['key']);?></textarea>
322
                    <br>
323
                    Paste an RSA private key in PEM format here.</td>
324
                </tr>
325
                <tr>
326
                  <td width="22%" valign="top">&nbsp;</td>
327
                  <td width="78%">
328
                    <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
329
                  </td>
330
                </tr>
331
                <tr>
332
                  <td colspan="2" class="list" height="12"></td>
333
                </tr>
334
                <tr>
335
                  <td colspan="2" valign="top" class="listtopic">Miscellaneous</td>
336
                </tr>
337
				<tr>
338
                  <td width="22%" valign="top" class="vncell">Console menu </td>
339
                  <td width="78%" class="vtable">
340
                    <input name="disableconsolemenu" type="checkbox" id="disableconsolemenu" value="yes" <?php if ($pconfig['disableconsolemenu']) echo "checked"; ?>>
341
                    <strong>Disable console menu</strong><span class="vexpl"><br>
342
                    Changes to this option will take effect after a reboot.</span></td>
343
                </tr>
344
		<tr>
345
                  <td valign="top" class="vncell">Firmware version check </td>
346
                  <td class="vtable">
347
                    <input name="disablefirmwarecheck" type="checkbox" id="disablefirmwarecheck" value="yes" <?php if ($pconfig['disablefirmwarecheck']) echo "checked"; ?>>
348
                    <strong>Disable firmware version check</strong><span class="vexpl"><br>
349
    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>
350
		</tr>
351
		<tr>
352
                  <td valign="top" class="vncell">Alternate firmware URL</td>
353
                  <td class="vtable">
354
                    <input name="altfirmwareurl" type="checkbox" id="altfirmwareurl" value="yes" onClick="enable_altfirmwareurl()" <?php if (isset($pconfig['altfirmwareurl'])) echo "checked"; ?>> Use a different URL for firmware upgrades<br>
355
		    <table>
356
                    <tr><td>Base URL:</td><td><input name="firmwareurl" type="input" id="firmwareurl" size="64" value="<?php if ($pconfig['firmwareurl']) echo $pconfig['firmwareurl']; else echo $g['firmwarebaseurl']; ?>"></td></tr>
357
                    <tr><td>Filename:</td><td><input name="firmwarename" type="input" id="firmwarename" size="32" value="<?php if ($pconfig['firmwarename']) echo $pconfig['firmwarename']; else echo $g['firmwarefilename']; ?>"></td></tr>
358
		    </table>
359
                    <span class="vexpl">
360
    This is where pfSense will check for newer firmware versions when <a href="system_firmware.php">System: Firmware</a> page is viewed.</span></td>
361
		</tr>
362
                <tr>
363
                  <td valign="top" class="vncell">Alternate pkg_config.xml URL</td>
364
                  <td class="vtable">
365
                    <input name="altpkgconfigurl" type="checkbox" id="altpkgconfigurl" value="yes" onClick="enable_altpkgconfigurl()" <?php if (isset($pconfig['altpkgconfigurl'])) echo "checked"; ?>> Retrieve the package list from a different URL<br>
366
                    <table>
367
                    <tr><td>Base URL:</td><td><input name="pkgconfig_base_url" type="input" id="pkgconfig_base_url" size="64" value="<?php if ($pconfig['pkg_config_base_url']) echo $pconfig['pkg_config_base_url']; else echo $g['pkg_config_base_url']; ?>"></td></tr>
368
                    <tr><td>Filename:</td><td><input name="pkgconfig_filename" type="input" id="pkgconfig_filename" size="32" value="<?php if ($pconfig['pkg_config_filename']) echo $pconfig['pkg_config_filename']; else echo $g['pkg_config_filename']; ?>"></td></tr>
369
                    </table>
370
                    <span class="vexpl">
371
    This is where pfSense will fetch its package list from.</span></td>
372
                </tr>
373
		<tr>
374
                  <td width="22%" valign="top" class="vncell">Hard disk standby time </td>
375
                  <td width="78%" class="vtable">
376
                    <select name="harddiskstandby" class="formfld">
377
					<?php
378
                        /* Values from ATA-2
379
                           http://www.t13.org/project/d0948r3-ATA-2.pdf
380
                           Page 66 */
381
						$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");
382
					?>
383
                      <option value="" <?php if(!$pconfig['harddiskstandby']) echo('selected');?>>Always on</option>
384
					<?php
385
					foreach ($sbvals as $sbval):
386
						list($min,$val) = explode(",", $sbval); ?>
387
                      <option value="<?=$val;?>" <?php if($pconfig['harddiskstandby'] == $val) echo('selected');?>><?=$min;?> minutes</option>
388
					<?php endforeach; ?>
389
                    </select>
390
                    <br>
391
                    Puts the hard disk into standby mode when the selected amount of time after the last
392
                    access has elapsed. <em>Do not set this for CF cards.</em></td>
393
				</tr>
394
				<tr>
395
                  <td width="22%" valign="top" class="vncell">Navigation</td>
396
                  <td width="78%" class="vtable">
397
                    <input name="expanddiags" type="checkbox" id="expanddiags" value="yes" <?php if ($pconfig['expanddiags']) echo "checked"; ?>>
398
                    <strong>Keep diagnostics in navigation expanded </strong></td>
399
                </tr>
400
		<tr>
401
                  <td width="22%" valign="top" class="vncell">webGUI anti-lockout</td>
402
                  <td width="78%" class="vtable">
403
                    <input name="noantilockout" type="checkbox" id="noantilockout" value="yes" <?php if ($pconfig['noantilockout']) echo "checked"; ?>>
404
                    <strong>Disable webGUI anti-lockout rule</strong><br>
405
					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>
406
					Hint:
407
					the &quot;set LAN IP address&quot; option in the console menu  resets this setting as well.</td>
408
                </tr>
409
                <tr>
410
                  <td width="22%" valign="top">&nbsp;</td>
411
                  <td width="78%">
412
                    <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
413
                  </td>
414
                </tr>
415
                <tr>
416
                  <td colspan="2" class="list" height="12"></td>
417
                </tr>
418
                <tr>
419
                  <td colspan="2" valign="top" class="listtopic">Traffic Shaper and Firewall Advanced</td>
420
                </tr>
421
                <tr>
422
                  <td width="22%" valign="top" class="vncell">FTP Helper</td>
423
                  <td width="78%" class="vtable">
424
                    <input name="disableftpproxy" type="checkbox" id="disableftpproxy" value="yes" <?php if (isset($config['system']['disableftpproxy'])) echo "checked"; ?> onclick="enable_change(false)">
425
                    <strong class="vexpl">Disable the userland FTP-Proxy application</strong><br>
426
                </tr>
427
                <tr>
428
                  <td width="22%" valign="top" class="vncell">FTP RFC 959 data port violation workaround</td>
429
                  <td width="78%" class="vtable">
430
                    <input name="rfc959workaround" type="checkbox" id="rfc959workaround" value="yes" <?php if (isset($config['system']['rfc959workaround'])) echo "checked"; ?> onclick="enable_change(false)">
431
                    <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>
432
                </tr>
433

    
434
		<tr>
435
		  <td width="22%" valign="top" class="vncell">Traffic Shaper Scheduler</td>
436
		  <td width="78%" class="vtable">
437
		    <select id="schedulertype" name="schedulertype" <?= $style ?>>
438
			    <option value="priq"<?php if($pconfig['schedulertype'] == 'priq') echo " SELECTED"; ?>>Priority based queueing</option>
439
			    <option value="cbq"<?php if($pconfig['schedulertype'] == 'cbq') echo " SELECTED"; ?>>Class based queueing</option>
440
			    <option value="hfsc"<?php if($pconfig['schedulertype'] == 'hfsc') echo " SELECTED"; ?>>Hierarchical Fair Service Curve queueing</option>
441
		    </select>
442
		    <br> <span class="vexpl"><b>Select which type of queueing you would like to use</b>
443
		  <?php if (is_array($config['shaper']['queue']) > 0): ?>
444
			<script language="javascript">
445
			document.iform.schedulertype.disabled = 1;
446
			</script>
447
			<br>
448
			NOTE: This option is disabled since there are queues defined.
449
		  <?php endif; ?>
450
		    </span></td>
451
		</tr>
452

    
453
		<tr>
454
                  <td width="22%" valign="top" class="vncell">Firewall Optimization Options</td>
455
                  <td width="78%" class="vtable">
456
			<select onChange="update_description(this.selectedIndex);" name="optimization" id="optimization">
457
			<option value="normal"<?php if($config['system']['optimization']=="normal") echo " SELECTED"; ?>>normal</option>
458
			<option value="high-latency"<?php if($config['system']['optimization']=="high-latency") echo " SELECTED"; ?>>high-latency</option>
459
			<option value="aggressive"<?php if($config['system']['optimization']=="aggressive") echo " SELECTED"; ?>>aggressive</option>
460
			<option value="conservative"<?php if($config['system']['optimization']=="conservative") echo " SELECTED"; ?>>conservative</option>
461
			</select>
462
			<textarea cols="60" rows="2" id="info" name="info"style="border:1px dashed #000066; background-color: #ffffff; color: #000000; font-size: 8pt;">
463
			</textarea>
464
			<script language="javascript">
465
			update_description(document.forms[0].optimization.selectedIndex);
466
			</script>
467
			<br><span class="vexpl"><b>Select which type of state table optimization your would like to use</b></td>
468
                </tr>
469

    
470
                <tr>
471
                  <td width="22%" valign="top" class="vncell">Disable Firewall</td>
472
                  <td width="78%" class="vtable">
473
                    <input name="disablefilter" type="checkbox" id="disablefilter" value="yes" <?php if (isset($config['system']['disablefilter'])) echo "checked"; ?> onclick="enable_change(false)">
474
                    <strong>Disable the firewalls filter altogether.</strong><br>
475
                    <span class="vexpl">NOTE!  This basically converts pfSense into a routing only platform!</span></td>
476
                </tr>
477

    
478
                <tr>
479
                  <td width="22%" valign="top" class="vncell">Firewall Maximum States</td>
480
                  <td width="78%" class="vtable">
481
                    <input name="maximumstates" type="input" id="maximumstates" value="<?php echo $pconfig['maximumstates']; ?>" onclick="enable_change(false)"><br>
482
                    <strong>Maximum number of connections to hold in the firewall state table.</strong><br>
483
                    <span class="vexpl">NOTE!  Leave this blank for the default of 10000</span></td>
484
                </tr>
485

    
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"></td>
494
                </tr>
495

    
496

    
497

    
498

    
499

    
500

    
501
              </table>
502
</form>
503
            <script language="JavaScript">
504
<!--
505
enable_change(false);
506
enable_altfirmwareurl(false);
507
enable_altpkgconfigurl(false);
508
//-->
509
</script>
510
<?php include("fend.inc"); ?>
511
</body>
512
</html>
(92-92/112)