Project

General

Profile

Download (30.2 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
	system_advanced_firewall.php
5
	part of pfSense
6
	Copyright (C) 2005-2007 Scott Ullrich
7

    
8
	Copyright (C) 2008 Shrew Soft Inc
9

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

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

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

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

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

    
39
##|+PRIV
40
##|*IDENT=page-system-advanced-firewall
41
##|*NAME=System: Advanced: Firewall and NAT page
42
##|*DESCR=Allow access to the 'System: Advanced: Firewall and NAT' page.
43
##|*MATCH=system_advanced.php*
44
##|-PRIV
45

    
46
require("guiconfig.inc");
47
require_once("functions.inc");
48
require_once("filter.inc");
49
require_once("shaper.inc");
50

    
51
$pconfig['disablefilter'] = $config['system']['disablefilter'];
52
$pconfig['rfc959workaround'] = $config['system']['rfc959workaround'];
53
$pconfig['scrubnodf'] = $config['system']['scrubnodf'];
54
$pconfig['scrubrnid'] = $config['system']['scrubrnid'];
55
$pconfig['tcpidletimeout'] = $config['filter']['tcpidletimeout'];
56
$pconfig['optimization'] = $config['filter']['optimization'];
57
$pconfig['adaptivestart'] = $config['system']['adaptivestart'];
58
$pconfig['adaptiveend'] = $config['system']['adaptiveend'];
59
$pconfig['maximumstates'] = $config['system']['maximumstates'];
60
$pconfig['aliasesresolveinterval'] = $config['system']['aliasesresolveinterval'];
61
$old_aliasesresolveinterval = $config['system']['aliasesresolveinterval'];
62
$pconfig['checkaliasesurlcert'] = isset($config['system']['checkaliasesurlcert']);
63
$pconfig['maximumtables'] = $config['system']['maximumtables'];
64
$pconfig['maximumtableentries'] = $config['system']['maximumtableentries'];
65
$pconfig['disablereplyto'] = isset($config['system']['disablereplyto']);
66
$pconfig['disablenegate'] = isset($config['system']['disablenegate']);
67
$pconfig['bogonsinterval'] = $config['system']['bogons']['interval'];
68
$pconfig['disablenatreflection'] = $config['system']['disablenatreflection'];
69
$pconfig['enablebinatreflection'] = $config['system']['enablebinatreflection'];
70
$pconfig['reflectiontimeout'] = $config['system']['reflectiontimeout'];
71
$pconfig['bypassstaticroutes'] = isset($config['filter']['bypassstaticroutes']);
72
$pconfig['disablescrub'] = isset($config['system']['disablescrub']);
73
$pconfig['tftpinterface'] = explode(",", $config['system']['tftpinterface']);
74
$pconfig['disablevpnrules'] = isset($config['system']['disablevpnrules']);
75

    
76
if ($_POST) {
77

    
78
	unset($input_errors);
79
	$pconfig = $_POST;
80

    
81
	/* input validation */
82
	if ((empty($_POST['adaptivestart']) && !empty($_POST['adaptiveend'])) || (!empty($_POST['adaptivestart']) && empty($_POST['adaptiveend'])))
83
		$input_errors[] = gettext("The Firewall Adaptive values must be set together.");
84
	if (!empty($_POST['adaptivestart']) && !is_numericint($_POST['adaptivestart'])) {
85
		$input_errors[] = gettext("The Firewall Adaptive Start value must be an integer.");
86
	}
87
	if (!empty($_POST['adaptiveend']) && !is_numericint($_POST['adaptiveend'])) {
88
		$input_errors[] = gettext("The Firewall Adaptive End value must be an integer.");
89
	}
90
	if ($_POST['maximumstates'] && !is_numericint($_POST['maximumstates'])) {
91
		$input_errors[] = gettext("The Firewall Maximum States value must be an integer.");
92
	}
93
	if ($_POST['aliasesresolveinterval'] && !is_numericint($_POST['aliasesresolveinterval'])) {
94
		$input_errors[] = gettext("The Aliases Hostname Resolve Interval value must be an integer.");
95
	}
96
	if ($_POST['maximumtables'] && !is_numericint($_POST['maximumtables'])) {
97
		$input_errors[] = gettext("The Firewall Maximum Tables value must be an integer.");
98
	}
99
	if ($_POST['maximumtableentries'] && !is_numericint($_POST['maximumtableentries'])) {
100
		$input_errors[] = gettext("The Firewall Maximum Table Entries value must be an integer.");
101
	}
102
	if ($_POST['tcpidletimeout'] && !is_numericint($_POST['tcpidletimeout'])) {
103
		$input_errors[] = gettext("The TCP idle timeout must be an integer.");
104
	}
105
	if ($_POST['reflectiontimeout'] && !is_numericint($_POST['reflectiontimeout'])) {
106
		$input_errors[] = gettext("The Reflection timeout must be an integer.");
107
	}
108

    
109
	ob_flush();
110
	flush();
111

    
112
	if (!$input_errors) {
113

    
114
		if($_POST['disablefilter'] == "yes")
115
			$config['system']['disablefilter'] = "enabled";
116
		else
117
			unset($config['system']['disablefilter']);
118

    
119
		if($_POST['disablevpnrules'] == "yes")
120
			$config['system']['disablevpnrules'] = true;
121
		else
122
			unset($config['system']['disablevpnrules']);
123
		if($_POST['rfc959workaround'] == "yes")
124
			$config['system']['rfc959workaround'] = "enabled";
125
		else
126
			unset($config['system']['rfc959workaround']);
127

    
128
		if($_POST['scrubnodf'] == "yes")
129
			$config['system']['scrubnodf'] = "enabled";
130
		else
131
			unset($config['system']['scrubnodf']);
132

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

    
138
		if (!empty($_POST['adaptiveend']))
139
			$config['system']['adaptiveend'] = $_POST['adaptiveend'];
140
		else
141
			unset($config['system']['adaptiveend']);
142
		if (!empty($_POST['adaptivestart']))
143
			$config['system']['adaptivestart'] = $_POST['adaptivestart'];
144
		else
145
			unset($config['system']['adaptivestart']);
146

    
147
		if ($_POST['checkaliasesurlcert'] == "yes")
148
			$config['system']['checkaliasesurlcert'] = true;
149
		else
150
			unset($config['system']['checkaliasesurlcert']);
151

    
152
		$config['system']['optimization'] = $_POST['optimization'];
153
		$config['system']['maximumstates'] = $_POST['maximumstates'];
154
		$config['system']['aliasesresolveinterval'] = $_POST['aliasesresolveinterval'];
155
		$config['system']['maximumtables'] = $_POST['maximumtables'];
156
		$config['system']['maximumtableentries'] = $_POST['maximumtableentries'];
157

    
158
		if($_POST['natreflection'] == "proxy") {
159
			unset($config['system']['disablenatreflection']);
160
			unset($config['system']['enablenatreflectionpurenat']);
161
		} else if($_POST['natreflection'] == "purenat") {
162
			unset($config['system']['disablenatreflection']);
163
			$config['system']['enablenatreflectionpurenat'] = "yes";
164
		} else {
165
			$config['system']['disablenatreflection'] = "yes";
166
			unset($config['system']['enablenatreflectionpurenat']);
167
		}
168

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

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

    
179
		if($_POST['disablenegate'] == "yes")
180
			$config['system']['disablenegate'] = $_POST['disablenegate'];
181
		else
182
			unset($config['system']['disablenegate']);
183

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

    
189
		$config['system']['reflectiontimeout'] = $_POST['reflectiontimeout'];
190

    
191
		if($_POST['bypassstaticroutes'] == "yes")
192
			$config['filter']['bypassstaticroutes'] = $_POST['bypassstaticroutes'];
193
		elseif(isset($config['filter']['bypassstaticroutes']))
194
			unset($config['filter']['bypassstaticroutes']);
195

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

    
201
		if ($_POST['tftpinterface'])
202
			$config['system']['tftpinterface'] = implode(",", $_POST['tftpinterface']);
203
		else
204
			unset($config['system']['tftpinterface']);
205

    
206
		if ($_POST['bogonsinterval'] != $config['system']['bogons']['interval']) {
207
			switch ($_POST['bogonsinterval']) {
208
				case 'daily':
209
					install_cron_job("/usr/bin/nice -n20 /etc/rc.update_bogons.sh", true, "1", "3", "*", "*", "*");
210
					break;
211
				case 'weekly':
212
					install_cron_job("/usr/bin/nice -n20 /etc/rc.update_bogons.sh", true, "1", "3", "*", "*", "0");
213
					break;
214
				case 'monthly':
215
					// fall through
216
				default:
217
					install_cron_job("/usr/bin/nice -n20 /etc/rc.update_bogons.sh", true, "1", "3", "1", "*", "*");
218
			}
219
			$config['system']['bogons']['interval'] = $_POST['bogonsinterval'];
220
		}
221

    
222
		write_config();
223

    
224
		// Kill filterdns when value changes, filter_configure() will restart it
225
		if (($old_aliasesresolveinterval != $config['system']['aliasesresolveinterval']) &&
226
		    isvalidpid("{$g['varrun_path']}/filterdns.pid"))
227
			killbypid("{$g['varrun_path']}/filterdns.pid");
228

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

    
238
$pgtitle = array(gettext("System"),gettext("Advanced: Firewall and NAT"));
239
include("head.inc");
240

    
241
?>
242

    
243
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
244
<?php include("fbegin.inc"); ?>
245

    
246
<script type="text/javascript">
247
//<![CDATA[
248

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

    
255
function update_description(itemnum) {
256
	document.forms[0].info.value=descs[itemnum];
257

    
258
}
259

    
260
//]]>
261
</script>
262

    
263
<?php
264
	if ($input_errors)
265
		print_input_errors($input_errors);
266
	if ($savemsg)
267
		print_info_box($savemsg);
268
?>
269
	<form action="system_advanced_firewall.php" method="post" name="iform" id="iform">
270
		<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="system advanced firewall/nat">
271
			<tr>
272
				<td class="tabnavtbl">
273
					<?php
274
						$tab_array = array();
275
						$tab_array[] = array(gettext("Admin Access"), false, "system_advanced_admin.php");
276
						$tab_array[] = array(gettext("Firewall / NAT"), true, "system_advanced_firewall.php");
277
						$tab_array[] = array(gettext("Networking"), false, "system_advanced_network.php");
278
						$tab_array[] = array(gettext("Miscellaneous"), false, "system_advanced_misc.php");
279
						$tab_array[] = array(gettext("System Tunables"), false, "system_advanced_sysctl.php");
280
						$tab_array[] = array(gettext("Notifications"), false, "system_advanced_notifications.php");
281
						display_top_tabs($tab_array);
282
					?>
283
				</td>
284
			</tr>
285
			<tr>
286
				<td id="mainarea">
287
					<div class="tabcont">
288
						<span class="vexpl">
289
							<span class="red">
290
								<strong><?=gettext("NOTE:");?>&nbsp;</strong>
291
							</span>
292
							<?=gettext("The options on this page are intended for use by advanced users only.");?>
293
							<br/>
294
						</span>
295
						<br/>
296
						<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
297
							<tr>
298
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Firewall Advanced");?></td>
299
							</tr>
300
							<tr>
301
								<td width="22%" valign="top" class="vncell"><?=gettext("IP Do-Not-Fragment compatibility");?></td>
302
								<td width="78%" class="vtable">
303
									<input name="scrubnodf" type="checkbox" id="scrubnodf" value="yes" <?php if (isset($config['system']['scrubnodf'])) echo "checked=\"checked\""; ?> />
304
									<strong><?=gettext("Clear invalid DF bits instead of dropping the packets");?></strong><br/>
305
									<?=gettext("This allows for communications with hosts that generate fragmented " .
306
									"packets with the don't fragment (DF) bit set. Linux NFS is known to " .
307
									"do this. This will cause the filter to not drop such packets but " .
308
									"instead clear the don't fragment bit.");?>
309
								</td>
310
							</tr>
311
							<tr>
312
								<td width="22%" valign="top" class="vncell"><?=gettext("IP Random id generation");?></td>
313
								<td width="78%" class="vtable">
314
									<input name="scrubrnid" type="checkbox" id="scrubrnid" value="yes" <?php if (isset($config['system']['scrubrnid'])) echo "checked=\"checked\""; ?> />
315
									<strong><?=gettext("Insert a stronger id into IP header of packets passing through the filter.");?></strong><br/>
316
									<?=gettext("Replaces the IP identification field of packets with random values to " .
317
									"compensate for operating systems that use predictable values. " .
318
									"This option only applies to packets that are not fragmented after the " .
319
									"optional packet reassembly.");?>
320
								</td>
321
							</tr>
322
							<tr>
323
								<td width="22%" valign="top" class="vncell"><?=gettext("Firewall Optimization Options");?></td>
324
								<td width="78%" class="vtable">
325
									<select onchange="update_description(this.selectedIndex);" name="optimization" id="optimization">
326
										<option value="normal"<?php if($config['system']['optimization']=="normal") echo " selected=\"selected\""; ?>><?=gettext("normal");?></option>
327
										<option value="high-latency"<?php if($config['system']['optimization']=="high-latency") echo " selected=\"selected\""; ?>><?=gettext("high-latency");?></option>
328
										<option value="aggressive"<?php if($config['system']['optimization']=="aggressive") echo " selected=\"selected\""; ?>><?=gettext("aggressive");?></option>
329
										<option value="conservative"<?php if($config['system']['optimization']=="conservative") echo " selected=\"selected\""; ?>><?=gettext("conservative");?></option>
330
									</select>
331
									<br/>
332
									<textarea readonly="readonly" cols="60" rows="2" id="info" name="info"style="padding:5px; border:1px dashed #990000; background-color: #ffffff; color: #000000; font-size: 8pt;"></textarea>
333
									<script type="text/javascript">
334
									//<![CDATA[
335
										update_description(document.forms[0].optimization.selectedIndex);
336
									//]]>
337
									</script>
338
									<br/>
339
									<?=gettext("Select the type of state table optimization to use");?>
340
								</td>
341
							</tr>
342
							<tr>
343
								<td width="22%" valign="top" class="vncell"><?=gettext("Disable Firewall");?></td>
344
								<td width="78%" class="vtable">
345
									<input name="disablefilter" type="checkbox" id="disablefilter" value="yes" <?php if (isset($config['system']['disablefilter'])) echo "checked=\"checked\""; ?> />
346
									<strong><?=gettext("Disable all packet filtering.");?></strong>
347
									<br/>
348
									<span class="vexpl"><?php printf(gettext("Note:  This converts %s into a routing only platform!"), $g['product_name']);?><br />
349
										<?=gettext("Note:  This will also turn off NAT!");?>
350
										<br/><?=gettext("If you only want to disable NAT, and not firewall rules, visit the");?> <a href="firewall_nat_out.php"><?=gettext("Outbound NAT");?></a> <?=gettext("page");?>.
351
									</span>
352
								</td>
353
							</tr>
354
							<tr>
355
								<td width="22%" valign="top" class="vncell"><?=gettext("Disable Firewall Scrub");?></td>
356
								<td width="78%" class="vtable">
357
									<input name="disablescrub" type="checkbox" id="disablescrub" value="yes" <?php if (isset($config['system']['disablescrub'])) echo "checked=\"checked\""; ?> />
358
									<strong><?=gettext("Disables the PF scrubbing option which can sometimes interfere with NFS and PPTP traffic.");?></strong>
359
									<br/>
360
								</td>
361
							</tr>
362
							<tr>
363
								<td width="22%" valign="top" class="vncell"><?=gettext("Firewall Adaptive Timeouts");?></td>
364
								<td width="78%" class="vtable">
365
									<strong><?=gettext("Timeouts for states can be scaled adaptively as the number of state table entries grows.");?></strong>
366
									<br/>
367
									<input name="adaptivestart" type="text" id="adaptivestart" value="<?php echo $pconfig['adaptivestart']; ?>" />
368
									<br/><?=gettext("When the number of state entries exceeds this value, adaptive scaling begins.  All timeout values are scaled linearly with factor (adaptive.end - number of states) / (adaptive.end - adaptive.start).");?>
369

    
370
									<br/>
371
									<input name="adaptiveend" type="text" id="adaptiveend" value="<?php echo $pconfig['adaptiveend']; ?>" />
372
									<br/><?=gettext("When reaching this number of state entries, all timeout values become zero, effectively purging all state entries immediately.  This value is used to define the scale factor, it should not actually be reached (set a lower state limit, see below).");?>
373
									<br/>
374
									<span class="vexpl"><?=gettext("Note:  Leave this blank for the default(0).");?></span>
375
								</td>
376
							</tr>
377
							<tr>
378
								<td width="22%" valign="top" class="vncell"><?=gettext("Firewall Maximum States");?></td>
379
								<td width="78%" class="vtable">
380
									<input name="maximumstates" type="text" id="maximumstates" value="<?php echo $pconfig['maximumstates']; ?>" />
381
									<br/>
382
									<strong><?=gettext("Maximum number of connections to hold in the firewall state table.");?></strong>
383
									<br/>
384
									<span class="vexpl"><?=gettext("Note:  Leave this blank for the default.  On your system the default size is:");?> <?= pfsense_default_state_size() ?></span>
385
								</td>
386
							</tr>
387
							<tr>
388
								<td width="22%" valign="top" class="vncell"><?=gettext("Firewall Maximum Tables");?></td>
389
								<td width="78%" class="vtable">
390
									<input name="maximumtables" type="text" id="maximumtables" value="<?php echo $pconfig['maximumtables']; ?>" />
391
									<br/>
392
									<strong><?=gettext("Maximum number of tables for systems such as aliases, sshlockout, snort, etc, combined.");?></strong>
393
									<br/><?php echo gettext("This is the actual number of tables, not the number of entries inside the tables (see below)");?>
394
									<br/>
395
									<span class="vexpl">
396
										<?=gettext("Note:  Leave this blank for the default.");?>
397
										<?php if (empty($pconfig['maximumtables'])): ?>
398
											<?= gettext("On your system the default size is:");?> <?= pfsense_default_tables_size(); ?>
399
										<?php endif; ?>
400
									</span>
401
								</td>
402
							</tr>
403
							<tr>
404
								<td width="22%" valign="top" class="vncell"><?=gettext("Firewall Maximum Table Entries");?></td>
405
								<td width="78%" class="vtable">
406
									<input name="maximumtableentries" type="text" id="maximumtableentries" value="<?php echo $pconfig['maximumtableentries']; ?>" />
407
									<br/>
408
									<strong><?=gettext("Maximum number of table entries for systems such as aliases, sshlockout, snort, etc, combined.");?></strong>
409
									<br/>
410
									<span class="vexpl">
411
										<?=gettext("Note:  Leave this blank for the default.");?>
412
										<?php if (empty($pconfig['maximumtableentries'])): ?>
413
											<?= gettext("On your system the default size is:");?> <?= pfsense_default_table_entries_size(); ?>
414
										<?php endif; ?>
415
									</span>
416
								</td>
417
							</tr>
418
							<tr>
419
								<td width="22%" valign="top" class="vncell"><?=gettext("Static route filtering");?></td>
420
								<td width="78%" class="vtable">
421
									<input name="bypassstaticroutes" type="checkbox" id="bypassstaticroutes" value="yes" <?php if ($pconfig['bypassstaticroutes']) echo "checked=\"checked\""; ?> />
422
									<strong><?=gettext("Bypass firewall rules for traffic on the same interface");?></strong>
423
									<br/>
424
									<?=gettext("This option only applies if you have defined one or more static routes. If it is enabled, traffic that enters and " .
425
									"leaves through the same interface will not be checked by the firewall. This may be desirable in some situations where " .
426
									"multiple subnets are connected to the same interface.");?>
427
									<br/>
428
								</td>
429
							</tr>
430
							<tr>
431
								<td width="22%" valign="top" class="vncell">Disable Auto-added VPN rules</td>
432
								<td width="78%" class="vtable">
433
									<input name="disablevpnrules" type="checkbox" id="disablevpnrules" value="yes" <?php if (isset($config['system']['disablevpnrules'])) echo "checked=\"checked\""; ?> />
434
									<strong><?=gettext("Disable all auto-added VPN rules.");?></strong>
435
									<br />
436
									<span class="vexpl"><?=gettext("Note: This disables automatically added rules for IPsec, PPTP.");?>
437
									</span>
438
								</td>
439
							</tr>
440
							<tr>
441
								<td width="22%" valign="top" class="vncell">Disable reply-to</td>
442
								<td width="78%" class="vtable">
443
									<input name="disablereplyto" type="checkbox" id="disablereplyto" value="yes" <?php if ($pconfig['disablereplyto']) echo "checked=\"checked\""; ?> />
444
									<strong><?=gettext("Disable reply-to on WAN rules");?></strong>
445
									<br />
446
									<?=gettext("With Multi-WAN you generally want to ensure traffic leaves the same interface it arrives on, hence reply-to is added automatically by default. " .
447
									"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.");?>
448
									<br />
449
								</td>
450
							</tr>
451
							<tr>
452
								<td width="22%" valign="top" class="vncell">Disable Negate rules</td>
453
								<td width="78%" class="vtable">
454
									<input name="disablenegate" type="checkbox" id="disablenegate" value="yes" <?php if ($pconfig['disablenegate']) echo "checked=\"checked\""; ?> />
455
									<strong><?=gettext("Disable Negate rule on policy routing rules");?></strong>
456
									<br />
457
									<?=gettext("With Multi-WAN you generally want to ensure traffic reaches directly connected networks and VPN networks when using policy routing. You can disable this for special purposes but it requires manually creating rules for these networks");?>
458
									<br />
459
								</td>
460
							</tr>
461
							<tr>
462
								<td width="22%" valign="top" class="vncell"><?=gettext("Aliases Hostnames Resolve Interval");?></td>
463
								<td width="78%" class="vtable">
464
									<input name="aliasesresolveinterval" type="text" id="aliasesresolveinterval" value="<?php echo $pconfig['aliasesresolveinterval']; ?>" />
465
									<br/>
466
									<strong><?=gettext("Interval, in seconds, that will be used to resolve hostnames configured on aliases.");?></strong>
467
									<br/>
468
									<span class="vexpl"><?=gettext("Note:  Leave this blank for the default (300s).");?></span>
469
								</td>
470
							</tr>
471
							<tr>
472
							<td width="22%" valign="top" class="vncell"><?=gettext("Check certificate of aliases URLs");?></td>
473
								<td width="78%" class="vtable">
474
									<input name="checkaliasesurlcert" type="checkbox" id="checkaliasesurlcert" value="yes" <?php if ($pconfig['checkaliasesurlcert']) echo "checked=\"checked\""; ?> />
475
									<strong><?=gettext("Verify HTTPS certificates when downloading alias URLs");?></strong>
476
									<br />
477
									<?=gettext("Make sure the certificate is valid for all HTTPS addresses on aliases. If it's not valid or is revoked, do not download it.");?>
478
									<br />
479
								</td>
480
							</tr>
481
							<tr>
482
								<td colspan="2" class="list" height="12">&nbsp;</td>
483
							</tr>
484
							<tr>
485
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Bogon Networks");?></td>
486
							</tr>
487
							<tr>
488
								<td width="22%" valign="top" class="vncell"><?=gettext("Update Frequency");?></td>
489
								<td width="78%" class="vtable">
490
									<select name="bogonsinterval" class="formselect">
491
									<option value="monthly" <?php if (empty($pconfig['bogonsinterval']) || $pconfig['bogonsinterval'] == 'monthly') echo "selected=\"selected\""; ?>><?=gettext("Monthly"); ?></option>
492
									<option value="weekly" <?php if ($pconfig['bogonsinterval'] == 'weekly') echo "selected=\"selected\""; ?>><?=gettext("Weekly"); ?></option>
493
									<option value="daily" <?php if ($pconfig['bogonsinterval'] == 'daily') echo "selected=\"selected\""; ?>><?=gettext("Daily"); ?></option>
494
									</select>
495
									<br/>
496
									<?=gettext("The frequency of updating the lists of IP addresses that are reserved (but not RFC 1918) or not yet assigned by IANA.");?>
497
								</td>
498
							</tr>
499
							<tr>
500
								<td colspan="2" class="list" height="12">&nbsp;</td>
501
							</tr>
502
							<?php if(count($config['interfaces']) > 1): ?>
503
							<tr>
504
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Network Address Translation");?></td>
505
							</tr>
506
							<tr>
507
								<td width="22%" valign="top" class="vncell"><?=gettext("NAT Reflection mode for port forwards");?></td>
508
								<td width="78%" class="vtable">
509
									<select name="natreflection" class="formselect">
510
									<option value="disable" <?php if (isset($config['system']['disablenatreflection'])) echo "selected=\"selected\""; ?>><?=gettext("Disable"); ?></option>
511
									<option value="proxy" <?php if (!isset($config['system']['disablenatreflection']) && !isset($config['system']['enablenatreflectionpurenat'])) echo "selected=\"selected\""; ?>><?=gettext("Enable (NAT + Proxy)"); ?></option>
512
									<option value="purenat" <?php if (!isset($config['system']['disablenatreflection']) && isset($config['system']['enablenatreflectionpurenat'])) echo "selected=\"selected\""; ?>><?=gettext("Enable (Pure NAT)"); ?></option>
513
									</select>
514
									<br/>
515
									<strong><?=gettext("When enabled, this automatically creates additional NAT redirect rules for access to port forwards on your external IP addresses from within your internal networks.");?></strong>
516
									<br/><br/>
517
									<?=gettext("The NAT + proxy mode uses a helper program to send packets to the target of the port forward.  It is useful in setups where the interface and/or gateway IP used for communication with the target cannot be accurately determined at the time the rules are loaded.  Reflection rules are not created for ranges larger than 500 ports and will not be used for more than 1000 ports total between all port forwards.  Only TCP and UDP protocols are supported.");?>
518
									<br/><br/>
519
									<?=gettext("The pure NAT mode uses a set of NAT rules to direct packets to the target of the port forward.  It has better scalability, but it must be possible to accurately determine the interface and gateway IP used for communication with the target at the time the rules are loaded.  There are no inherent limits to the number of ports other than the limits of the protocols.  All protocols available for port forwards are supported.");?>
520
									<br/><br/>
521
									<?=gettext("Individual rules may be configured to override this system setting on a per-rule basis.");?>
522
								</td>
523
							</tr>
524
							<tr>
525
								<td width="22%" valign="top" class="vncell"><?=gettext("Reflection Timeout");?></td>
526
								<td width="78%" class="vtable">
527
									<input name="reflectiontimeout" id="reflectiontimeout" value="<?php echo $config['system']['reflectiontimeout']; ?>" /><br/>
528
									<strong><?=gettext("Enter value for Reflection timeout in seconds.");?></strong>
529
									<br/><br/>
530
									<?=gettext("Note: Only applies to Reflection on port forwards in NAT + proxy mode.");?>
531
								</td>
532
							</tr>
533
							<tr>
534
								<td width="22%" valign="top" class="vncell"><?=gettext("Enable NAT Reflection for 1:1 NAT");?></td>
535
								<td width="78%" class="vtable">
536
									<input name="enablebinatreflection" type="checkbox" id="enablebinatreflection" value="yes" <?php if (isset($config['system']['enablebinatreflection'])) echo "checked=\"checked\""; ?> />
537
									<strong><?=gettext("Enables the automatic creation of additional NAT redirect rules for access to 1:1 mappings of your external IP addresses from within your internal networks.");?></strong>
538
									<br/><br/>
539
									<?=gettext("Note: Reflection on 1:1 mappings is only for the inbound component of the 1:1 mappings.  This functions the same as the pure NAT mode for port forwards.  For more details, refer to the pure NAT mode description above.");?>
540
									<br/><br/>
541
									<?=gettext("Individual rules may be configured to override this system setting on a per-rule basis.");?>
542
								</td>
543
							</tr>
544
							<tr>
545
								<td width="22%" valign="top" class="vncell"><?=gettext("Enable automatic outbound NAT for Reflection");?></td>
546
								<td width="78%" class="vtable">
547
									<input name="enablenatreflectionhelper" type="checkbox" id="enablenatreflectionhelper" value="yes" <?php if (isset($config['system']['enablenatreflectionhelper'])) echo "checked=\"checked\""; ?> />
548
									<strong><?=gettext("Automatically create outbound NAT rules which assist inbound NAT rules that direct traffic back out to the same subnet it originated from.");?></strong>
549
									<br/>
550
									<?=gettext("Required for full functionality of the pure NAT mode of NAT Reflection for port forwards or NAT Reflection for 1:1 NAT.");?>
551
									<br/><br/>
552
									<?=gettext("Note: This only works for assigned interfaces.  Other interfaces require manually creating the outbound NAT rules that direct the reply packets back through the router.");?>
553
								</td>
554
							</tr>
555
							<tr>
556
								<td width="22%" valign="top" class="vncell"><?=gettext("TFTP Proxy");?></td>
557
								<td width="78%" class="vtable">
558
									<select name="tftpinterface[]" multiple="multiple" class="formselect" size="3">
559
<?php
560
										$ifdescs = get_configured_interface_with_descr();
561
										foreach ($ifdescs as $ifent => $ifdesc):
562
?>
563
											<option value="<?=$ifent;?>" <?php if (in_array($ifent, $pconfig['tftpinterface'])) echo "selected=\"selected\""; ?>><?=gettext($ifdesc);?></option>
564
<?php									endforeach; ?>
565
									</select>
566
									<strong><?=gettext("Choose the interfaces where you want TFTP proxy helper to be enabled.");?></strong>
567
								</td>
568
							</tr>
569
							<tr>
570
								<td colspan="2" class="list" height="12">&nbsp;</td>
571
							</tr>
572
							<?php endif; ?>
573
							<tr>
574
								<td width="22%" valign="top">&nbsp;</td>
575
								<td width="78%"><input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" /></td>
576
							</tr>
577
						</table>
578
					</div>
579
				</td>
580
			</tr>
581
		</table>
582
	</form>
583

    
584
<?php include("fend.inc"); ?>
585
</body>
586
</html>
(197-197/246)