1 |
df81417f
|
Matthew Grooms
|
<?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 |
1d333258
|
Scott Ullrich
|
/*
|
36 |
|
|
pfSense_MODULE: system
|
37 |
|
|
*/
|
38 |
df81417f
|
Matthew Grooms
|
|
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 |
7a927e67
|
Scott Ullrich
|
require_once("functions.inc");
|
48 |
|
|
require_once("filter.inc");
|
49 |
|
|
require_once("shaper.inc");
|
50 |
df81417f
|
Matthew Grooms
|
|
51 |
|
|
$pconfig['disablefilter'] = $config['system']['disablefilter'];
|
52 |
|
|
$pconfig['rfc959workaround'] = $config['system']['rfc959workaround'];
|
53 |
|
|
$pconfig['scrubnodf'] = $config['system']['scrubnodf'];
|
54 |
2867fa7b
|
Ermal Luçi
|
$pconfig['scrubrnid'] = $config['system']['scrubrnid'];
|
55 |
df81417f
|
Matthew Grooms
|
$pconfig['tcpidletimeout'] = $config['filter']['tcpidletimeout'];
|
56 |
|
|
$pconfig['optimization'] = $config['filter']['optimization'];
|
57 |
|
|
$pconfig['maximumstates'] = $config['system']['maximumstates'];
|
58 |
fb586a16
|
jim-p
|
$pconfig['maximumtableentries'] = $config['system']['maximumtableentries'];
|
59 |
f1beeba5
|
lgcosta
|
$pconfig['disablereplyto'] = isset($config['system']['disablereplyto']);
|
60 |
9ae39b01
|
smos
|
$pconfig['disablenegate'] = isset($config['system']['disablenegate']);
|
61 |
df81417f
|
Matthew Grooms
|
$pconfig['disablenatreflection'] = $config['system']['disablenatreflection'];
|
62 |
40fa6dde
|
Erik Fonnesbeck
|
$pconfig['enablebinatreflection'] = $config['system']['enablebinatreflection'];
|
63 |
bff94015
|
Erik Fonnesbeck
|
$pconfig['reflectiontimeout'] = $config['system']['reflectiontimeout'];
|
64 |
df81417f
|
Matthew Grooms
|
$pconfig['bypassstaticroutes'] = isset($config['filter']['bypassstaticroutes']);
|
65 |
|
|
$pconfig['disablescrub'] = isset($config['system']['disablescrub']);
|
66 |
1beafceb
|
Erik Fonnesbeck
|
$pconfig['tftpinterface'] = explode(",", $config['system']['tftpinterface']);
|
67 |
9a36dc9d
|
Ermal
|
$pconfig['disablevpnrules'] = isset($config['system']['disablevpnrules']);
|
68 |
df81417f
|
Matthew Grooms
|
|
69 |
|
|
if ($_POST) {
|
70 |
|
|
|
71 |
|
|
unset($input_errors);
|
72 |
adc3353e
|
bcyrill
|
$pconfig = array_merge($pconfig, $_POST);
|
73 |
df81417f
|
Matthew Grooms
|
|
74 |
|
|
/* input validation */
|
75 |
|
|
if ($_POST['maximumstates'] && !is_numericint($_POST['maximumstates'])) {
|
76 |
ca23c2f8
|
Renato Botelho
|
$input_errors[] = gettext("The Firewall Maximum States value must be an integer.");
|
77 |
df81417f
|
Matthew Grooms
|
}
|
78 |
fb586a16
|
jim-p
|
if ($_POST['maximumtableentries'] && !is_numericint($_POST['maximumtableentries'])) {
|
79 |
|
|
$input_errors[] = gettext("The Firewall Maximum Table Entries value must be an integer.");
|
80 |
|
|
}
|
81 |
df81417f
|
Matthew Grooms
|
if ($_POST['tcpidletimeout'] && !is_numericint($_POST['tcpidletimeout'])) {
|
82 |
ca23c2f8
|
Renato Botelho
|
$input_errors[] = gettext("The TCP idle timeout must be an integer.");
|
83 |
df81417f
|
Matthew Grooms
|
}
|
84 |
bff94015
|
Erik Fonnesbeck
|
if ($_POST['reflectiontimeout'] && !is_numericint($_POST['reflectiontimeout'])) {
|
85 |
|
|
$input_errors[] = gettext("The Reflection timeout must be an integer.");
|
86 |
|
|
}
|
87 |
df81417f
|
Matthew Grooms
|
|
88 |
|
|
ob_flush();
|
89 |
|
|
flush();
|
90 |
|
|
|
91 |
|
|
if (!$input_errors) {
|
92 |
|
|
|
93 |
|
|
if($_POST['disablefilter'] == "yes")
|
94 |
|
|
$config['system']['disablefilter'] = "enabled";
|
95 |
|
|
else
|
96 |
|
|
unset($config['system']['disablefilter']);
|
97 |
|
|
|
98 |
9a36dc9d
|
Ermal
|
if($_POST['disablevpnrules'] == "yes")
|
99 |
|
|
$config['system']['disablevpnrules'] = true;
|
100 |
|
|
else
|
101 |
|
|
unset($config['system']['disablevpnrules']);
|
102 |
df81417f
|
Matthew Grooms
|
if($_POST['rfc959workaround'] == "yes")
|
103 |
|
|
$config['system']['rfc959workaround'] = "enabled";
|
104 |
|
|
else
|
105 |
|
|
unset($config['system']['rfc959workaround']);
|
106 |
|
|
|
107 |
|
|
if($_POST['scrubnodf'] == "yes")
|
108 |
|
|
$config['system']['scrubnodf'] = "enabled";
|
109 |
|
|
else
|
110 |
|
|
unset($config['system']['scrubnodf']);
|
111 |
|
|
|
112 |
2867fa7b
|
Ermal Luçi
|
if($_POST['scrubrnid'] == "yes")
|
113 |
|
|
$config['system']['scrubrnid'] = "enabled";
|
114 |
|
|
else
|
115 |
|
|
unset($config['system']['scrubrnid']);
|
116 |
|
|
|
117 |
df81417f
|
Matthew Grooms
|
$config['system']['optimization'] = $_POST['optimization'];
|
118 |
|
|
$config['system']['maximumstates'] = $_POST['maximumstates'];
|
119 |
fb586a16
|
jim-p
|
$config['system']['maximumtableentries'] = $_POST['maximumtableentries'];
|
120 |
df81417f
|
Matthew Grooms
|
|
121 |
40fa6dde
|
Erik Fonnesbeck
|
if($_POST['natreflection'] == "proxy") {
|
122 |
|
|
unset($config['system']['disablenatreflection']);
|
123 |
|
|
unset($config['system']['enablenatreflectionpurenat']);
|
124 |
|
|
} else if($_POST['natreflection'] == "purenat") {
|
125 |
df81417f
|
Matthew Grooms
|
unset($config['system']['disablenatreflection']);
|
126 |
40fa6dde
|
Erik Fonnesbeck
|
$config['system']['enablenatreflectionpurenat'] = "yes";
|
127 |
|
|
} else {
|
128 |
|
|
$config['system']['disablenatreflection'] = "yes";
|
129 |
|
|
unset($config['system']['enablenatreflectionpurenat']);
|
130 |
|
|
}
|
131 |
9fc22c6f
|
Erik Fonnesbeck
|
|
132 |
40fa6dde
|
Erik Fonnesbeck
|
if($_POST['enablebinatreflection'] == "yes")
|
133 |
9fc22c6f
|
Erik Fonnesbeck
|
$config['system']['enablebinatreflection'] = "yes";
|
134 |
40fa6dde
|
Erik Fonnesbeck
|
else
|
135 |
|
|
unset($config['system']['enablebinatreflection']);
|
136 |
df81417f
|
Matthew Grooms
|
|
137 |
f1beeba5
|
lgcosta
|
if($_POST['disablereplyto'] == "yes")
|
138 |
|
|
$config['system']['disablereplyto'] = $_POST['disablereplyto'];
|
139 |
|
|
else
|
140 |
|
|
unset($config['system']['disablereplyto']);
|
141 |
|
|
|
142 |
9ae39b01
|
smos
|
if($_POST['disablenegate'] == "yes")
|
143 |
|
|
$config['system']['disablenegate'] = $_POST['disablenegate'];
|
144 |
|
|
else
|
145 |
|
|
unset($config['system']['disablenegate']);
|
146 |
|
|
|
147 |
a2b6c52f
|
Erik Fonnesbeck
|
if($_POST['enablenatreflectionhelper'] == "yes")
|
148 |
|
|
$config['system']['enablenatreflectionhelper'] = "yes";
|
149 |
|
|
else
|
150 |
|
|
unset($config['system']['enablenatreflectionhelper']);
|
151 |
|
|
|
152 |
bff94015
|
Erik Fonnesbeck
|
$config['system']['reflectiontimeout'] = $_POST['reflectiontimeout'];
|
153 |
|
|
|
154 |
df81417f
|
Matthew Grooms
|
if($_POST['bypassstaticroutes'] == "yes")
|
155 |
668c4990
|
Seth Mos
|
$config['filter']['bypassstaticroutes'] = $_POST['bypassstaticroutes'];
|
156 |
d2903c0c
|
jim-p
|
elseif(isset($config['filter']['bypassstaticroutes']))
|
157 |
668c4990
|
Seth Mos
|
unset($config['filter']['bypassstaticroutes']);
|
158 |
df81417f
|
Matthew Grooms
|
|
159 |
|
|
if($_POST['disablescrub'] == "yes")
|
160 |
|
|
$config['system']['disablescrub'] = $_POST['disablescrub'];
|
161 |
|
|
else
|
162 |
|
|
unset($config['system']['disablescrub']);
|
163 |
|
|
|
164 |
cfdce2ad
|
Ermal
|
if ($_POST['tftpinterface'])
|
165 |
|
|
$config['system']['tftpinterface'] = implode(",", $_POST['tftpinterface']);
|
166 |
|
|
else
|
167 |
|
|
unset($config['system']['tftpinterface']);
|
168 |
|
|
|
169 |
df81417f
|
Matthew Grooms
|
write_config();
|
170 |
|
|
|
171 |
bd448e7f
|
Ermal Lu?i
|
/*
|
172 |
|
|
* XXX: This is a kludge here but its the better place than on every filter reload.
|
173 |
|
|
* NOTE: This is only for setting the ipfw state limits.
|
174 |
|
|
*/
|
175 |
|
|
if ($_POST['maximumstates'] && is_numeric($_POST['maximumstates']) && is_module_loaded("ipfw.ko"))
|
176 |
|
|
filter_load_ipfw();
|
177 |
|
|
|
178 |
df81417f
|
Matthew Grooms
|
$retval = 0;
|
179 |
|
|
$retval = filter_configure();
|
180 |
|
|
if(stristr($retval, "error") <> true)
|
181 |
|
|
$savemsg = get_std_save_message($retval);
|
182 |
|
|
else
|
183 |
|
|
$savemsg = $retval;
|
184 |
|
|
}
|
185 |
|
|
}
|
186 |
|
|
|
187 |
ca23c2f8
|
Renato Botelho
|
$pgtitle = array(gettext("System"),gettext("Advanced: Firewall and NAT"));
|
188 |
df81417f
|
Matthew Grooms
|
include("head.inc");
|
189 |
|
|
|
190 |
|
|
?>
|
191 |
|
|
|
192 |
|
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
193 |
|
|
<?php include("fbegin.inc"); ?>
|
194 |
|
|
|
195 |
|
|
<script language="JavaScript">
|
196 |
|
|
<!--
|
197 |
|
|
|
198 |
|
|
var descs=new Array(5);
|
199 |
ca23c2f8
|
Renato Botelho
|
descs[0]="<?=gettext("as the name says, it's the normal optimization algorithm");?>";
|
200 |
|
|
descs[1]="<?=gettext("used for high latency links, such as satellite links. Expires idle connections later than default");?>";
|
201 |
|
|
descs[2]="<?=gettext("expires idle connections quicker. More efficient use of CPU and memory but can drop legitimate connections");?>";
|
202 |
|
|
descs[3]="<?=gettext("tries to avoid dropping any legitimate connections at the expense of increased memory usage and CPU utilization.");?>";
|
203 |
df81417f
|
Matthew Grooms
|
|
204 |
|
|
function update_description(itemnum) {
|
205 |
|
|
document.forms[0].info.value=descs[itemnum];
|
206 |
|
|
|
207 |
|
|
}
|
208 |
|
|
|
209 |
|
|
//-->
|
210 |
|
|
</script>
|
211 |
|
|
|
212 |
|
|
<?php
|
213 |
|
|
if ($input_errors)
|
214 |
|
|
print_input_errors($input_errors);
|
215 |
|
|
if ($savemsg)
|
216 |
|
|
print_info_box($savemsg);
|
217 |
|
|
?>
|
218 |
ab3c8553
|
Matthew Grooms
|
<form action="system_advanced_firewall.php" method="post" name="iform" id="iform">
|
219 |
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
220 |
|
|
<tr>
|
221 |
|
|
<td class="tabnavtbl">
|
222 |
|
|
<?php
|
223 |
|
|
$tab_array = array();
|
224 |
ca23c2f8
|
Renato Botelho
|
$tab_array[] = array(gettext("Admin Access"), false, "system_advanced_admin.php");
|
225 |
|
|
$tab_array[] = array(gettext("Firewall / NAT"), true, "system_advanced_firewall.php");
|
226 |
|
|
$tab_array[] = array(gettext("Networking"), false, "system_advanced_network.php");
|
227 |
|
|
$tab_array[] = array(gettext("Miscellaneous"), false, "system_advanced_misc.php");
|
228 |
|
|
$tab_array[] = array(gettext("System Tunables"), false, "system_advanced_sysctl.php");
|
229 |
|
|
$tab_array[] = array(gettext("Notifications"), false, "system_advanced_notifications.php");
|
230 |
ab3c8553
|
Matthew Grooms
|
display_top_tabs($tab_array);
|
231 |
|
|
?>
|
232 |
df81417f
|
Matthew Grooms
|
</ul>
|
233 |
ab3c8553
|
Matthew Grooms
|
</td>
|
234 |
|
|
</tr>
|
235 |
|
|
<tr>
|
236 |
2ff19bfd
|
Matthew Grooms
|
<td id="mainarea">
|
237 |
|
|
<div class="tabcont">
|
238 |
|
|
<span class="vexpl">
|
239 |
|
|
<span class="red">
|
240 |
ea53e38f
|
Renato Botelho
|
<strong><?=gettext("NOTE:");?> </strong>
|
241 |
2ff19bfd
|
Matthew Grooms
|
</span>
|
242 |
ca23c2f8
|
Renato Botelho
|
<?=gettext("The options on this page are intended for use by advanced users only.");?>
|
243 |
2ff19bfd
|
Matthew Grooms
|
<br/>
|
244 |
|
|
</span>
|
245 |
|
|
<br/>
|
246 |
|
|
<table width="100%" border="0" cellpadding="6" cellspacing="0">
|
247 |
ab3c8553
|
Matthew Grooms
|
<tr>
|
248 |
ca23c2f8
|
Renato Botelho
|
<td colspan="2" valign="top" class="listtopic"><?=gettext("Firewall Advanced");?></td>
|
249 |
ab3c8553
|
Matthew Grooms
|
</tr>
|
250 |
|
|
<tr>
|
251 |
ca23c2f8
|
Renato Botelho
|
<td width="22%" valign="top" class="vncell"><?=gettext("IP Do-Not-Fragment compatibility");?></td>
|
252 |
ab3c8553
|
Matthew Grooms
|
<td width="78%" class="vtable">
|
253 |
|
|
<input name="scrubnodf" type="checkbox" id="scrubnodf" value="yes" <?php if (isset($config['system']['scrubnodf'])) echo "checked"; ?> />
|
254 |
ca23c2f8
|
Renato Botelho
|
<strong><?=gettext("Clear invalid DF bits instead of dropping the packets");?></strong><br/>
|
255 |
f0d1af93
|
Carlos Eduardo Ramos
|
<?=gettext("This allows for communications with hosts that generate fragmented " .
|
256 |
|
|
"packets with the don't fragment (DF) bit set. Linux NFS is known to " .
|
257 |
|
|
"do this. This will cause the filter to not drop such packets but " .
|
258 |
|
|
"instead clear the don't fragment bit.");?>
|
259 |
2867fa7b
|
Ermal Luçi
|
</td>
|
260 |
|
|
</tr>
|
261 |
|
|
<tr>
|
262 |
ca23c2f8
|
Renato Botelho
|
<td width="22%" valign="top" class="vncell"><?=gettext("IP Random id generation");?></td>
|
263 |
2867fa7b
|
Ermal Luçi
|
<td width="78%" class="vtable">
|
264 |
|
|
<input name="scrubrnid" type="checkbox" id="scrubnodf" value="yes" <?php if (isset($config['system']['scrubrnid'])) echo "checked"; ?> />
|
265 |
ca23c2f8
|
Renato Botelho
|
<strong><?=gettext("Insert a stronger id into IP header of packets passing through the filter.");?></strong><br/>
|
266 |
f0d1af93
|
Carlos Eduardo Ramos
|
<?=gettext("Replaces the IP identification field of packets with random values to " .
|
267 |
08847295
|
jim-p
|
"compensate for operating systems that use predictable values. " .
|
268 |
f0d1af93
|
Carlos Eduardo Ramos
|
"This option only applies to packets that are not fragmented after the " .
|
269 |
|
|
"optional packet reassembly.");?>
|
270 |
ab3c8553
|
Matthew Grooms
|
</td>
|
271 |
|
|
</tr>
|
272 |
|
|
<tr>
|
273 |
ca23c2f8
|
Renato Botelho
|
<td width="22%" valign="top" class="vncell"><?=gettext("Firewall Optimization Options");?></td>
|
274 |
ab3c8553
|
Matthew Grooms
|
<td width="78%" class="vtable">
|
275 |
|
|
<select onChange="update_description(this.selectedIndex);" name="optimization" id="optimization">
|
276 |
ca23c2f8
|
Renato Botelho
|
<option value="normal"<?php if($config['system']['optimization']=="normal") echo " selected"; ?>><?=gettext("normal");?></option>
|
277 |
|
|
<option value="high-latency"<?php if($config['system']['optimization']=="high-latency") echo " selected"; ?>><?=gettext("high-latency");?></option>
|
278 |
|
|
<option value="aggressive"<?php if($config['system']['optimization']=="aggressive") echo " selected"; ?>><?=gettext("aggressive");?></option>
|
279 |
|
|
<option value="conservative"<?php if($config['system']['optimization']=="conservative") echo " selected"; ?>><?=gettext("conservative");?></option>
|
280 |
ab3c8553
|
Matthew Grooms
|
</select>
|
281 |
|
|
<br/>
|
282 |
dc4f649e
|
Scott Ullrich
|
<textarea readonly="yes" cols="60" rows="2" id="info" name="info"style="padding:5px; border:1px dashed #990000; background-color: #ffffff; color: #000000; font-size: 8pt;"></textarea>
|
283 |
ab3c8553
|
Matthew Grooms
|
<script language="javascript" type="text/javascript">
|
284 |
|
|
update_description(document.forms[0].optimization.selectedIndex);
|
285 |
|
|
</script>
|
286 |
|
|
<br/>
|
287 |
ca23c2f8
|
Renato Botelho
|
<?=gettext("Select the type of state table optimization to use");?>
|
288 |
ab3c8553
|
Matthew Grooms
|
</td>
|
289 |
|
|
</tr>
|
290 |
|
|
<tr>
|
291 |
ca23c2f8
|
Renato Botelho
|
<td width="22%" valign="top" class="vncell"><?=gettext("Disable Firewall");?></td>
|
292 |
ab3c8553
|
Matthew Grooms
|
<td width="78%" class="vtable">
|
293 |
|
|
<input name="disablefilter" type="checkbox" id="disablefilter" value="yes" <?php if (isset($config['system']['disablefilter'])) echo "checked"; ?> />
|
294 |
ca23c2f8
|
Renato Botelho
|
<strong><?=gettext("Disable all packet filtering.");?></strong>
|
295 |
ab3c8553
|
Matthew Grooms
|
<br/>
|
296 |
ca23c2f8
|
Renato Botelho
|
<span class="vexpl"><?php printf(gettext("Note: This converts %s into a routing only platform!"), $g['product_name']);?><br>
|
297 |
5a8a7545
|
jim-p
|
<?=gettext("Note: This will also turn off NAT!");?>
|
298 |
|
|
<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");?>.
|
299 |
ab3c8553
|
Matthew Grooms
|
</span>
|
300 |
|
|
</td>
|
301 |
|
|
</tr>
|
302 |
|
|
<tr>
|
303 |
ca23c2f8
|
Renato Botelho
|
<td width="22%" valign="top" class="vncell"><?=gettext("Disable Firewall Scrub");?></td>
|
304 |
ab3c8553
|
Matthew Grooms
|
<td width="78%" class="vtable">
|
305 |
|
|
<input name="disablescrub" type="checkbox" id="disablescrub" value="yes" <?php if (isset($config['system']['disablescrub'])) echo "checked"; ?> />
|
306 |
ca23c2f8
|
Renato Botelho
|
<strong><?=gettext("Disables the PF scrubbing option which can sometimes interfere with NFS and PPTP traffic.");?></strong>
|
307 |
ab3c8553
|
Matthew Grooms
|
<br/>
|
308 |
|
|
</td>
|
309 |
|
|
</tr>
|
310 |
|
|
<tr>
|
311 |
ca23c2f8
|
Renato Botelho
|
<td width="22%" valign="top" class="vncell"><?=gettext("Firewall Maximum States");?></td>
|
312 |
ab3c8553
|
Matthew Grooms
|
<td width="78%" class="vtable">
|
313 |
|
|
<input name="maximumstates" type="text" id="maximumstates" value="<?php echo $pconfig['maximumstates']; ?>" />
|
314 |
|
|
<br/>
|
315 |
ca23c2f8
|
Renato Botelho
|
<strong><?=gettext("Maximum number of connections to hold in the firewall state table.");?></strong>
|
316 |
ab3c8553
|
Matthew Grooms
|
<br/>
|
317 |
ea53e38f
|
Renato Botelho
|
<span class="vexpl"><?=gettext("Note: Leave this blank for the default. On your system the default size is:");?> <?= pfsense_default_state_size() ?></span>
|
318 |
ab3c8553
|
Matthew Grooms
|
</td>
|
319 |
|
|
</tr>
|
320 |
fb586a16
|
jim-p
|
<tr>
|
321 |
|
|
<td width="22%" valign="top" class="vncell"><?=gettext("Firewall Maximum Table Entries");?></td>
|
322 |
|
|
<td width="78%" class="vtable">
|
323 |
|
|
<input name="maximumtableentries" type="text" id="maximumtableentries" value="<?php echo $pconfig['maximumtableentries']; ?>" />
|
324 |
|
|
<br/>
|
325 |
|
|
<strong><?=gettext("Maximum number of table entries for systems such as aliases, sshlockout, snort, etc, combined.");?></strong>
|
326 |
|
|
<br/>
|
327 |
|
|
<span class="vexpl">
|
328 |
|
|
<?=gettext("Note: Leave this blank for the default.");?>
|
329 |
|
|
<?php if (empty($pconfig['maximumtableentries'])): ?>
|
330 |
ea53e38f
|
Renato Botelho
|
<?= gettext("On your system the default size is:");?> <?= pfsense_default_table_entries_size(); ?>
|
331 |
fb586a16
|
jim-p
|
<?php endif; ?>
|
332 |
|
|
</span>
|
333 |
|
|
</td>
|
334 |
|
|
</tr>
|
335 |
ab3c8553
|
Matthew Grooms
|
<tr>
|
336 |
ca23c2f8
|
Renato Botelho
|
<td width="22%" valign="top" class="vncell"><?=gettext("Static route filtering");?></td>
|
337 |
ab3c8553
|
Matthew Grooms
|
<td width="78%" class="vtable">
|
338 |
|
|
<input name="bypassstaticroutes" type="checkbox" id="bypassstaticroutes" value="yes" <?php if ($pconfig['bypassstaticroutes']) echo "checked"; ?> />
|
339 |
ca23c2f8
|
Renato Botelho
|
<strong><?=gettext("Bypass firewall rules for traffic on the same interface");?></strong>
|
340 |
ab3c8553
|
Matthew Grooms
|
<br/>
|
341 |
f0d1af93
|
Carlos Eduardo Ramos
|
<?=gettext("This option only applies if you have defined one or more static routes. If it is enabled, traffic that enters and " .
|
342 |
|
|
"leaves through the same interface will not be checked by the firewall. This may be desirable in some situations where " .
|
343 |
|
|
"multiple subnets are connected to the same interface.");?>
|
344 |
ab3c8553
|
Matthew Grooms
|
<br/>
|
345 |
|
|
</td>
|
346 |
|
|
</tr>
|
347 |
9a36dc9d
|
Ermal
|
<tr>
|
348 |
|
|
<td width="22%" valign="top" class="vncell">Disable Auto-added VPN rules</td>
|
349 |
|
|
<td width="78%" class="vtable">
|
350 |
|
|
<input name="disablevpnrules" type="checkbox" id="disablevpnrules" value="yes" <?php if (isset($config['system']['disablevpnrules'])) echo "checked"; ?> />
|
351 |
|
|
<strong><?=gettext("Disable all auto-added VPN rules.");?></strong>
|
352 |
|
|
<br />
|
353 |
87bb66af
|
Ermal
|
<span class="vexpl"><?=gettext("Note: This disables automatically added rules for IPsec, PPTP.");?>
|
354 |
9a36dc9d
|
Ermal
|
</span>
|
355 |
|
|
</td>
|
356 |
|
|
</tr>
|
357 |
8b19f4a7
|
Erik Fonnesbeck
|
<tr>
|
358 |
|
|
<td width="22%" valign="top" class="vncell">Disable reply-to</td>
|
359 |
|
|
<td width="78%" class="vtable">
|
360 |
|
|
<input name="disablereplyto" type="checkbox" id="disablereplyto" value="yes" <?php if ($pconfig['disablereplyto']) echo "checked"; ?> />
|
361 |
|
|
<strong><?=gettext("Disable reply-to on WAN rules");?></strong>
|
362 |
|
|
<br />
|
363 |
|
|
<?=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. " .
|
364 |
|
|
"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.");?>
|
365 |
|
|
<br />
|
366 |
|
|
</td>
|
367 |
|
|
</tr>
|
368 |
9ae39b01
|
smos
|
<tr>
|
369 |
|
|
<td width="22%" valign="top" class="vncell">Disable Negate rules</td>
|
370 |
|
|
<td width="78%" class="vtable">
|
371 |
|
|
<input name="disablenegate" type="checkbox" id="disablenegate" value="yes" <?php if ($pconfig['disablenegate']) echo "checked"; ?> />
|
372 |
|
|
<strong><?=gettext("Disable Negate rule on policy routing rules");?></strong>
|
373 |
|
|
<br />
|
374 |
|
|
<?=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");?>
|
375 |
|
|
<br />
|
376 |
|
|
</td>
|
377 |
|
|
</tr>
|
378 |
ab3c8553
|
Matthew Grooms
|
<tr>
|
379 |
|
|
<td colspan="2" class="list" height="12"> </td>
|
380 |
|
|
</tr>
|
381 |
f691243d
|
Ermal
|
<?php if(count($config['interfaces']) > 1): ?>
|
382 |
ab3c8553
|
Matthew Grooms
|
<tr>
|
383 |
ca23c2f8
|
Renato Botelho
|
<td colspan="2" valign="top" class="listtopic"><?=gettext("Network Address Translation");?></td>
|
384 |
ab3c8553
|
Matthew Grooms
|
</tr>
|
385 |
|
|
<tr>
|
386 |
40fa6dde
|
Erik Fonnesbeck
|
<td width="22%" valign="top" class="vncell"><?=gettext("NAT Reflection mode for port forwards");?></td>
|
387 |
ab3c8553
|
Matthew Grooms
|
<td width="78%" class="vtable">
|
388 |
40fa6dde
|
Erik Fonnesbeck
|
<select name="natreflection" class="formselect">
|
389 |
|
|
<option value="disable" <?php if (isset($config['system']['disablenatreflection'])) echo "selected"; ?>><?=gettext("Disable"); ?></option>
|
390 |
|
|
<option value="proxy" <?php if (!isset($config['system']['disablenatreflection']) && !isset($config['system']['enablenatreflectionpurenat'])) echo "selected"; ?>><?=gettext("Enable (NAT + Proxy)"); ?></option>
|
391 |
|
|
<option value="purenat" <?php if (!isset($config['system']['disablenatreflection']) && isset($config['system']['enablenatreflectionpurenat'])) echo "selected"; ?>><?=gettext("Enable (Pure NAT)"); ?></option>
|
392 |
|
|
</select>
|
393 |
|
|
<br/>
|
394 |
|
|
<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>
|
395 |
|
|
<br/><br/>
|
396 |
|
|
<?=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.");?>
|
397 |
|
|
<br/><br/>
|
398 |
|
|
<?=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.");?>
|
399 |
|
|
<br/><br/>
|
400 |
|
|
<?=gettext("Individual rules may be configured to override this system setting on a per-rule basis.");?>
|
401 |
bff94015
|
Erik Fonnesbeck
|
</td>
|
402 |
|
|
</tr>
|
403 |
|
|
<tr>
|
404 |
|
|
<td width="22%" valign="top" class="vncell"><?=gettext("Reflection Timeout");?></td>
|
405 |
|
|
<td width="78%" class="vtable">
|
406 |
|
|
<input name="reflectiontimeout" id="reflectiontimeout" value="<?php echo $config['system']['reflectiontimeout']; ?>" /><br/>
|
407 |
40fa6dde
|
Erik Fonnesbeck
|
<strong><?=gettext("Enter value for Reflection timeout in seconds.");?></strong>
|
408 |
|
|
<br/<br/>
|
409 |
|
|
<?=gettext("Note: Only applies to Reflection on port forwards in NAT + proxy mode.");?>
|
410 |
ab3c8553
|
Matthew Grooms
|
</td>
|
411 |
|
|
</tr>
|
412 |
|
|
<tr>
|
413 |
40fa6dde
|
Erik Fonnesbeck
|
<td width="22%" valign="top" class="vncell"><?=gettext("Enable NAT Reflection for 1:1 NAT");?></td>
|
414 |
ab3c8553
|
Matthew Grooms
|
<td width="78%" class="vtable">
|
415 |
40fa6dde
|
Erik Fonnesbeck
|
<input name="enablebinatreflection" type="checkbox" id="enablebinatreflection" value="yes" <?php if (isset($config['system']['enablebinatreflection'])) echo "checked"; ?> />
|
416 |
8c06bd69
|
Erik Fonnesbeck
|
<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>
|
417 |
40fa6dde
|
Erik Fonnesbeck
|
<br/><br/>
|
418 |
|
|
<?=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.");?>
|
419 |
|
|
<br/><br/>
|
420 |
|
|
<?=gettext("Individual rules may be configured to override this system setting on a per-rule basis.");?>
|
421 |
ab3c8553
|
Matthew Grooms
|
</td>
|
422 |
|
|
</tr>
|
423 |
a2b6c52f
|
Erik Fonnesbeck
|
<tr>
|
424 |
40fa6dde
|
Erik Fonnesbeck
|
<td width="22%" valign="top" class="vncell"><?=gettext("Enable automatic outbound NAT for Reflection");?></td>
|
425 |
a2b6c52f
|
Erik Fonnesbeck
|
<td width="78%" class="vtable">
|
426 |
|
|
<input name="enablenatreflectionhelper" type="checkbox" id="enablenatreflectionhelper" value="yes" <?php if (isset($config['system']['enablenatreflectionhelper'])) echo "checked"; ?> />
|
427 |
|
|
<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>
|
428 |
|
|
<br/>
|
429 |
40fa6dde
|
Erik Fonnesbeck
|
<?=gettext("Required for full functionality of the pure NAT mode of NAT Reflection for port forwards or NAT Reflection for 1:1 NAT.");?>
|
430 |
3f76f90e
|
Erik Fonnesbeck
|
<br/><br/>
|
431 |
|
|
<?=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.");?>
|
432 |
a2b6c52f
|
Erik Fonnesbeck
|
</td>
|
433 |
|
|
</tr>
|
434 |
cfdce2ad
|
Ermal
|
<tr>
|
435 |
ca23c2f8
|
Renato Botelho
|
<td width="22%" valign="top" class="vncell"><?=gettext("TFTP Proxy");?></td>
|
436 |
cfdce2ad
|
Ermal
|
<td width="78%" class="vtable">
|
437 |
|
|
<select name="tftpinterface[]" multiple="true" class="formselect" size="3">
|
438 |
|
|
<?php
|
439 |
ca23c2f8
|
Renato Botelho
|
$ifdescs = get_configured_interface_with_descr();
|
440 |
|
|
foreach ($ifdescs as $ifent => $ifdesc):
|
441 |
cfdce2ad
|
Ermal
|
?>
|
442 |
1beafceb
|
Erik Fonnesbeck
|
<option value="<?=$ifent;?>" <?php if (in_array($ifent, $pconfig['tftpinterface'])) echo "selected"; ?>><?=gettext($ifdesc);?></option>
|
443 |
ca23c2f8
|
Renato Botelho
|
<?php endforeach; ?>
|
444 |
|
|
</select>
|
445 |
c3c2fd20
|
Erik Fonnesbeck
|
<strong><?=gettext("Choose the interfaces where you want TFTP proxy helper to be enabled.");?></strong>
|
446 |
cfdce2ad
|
Ermal
|
</td>
|
447 |
|
|
</tr>
|
448 |
ab3c8553
|
Matthew Grooms
|
<tr>
|
449 |
|
|
<td colspan="2" class="list" height="12"> </td>
|
450 |
|
|
</tr>
|
451 |
|
|
<?php endif; ?>
|
452 |
|
|
<tr>
|
453 |
|
|
<td width="22%" valign="top"> </td>
|
454 |
cf9331b3
|
Renato Botelho
|
<td width="78%"><input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" /></td>
|
455 |
ab3c8553
|
Matthew Grooms
|
</tr>
|
456 |
|
|
</table>
|
457 |
|
|
</td>
|
458 |
|
|
</tr>
|
459 |
|
|
</div>
|
460 |
|
|
</table>
|
461 |
|
|
</form>
|
462 |
df81417f
|
Matthew Grooms
|
|
463 |
|
|
<?php include("fend.inc"); ?>
|
464 |
|
|
</body>
|
465 |
|
|
</html>
|