Project

General

Profile

Download (33.2 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['ipv6allow'] = isset($config['system']['ipv6allow']);
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['filteringbridge_enable'] = isset($config['bridge']['filteringbridge']);
48
$pconfig['tcpidletimeout'] = $config['filter']['tcpidletimeout'];
49
$pconfig['maximumstates'] = $config['system']['maximumstates'];
50
$pconfig['disablerendevouz'] = $config['system']['disablerendevouz'];
51
$pconfig['enableserial'] = $config['system']['enableserial'];
52
$pconfig['disablefirmwarecheck'] = isset($config['system']['disablefirmwarecheck']);
53
$pconfig['preferoldsa_enable'] = isset($config['ipsec']['preferoldsa']);
54
$pconfig['enablesshd'] = $config['system']['enablesshd'];
55
$pconfig['sshport'] = $config['system']['ssh']['port'];
56
$pconfig['sshdkeyonly'] = $config['system']['ssh']['sshdkeyonly'];
57
$pconfig['authorizedkeys'] = base64_decode($config['system']['ssh']['authorizedkeys']);
58
$pconfig['sharednet'] = $config['system']['sharednet'];
59
$pconfig['polling_enable'] = isset($config['system']['polling']);
60
$pconfig['bypassstaticroutes'] = isset($config['filter']['bypassstaticroutes']);
61
$pconfig['disablereplyto'] = isset($config['filter']['disablereplyto']);
62
$pconfig['disablenatreflection'] = $config['system']['disablenatreflection'];
63
$pconfig['disablechecksumoffloading'] = isset($config['system']['disablechecksumoffloading']);
64
$pconfig['disableglxsb'] = isset($config['system']['disableglxsb']);
65
$pconfig['disablescrub'] = isset($config['system']['disablescrub']);
66
$pconfig['shapertype']             = $config['system']['shapertype'];
67
$pconfig['lb_use_sticky'] = isset($config['system']['lb_use_sticky']);
68
$pconfig['disablevpnrules'] = isset($config['system']['disablevpnrules']);
69

    
70
if ($_POST) {
71

    
72
	unset($input_errors);
73
	$pconfig = $_POST;
74

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

    
117
}
118

    
119
if ($_POST) {
120
    ob_flush();
121
    flush();
122
	if (!$input_errors) {
123
		if($_POST['disablefilter'] == "yes") {
124
			$config['system']['disablefilter'] = "enabled";
125
		} else {
126
			unset($config['system']['disablefilter']);
127
		}
128
		if($_POST['disablevpnrules'] == "yes") {
129
			$config['system']['disablevpnrules'] = true;
130
		} else {
131
			unset($config['system']['disablevpnrules']);
132
		}
133
		if($_POST['enablesshd'] == "yes") {
134
			$config['system']['enablesshd'] = "enabled";
135
			touch("{$g['tmp_path']}/start_sshd");
136
		} else {
137
			unset($config['system']['enablesshd']);
138
			mwexec("/usr/bin/killall sshd");
139
		}
140
		$oldsshport = $config['system']['ssh']['port'];
141
		$config['system']['ssh']['port'] = $_POST['sshport'];
142

    
143
		if($_POST['polling_enable'] == "yes") {
144
			$config['system']['polling'] = true;
145
			setup_polling();
146
		} else {
147
			unset($config['system']['polling']);
148
			setup_polling();
149
		}
150

    
151
		if($_POST['lb_use_sticky'] == "yes") {
152
			$config['system']['lb_use_sticky'] = true;
153
                        touch("/var/etc/use_pf_pool__stickyaddr");
154
                } else {
155
			unset($config['system']['lb_use_sticky']);
156
                        unlink_if_exists("/var/etc/use_pf_pool__stickyaddr");
157
                }
158

    
159
		if($config['interfaces']['wan']['ipaddr'] == "pppoe") 
160
			unset($config['system']['lb_use_sticky']);
161

    
162
		if($_POST['sharednet'] == "yes") {
163
			$config['system']['sharednet'] = true;
164
			system_disable_arp_wrong_if();
165
		} else {
166
			unset($config['system']['sharednet']);
167
			system_enable_arp_wrong_if();
168
		}
169

    
170
		if($_POST['scrubnodf'] == "yes")
171
			$config['system']['scrubnodf'] = "enabled";
172
		else
173
			unset($config['system']['scrubnodf']);
174

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

    
180
		if($_POST['ipv6nat_enable'] == "yes") {
181
			$config['diag']['ipv6nat']['enable'] = true;
182
			$config['diag']['ipv6nat']['ipaddr'] = $_POST['ipv6nat_ipaddr'];
183
		} else {
184
			unset($config['diag']['ipv6nat']['enable']);
185
			unset($config['diag']['ipv6nat']['ipaddr']);
186
		}
187
		if($_POST['ipv6allow'] == "yes") {
188
			$config['system']['ipv6allow'] = true;
189
		} else {
190
			unset($config['system']['ipv6allow']);
191
		}                
192
		$oldcert = $config['system']['webgui']['certificate'];
193
		$oldkey = $config['system']['webgui']['private-key'];
194
		$config['system']['webgui']['certificate'] = base64_encode($_POST['cert']);
195
		$config['system']['webgui']['private-key'] = base64_encode($_POST['key']);
196
		if($_POST['disableconsolemenu'] == "yes") {
197
			$config['system']['disableconsolemenu'] = true;
198
			auto_login(true);
199
		} else {
200
			unset($config['system']['disableconsolemenu']);
201
			auto_login(false);
202
		}
203
		unset($config['system']['webgui']['expanddiags']);
204
		$config['system']['optimization'] = $_POST['optimization'];
205

    
206
		if($_POST['disablefirmwarecheck'] == "yes")
207
			$config['system']['disablefirmwarecheck'] = true;
208
		else
209
			unset($config['system']['disablefirmwarecheck']);
210

    
211
		if ($_POST['enableserial'] == "yes")
212
			$config['system']['enableserial'] = true;
213
		else
214
			unset($config['system']['enableserial']);
215

    
216
		if($_POST['harddiskstandby'] <> "") {
217
			$config['system']['harddiskstandby'] = $_POST['harddiskstandby'];
218
			system_set_harddisk_standby();
219
		} else
220
			unset($config['system']['harddiskstandby']);
221

    
222
		if ($_POST['noantilockout'] == "yes")
223
			$config['system']['webgui']['noantilockout'] = true;
224
		else
225
			unset($config['system']['webgui']['noantilockout']);
226

    
227
		/* Firewall and ALTQ options */
228
		$config['system']['maximumstates'] = $_POST['maximumstates'];
229

    
230
		if($_POST['enablesshd'] == "yes") {
231
			$config['system']['enablesshd'] = $_POST['enablesshd'];
232
		} else {
233
			unset($config['system']['enablesshd']);
234
		}
235

    
236
		if($_POST['disablechecksumoffloading'] == "yes") {
237
			$config['system']['disablechecksumoffloading'] = $_POST['disablechecksumoffloading'];
238
                        setup_microcode();
239
		} else {
240
			unset($config['system']['disablechecksumoffloading']);
241
                        setup_microcode();
242
		}
243
                
244
                if($_POST['disableglxsb'] == "yes") {
245
			$config['system']['disableglxsb'] = $_POST['disableglxsb'];
246
                        setup_glxsb();
247
		} else {
248
			unset($config['system']['disableglxsb']);
249
                        setup_glxsb();
250
		}
251

    
252
		if($_POST['disablescrub'] == "yes") {
253
			$config['system']['disablescrub'] = $_POST['disablescrub'];
254
		} else {
255
			unset($config['system']['disablescrub']);
256
		}
257

    
258
		if($_POST['disablenatreflection'] == "yes") {
259
			$config['system']['disablenatreflection'] = $_POST['disablenatreflection'];
260
		} else {
261
			unset($config['system']['disablenatreflection']);
262
		}
263
                
264
                if($_POST['disablereplyto'] == "yes") {
265
			$config['filter']['disablereplyto'] = $_POST['disablereplyto'];
266
		} else {
267
			unset($config['filter']['disablereplyto']);
268
		}
269

    
270
		// Traffic shaper
271
		$config['system']['shapertype'] = $_POST['shapertype'];
272
		
273
		$config['ipsec']['preferoldsa'] = $_POST['preferoldsa_enable'] ? true : false;
274
		$config['bridge']['filteringbridge'] = $_POST['filteringbridge_enable'] ? true : false;
275
		$config['filter']['bypassstaticroutes'] = $_POST['bypassstaticroutes'] ? true : false;
276

    
277
		write_config();
278

    
279
		$retval = 0;
280
		config_lock();
281
		$retval = filter_configure();
282
		if(stristr($retval, "error") <> true)
283
		    $savemsg = get_std_save_message($retval);
284
		else
285
		    $savemsg = $retval;
286

    
287
		config_unlock();
288

    
289
		conf_mount_rw();
290

    
291
		setup_serial_port();
292

    
293
		conf_mount_ro();		
294
		
295

    
296
	}
297
}
298

    
299
$pgtitle = "System: Advanced functions";
300
include("head.inc");
301

    
302
?>
303

    
304
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
305

    
306
<?php include("fbegin.inc"); ?>
307
<p class="pgtitle"><?=$pgtitle?></p>
308
<form action="system_advanced.php" method="post" name="iform" id="iform">
309
<?php if ($input_errors) print_input_errors($input_errors); ?>
310
<?php if ($savemsg) print_info_box($savemsg); ?>
311
<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>
312
<br />
313

    
314
<table width="100%" border="0" cellpadding="6" cellspacing="0">
315
	<tbody>
316
		<?php if($g['platform'] == "pfSense" || $g['platform'] == "cdrom"): ?>
317
		<tr>
318
			<td colspan="2" valign="top" class="listtopic">Enable Serial Console</td>
319
		</tr>
320
		<tr>
321
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
322
			<td width="78%" class="vtable">
323
				<input name="enableserial" type="checkbox" id="enableserial" value="yes" <?php if (isset($pconfig['enableserial'])) echo "checked"; ?> onclick="enable_change(false)" />
324
				<strong>This will enable the first serial port with 9600/8/N/1</strong>
325
				<br>
326
				<span class="vexpl">Note:  This will disable the internal video card/keyboard</span>
327
			</td>
328
		</tr>
329
		<tr>
330
			<td width="22%" valign="top">&nbsp;</td>
331
			<td width="78%"><input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /></td>
332
		</tr>
333
		</tr>
334
		<tr>
335
			<td colspan="2" class="list" height="12"></td>
336
		</tr>
337
		<?php endif; ?>
338
		<tr>
339
			<td colspan="2" valign="top" class="listtopic">Secure Shell</td>
340
		</tr>
341
		<tr>
342
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
343
			<td width="78%" class="vtable">
344
				<input name="enablesshd" type="checkbox" id="enablesshd" value="yes" <?php if (isset($pconfig['enablesshd'])) echo "checked"; ?> onclick="enable_change(false)" />
345
				<strong>Enable Secure Shell</strong>
346
			</td>
347
		</tr>
348
 		<tr>
349
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
350
			<td width="78%" class="vtable">
351
				<input name="sshdkeyonly" type="checkbox" id="sshdkeyonly" value="yes" <?php if (isset($pconfig['sshdkeyonly'])) echo "checked"; ?> onclick="enable_change(false)" />
352
				<strong>Disable Password login for Secure Shell (KEY only)</strong>
353
			</td>
354
		</tr>
355
		<tr>
356
			<td width="22%" valign="top" class="vncell">SSH port</td>
357
			<td width="78%" class="vtable">
358
				<input name="sshport" type="text" id="sshport" value="<?php echo $pconfig['sshport']; ?>" onclick="enable_change(false)" />
359
				<br />
360
				<span class="vexpl">Note:  Leave this blank for the default of 22</span>
361
			</td>
362
		</tr>
363
		<tr>
364
			<td width="22%" valign="top" class="vncell"><?=gettext("Authorized keys");?></td>
365
			<td width="78%" class="vtable">
366
				<textarea name="authorizedkeys" cols="65" rows="7" id="authorizedkeys" class="formfld_cert"><?=htmlspecialchars($pconfig['authorizedkeys']);?></textarea>
367
				<br />
368
				Paste an authorized keys file here.
369
 			</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">Shared Physical Network</td>
382
		</tr>
383
		<tr>
384
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
385
			<td width="78%" class="vtable">
386
				<input name="sharednet" type="checkbox" id="sharednet" value="yes" <?php if (isset($pconfig['sharednet'])) echo "checked"; ?> onclick="enable_change(false)" />
387
				<strong>This will suppress ARP messages when interfaces share the same physical network</strong>
388
			</td>
389
		</tr>
390
		<tr>
391
			<td width="22%" valign="top">&nbsp;</td>
392
			<td width="78%">
393
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
394
			</td>
395
		</tr>
396
		<tr>
397
			<td colspan="2" class="list" height="12">&nbsp;</td>
398
		</tr>
399
		<tr>
400
			<td colspan="2" valign="top" class="listtopic">IPv6</td>
401
		</tr>
402
       		<tr>
403
			<td width="22%" valign="top" class="vncell">Allow IPv6</td>
404
			<td width="78%" class="vtable">
405
				<input name="ipv6allow" type="checkbox" id="ipv6allow" value="yes" <?php if ($pconfig['ipv6allow']) echo "checked"; ?> onclick="enable_change(false)" />
406
				<strong>Allow IPv6 traffic</strong>
407
				<br /> <br />
408
				All IPv6 traffic will be blocked unless this box is checked.
409
			</td>
410
		</tr>
411
		<tr>
412
			<td width="22%" valign="top" class="vncell">IPv6 tunneling</td>
413
			<td width="78%" class="vtable">
414
				<input name="ipv6nat_enable" type="checkbox" id="ipv6nat_enable" value="yes" <?php if ($pconfig['ipv6nat_enable']) echo "checked"; ?> onclick="enable_change(false)" />
415
				<strong>NAT encapsulated IPv6 packets (IP protocol 41/RFC2893) to:</strong>
416
				<br /> <br />
417
				<input name="ipv6nat_ipaddr" type="text" class="formfld" id="ipv6nat_ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipv6nat_ipaddr']);?>" />
418
				&nbsp;(IP address)
419
			</td>
420
		</tr>
421
        	<tr>
422
			<td width="22%" valign="top">&nbsp;</td>
423
			<td width="78%">
424
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
425
			</td>
426
		</tr>
427
		<tr>
428
			<td colspan="2" class="list" height="12">&nbsp;</td>
429
		</tr>
430
		<tr>
431
			<td colspan="2" valign="top" class="listtopic">Filtering Bridge</td>
432
		</tr>
433
                <tr>
434
                  <td width="22%" valign="top" class="vncell">&nbsp;</td>
435
                  <td width="78%" class="vtable">
436
                    <strong>Enable filtering bridge</strong><span class="vexpl"><br>
437
                    This setting no longer exists as it is unnecessary. Filtering
438
                    occurs on the member interfaces of the bridge and cannot be
439
                    disabled. </span></td>
440
                </tr>
441
		<tr>
442
			<td width="22%" valign="top">&nbsp;</td>
443
			<td width="78%">
444
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
445
			</td>
446
		</tr>
447
		<tr>
448
			<td colspan="2" class="list" height="12">&nbsp;</td>
449
		</tr>
450
		<tr>
451
			<td colspan="2" valign="top" class="listtopic">webGUI SSL certificate/key</td>
452
		</tr>
453
		<tr>
454
			<td width="22%" valign="top" class="vncell">Certificate</td>
455
			<td width="78%" class="vtable">
456
				<textarea name="cert" cols="65" rows="7" id="cert" class="formpre"><?=htmlspecialchars($pconfig['cert']);?></textarea>
457
				<br />
458
				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.
459
			</td>
460
		</tr>
461
		<tr>
462
			<td width="22%" valign="top" class="vncell">Key</td>
463
			<td width="78%" class="vtable">
464
				<textarea name="key" cols="65" rows="7" id="key" class="formpre"><?=htmlspecialchars($pconfig['key']);?></textarea>
465
				<br />
466
				Paste an RSA private key in PEM format here.
467
			</td>
468
		</tr>
469
		<tr>
470
			<td width="22%" valign="top">&nbsp;</td>
471
			<td width="78%">
472
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
473
			</td>
474
		</tr>
475
		<tr>
476
			<td colspan="2" class="list" height="12">&nbsp;</td>
477
		</tr>
478
		<tr>
479
			<td colspan="2" valign="top" class="listtopic">Load Balancing</td>
480
		</tr>
481
		<tr>
482
			<td width="22%" valign="top" class="vncell">Load Balancing</td>
483
			<td width="78%" class="vtable">
484
				<?php if($config['interfaces']['wan']['ipaddr'] == "pppoe"): ?>
485
					Sticky connections are disabled due to PPPoE being enabled.
486
				<?php else: ?>
487
					<input name="lb_use_sticky" type="checkbox" id="lb_use_sticky" value="yes" <?php if ($pconfig['lb_use_sticky']) echo "checked=\"checked\""; ?> />
488
				<?php endif; ?>
489
				<strong>Use sticky connections</strong>
490
				<br />
491
				<span class="vexpl">
492
				Successive connections will be redirected to the servers in a round-robin manner with connections from the same source being sent to the same web server. This "sticky connection" will exist as long as there are states that refer to this connection. Once the states expire, so will the sticky connection. Further connections from that host will be redirected to the next web server in the round robin.
493
				</span>
494
			</td>
495
		</tr>
496
		<tr>
497
			<td width="22%" valign="top">&nbsp;</td>
498
			<td width="78%">
499
				<input type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="enable_change(true)" />
500
			</td>
501
		</tr>
502
		<tr>
503
			<td colspan="2" class="list" height="12">&nbsp;</td>
504
		</tr>
505
		<tr>
506
			<td colspan="2" valign="top" class="listtopic">Miscellaneous</td>
507
		</tr>
508

    
509
                <tr>
510
                  <td width="22%" valign="top" class="vncell">Device polling</td>
511
                  <td width="78%" class="vtable">
512
                    <input name="polling_enable" type="checkbox" id="polling_enable" value="yes" <?php if ($pconfig['polling_enable']) echo "checked"; ?>>
513
                    <strong>Use device polling</strong><br>
514
                                        Device polling is a technique that lets the system periodically poll network devices for new data instead of relying on interrupts. This prevents your webGUI, SSH, etc. from being inaccessible due to interrupt floods when under extreme load. Generally this is not recommended.
515
                                        Not all NICs support polling; see the <?=$g['product_name'];?> homepage for a list of supported cards.
516
                  </td>
517
                </tr>
518

    
519
		<tr>
520
			<td width="22%" valign="top" class="vncell">Console menu </td>
521
			<td width="78%" class="vtable">
522
				<input name="disableconsolemenu" type="checkbox" id="disableconsolemenu" value="yes" <?php if ($pconfig['disableconsolemenu']) echo "checked"; ?>  />
523
				<strong>Password protect the console menu</strong>
524
				<br />
525
				<span class="vexpl">Changes to this option will take effect after a reboot.</span>
526
			</td>
527
		</tr>
528
<?php if($g['platform'] == "pfSenseDISABLED"): ?>
529
		<tr>
530
			<td width="22%" valign="top" class="vncell">Hard disk standby time </td>
531
			<td width="78%" class="vtable">
532
				<select name="harddiskstandby" class="formfld">
533
<?php
534
				 	## Values from ATA-2 http://www.t13.org/project/d0948r3-ATA-2.pdf (Page 66)
535
					$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");
536
?>
537
					<option value="" <?php if(!$pconfig['harddiskstandby']) echo('selected');?>>Always on</option>
538
<?php
539
					foreach ($sbvals as $sbval):
540
						list($min,$val) = explode(",", $sbval); ?>
541
					<option value="<?=$val;?>" <?php if($pconfig['harddiskstandby'] == $val) echo('selected');?>><?=$min;?> minutes</option>
542
<?php 				endforeach; ?>
543
				</select>
544
				<br />
545
				Puts the hard disk into standby mode when the selected amount of time after the last
546
				access has elapsed. <em>Do not set this for CF cards.</em>
547
			</td>
548
		</tr>
549
<?php endif; ?>
550
		<tr>
551
			<td width="22%" valign="top" class="vncell">webGUI anti-lockout</td>
552
			<td width="78%" class="vtable">
553
				<input name="noantilockout" type="checkbox" id="noantilockout" value="yes" <?php if ($pconfig['noantilockout']) echo "checked"; ?> />
554
				<strong>Disable webGUI anti-lockout rule</strong>
555
				<br />
556
				By default, access to the webGUI on the LAN interface is always permitted, regardless of the user-defined filter
557
				rule set. Enable this feature to control webGUI access (make sure to have a filter rule in place that allows you
558
				in, or you will lock yourself out!).
559
				<br />
560
				Hint: the &quot;set LAN IP address&quot; option in the console menu  resets this setting as well.
561
			</td>
562
		</tr>
563
		<tr>
564
			<td width="22%" valign="top" class="vncell">Static route filtering</td>
565
			<td width="78%" class="vtable">
566
				<input name="bypassstaticroutes" type="checkbox" id="bypassstaticroutes" value="yes" <?php if ($pconfig['bypassstaticroutes']) echo "checked"; ?> />
567
				<strong>Bypass firewall rules for traffic on the same interface</strong>
568
				<br />
569
				This option only applies if you have defined one or more static routes. If it is enabled, traffic that enters and
570
 				leaves through the same interface will not be checked by the firewall. This may be desirable in some situations where
571
				multiple subnets are connected to the same interface.
572
				<br />
573
			</td>
574
		</tr>
575
		<tr>
576
			<td width="22%" valign="top" class="vncell">IPsec SA preferral</td>
577
			<td width="78%" class="vtable">
578
				<input name="preferoldsa_enable" type="checkbox" id="preferoldsa_enable" value="yes" <?php if ($pconfig['preferoldsa_enable']) echo "checked"; ?> />
579
				<strong>Prefer old IPsec SAs</strong>
580
				<br />
581
				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.
582
			</td>
583
		</tr>
584
		<tr>
585
			<td width="22%" valign="top">&nbsp;</td>
586
			<td width="78%">
587
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
588
			</td>
589
		</tr>
590
		<tr>
591
			<td colspan="2" class="list" height="12">&nbsp;</td>
592
		</tr>
593
		<tr>
594
			<td colspan="2" valign="top" class="listtopic">Traffic Shaper and Firewall Advanced</td>
595
		</tr>
596
<?php
597
/*
598
		<tr>
599
			<td width="22%" valign="top" class="vncell">Traffic shaper type</td>
600
			<td width="78%" class="vtable">
601
				<select name="shapertype" class="formselect">
602
					<option value="pfSense"<?php if($pconfig['shapertype'] == 'pfSense') echo " selected"; ?>><?= $g['product_name'] ?> (ALTQ)</option>
603
					<option value="m0n0"<?php if($pconfig['shapertype'] == 'm0n0') echo " selected"; ?>>M0n0wall (dummynet)</option>
604
				</select>
605
			</td>
606
		</tr>
607
*/
608
?>
609
		<tr>
610
			<td width="22%" valign="top" class="vncell">FTP RFC 959 data port violation workaround</td>
611
			<td width="78%" class="vtable">
612
				<input name="rfc959workaround" type="checkbox" id="rfc959workaround" value="yes" <?php if (isset($config['system']['rfc959workaround'])) echo "checked"; ?> onclick="enable_change(false)" />
613
				<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>
614
				<br />
615
			</td>
616
		</tr>
617
		<tr>
618
			<td width="22%" valign="top" class="vncell">Clear DF bit instead of dropping</td>
619
			<td width="78%" class="vtable">
620
				<input name="scrubnodf" type="checkbox" id="scrubnodf" value="yes" <?php if (isset($config['system']['scrubnodf'])) echo "checked"; ?> onclick="enable_change(false)" />
621
				<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>
622
				<br />
623
			</td>
624
		</tr>
625
		<tr>
626
			<td width="22%" valign="top" class="vncell">Firewall Optimization Options</td>
627
			<td width="78%" class="vtable">
628
				<select onChange="update_description(this.selectedIndex);" name="optimization" id="optimization">
629
					<option value="normal"<?php if($config['system']['optimization']=="normal") echo " selected"; ?>>normal</option>
630
					<option value="high-latency"<?php if($config['system']['optimization']=="high-latency") echo " selected"; ?>>high-latency</option>
631
					<option value="aggressive"<?php if($config['system']['optimization']=="aggressive") echo " selected"; ?>>aggressive</option>
632
					<option value="conservative"<?php if($config['system']['optimization']=="conservative") echo " selected"; ?>>conservative</option>
633
				</select>
634
				<br />
635
				<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>
636
				<script language="javascript" type="text/javascript">
637
					update_description(document.forms[0].optimization.selectedIndex);
638
				</script>
639
				<br />
640
				<span class="vexpl"><b>Select which type of state table optimization your would like to use</b></span>
641
			</td>
642
		</tr>
643
		<tr>
644
			<td width="22%" valign="top" class="vncell">Disable Firewall</td>
645
			<td width="78%" class="vtable">
646
				<input name="disablefilter" type="checkbox" id="disablefilter" value="yes" <?php if (isset($config['system']['disablefilter'])) echo "checked"; ?> onclick="enable_change(false)" />
647
				<strong>Disable all packet filtering.</strong>
648
				<br />
649
				<span class="vexpl">Note:  This converts <?=$g['product_name'];?> into a routing only platform!<br>
650
				                    Note:  This will turn off NAT!
651
				</span>
652
			</td>
653
		</tr>
654
		<tr>
655
			<td width="22%" valign="top" class="vncell">Disable Firewall Scrub</td>
656
			<td width="78%" class="vtable">
657
				<input name="disablescrub" type="checkbox" id="disablescrub" value="yes" <?php if (isset($config['system']['disablescrub'])) echo "checked"; ?> onclick="enable_change(false)" />
658
				<strong>Disables the PF scrubbing option which can sometimes interfere with NFS and PPTP traffic.</strong>
659
				<br/>
660
				Click <a href='http://www.openbsd.org/faq/pf/scrub.html' target='_new'>here</a> for more information.
661
			</td>
662
		</tr>
663
		<tr>
664
			<td width="22%" valign="top" class="vncell">Firewall Maximum States</td>
665
			<td width="78%" class="vtable">
666
				<input name="maximumstates" type="text" id="maximumstates" value="<?php echo $pconfig['maximumstates']; ?>" onclick="enable_change(false)" />
667
				<br />
668
				<strong>Maximum number of connections to hold in the firewall state table.</strong>
669
				<br />
670
				<span class="vexpl">Note:  Leave this blank for the default of 10000</span>
671
			</td>
672
		</tr>
673
		<tr>
674
			<td width="22%" valign="top" class="vncell">Disable Auto-added VPN rules</td>
675
			<td width="78%" class="vtable">
676
				<input name="disablevpnrules" type="checkbox" id="disablevpnrules" value="yes" <?php if (isset($config['system']['disablevpnrules'])) echo "checked"; ?> onclick="enable_change(false)" />
677
				<strong>Disable all auto-added VPN rules.</strong>
678
				<br />
679
				<span class="vexpl">Note:  This disables automatically added rules for IPsec, PPTP, and OpenVPN. 
680
				</span>
681
			</td>
682
		</tr>
683
                <tr>
684
			<td width="22%" valign="top" class="vncell">Disable reply-to</td>
685
			<td width="78%" class="vtable">
686
				<input name="disablereplyto" type="checkbox" id="disablereplyto" value="yes" <?php if ($pconfig['disablereplyto']) echo "checked"; ?> />
687
				<strong>Disable reply-to on WAN rules</strong>
688
				<br />
689
				With Multi-WAN you generally want to ensure traffic leaves the same interface it arrives on, hence reply-to is added automatically by default.
690
                                When using bridging, you must disable this behavior if the WAN gateway IP is different from the gateway IP of the hosts behind the bridged interface. 
691
				<br />
692
			</td>
693
		</tr>
694
		<tr>
695
			<td width="22%" valign="top">&nbsp;</td>
696
			<td width="78%"><input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /></td>
697
		</tr>
698
		<tr>
699
			<td colspan="2" class="list" height="12">&nbsp;</td>
700
		</tr>
701
		<tr>
702
			<td colspan="2" valign="top" class="listtopic">Network Address Translation</td>
703
		</tr>
704
		<tr>
705
			<td width="22%" valign="top" class="vncell">Disable NAT Reflection</td>
706
			<td width="78%" class="vtable">
707
				<input name="disablenatreflection" type="checkbox" id="disablenatreflection" value="yes" <?php if (isset($config['system']['disablenatreflection'])) echo "checked"; ?> onclick="enable_change(false)" />
708
				<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>
709
			</td>
710
		</tr>
711
		<tr>
712
			<td width="22%" valign="top">&nbsp;</td>
713
			<td width="78%"><input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /></td>
714
		</tr>
715
		<tr>
716
			<td colspan="2" class="list" height="12">&nbsp;</td>
717
		</tr>
718
		<tr>
719
			<td colspan="2" valign="top" class="listtopic">Hardware Options</td>
720
		</tr>
721
		<tr>
722
			<td width="22%" valign="top" class="vncell">Disable Hardware Checksum Offloading</td>
723
			<td width="78%" class="vtable">
724
				<input name="disablechecksumoffloading" type="checkbox" id="disablechecksumoffloading" value="yes" <?php if (isset($config['system']['disablechecksumoffloading'])) echo "checked"; ?> onclick="enable_change(false)" />
725
				<strong>Checking this option will disable hardware checksum offloading.  Checksum offloading is broken in some hardware, particularly some Realtek cards. Rarely, drivers may have problems with checksum offloading and some specific NICs.</strong>
726
			</td>
727
		</tr>
728
       		<tr>
729
			<td width="22%" valign="top" class="vncell">Disable glxsb loading</td>
730
			<td width="78%" class="vtable">
731
				<input name="disableglxsb" type="checkbox" id="disableglxsb" value="yes" <?php if (isset($config['system']['disableglxsb'])) echo "checked"; ?> onclick="enable_change(false)" />
732
                                <span class="vexpl"><strong>Checking this option will disable loading of the glxsb driver.</strong></span>
733
                                <br>
734
                                <span>The glxsb crypto accelerator is found on some Geode platforms (PC Engines ALIX among others).  When using a better crypto card such as a Hifn, you will want to disable the glxsb. <strong>If this device is currently in use, YOU MUST REBOOT for it to be unloaded.</strong></span>
735
			</td>
736
		</tr>		
737

    
738
		<tr>
739
			<td width="22%" valign="top">&nbsp;</td>
740
			<td width="78%"><input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /></td>
741
		</tr>
742
		<tr>
743
			<td colspan="2" class="list" height="12">&nbsp;</td>
744
		</tr>
745
	</tbody>
746
</table>
747
</form>
748

    
749
<script language="JavaScript" type="text/javascript">
750
<!--
751
	enable_change(false);
752
//-->
753
</script>
754

    
755
<?php include("fend.inc"); ?>
756

    
757
</body>
758
</html>
759

    
760
<?php
761

    
762
if($_POST['cert'] || $_POST['key']) {
763
	if (($config['system']['webgui']['certificate'] != $oldcert)
764
			|| ($config['system']['webgui']['private-key'] != $oldkey)) {
765
	    ob_flush();
766
	    flush();
767
	    log_error("webConfigurator certificates have changed.  Restarting webConfigurator.");
768
	    sleep(1);
769
		touch("/tmp/restart_webgui");
770
	}
771
}
772

    
773
?>
(139-139/175)