summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsmos <seth.mos@dds.nl>2011-12-20 20:55:54 +0100
committersmos <seth.mos@dds.nl>2011-12-20 20:55:54 +0100
commitdd72c4183812777245ac44491988413ceaed22e0 (patch)
treea0fdc7a7529bfe299e7405cbf3d9b1a9de5aa657
parente5787a94b7890c9a3905feb842d0a69355559d65 (diff)
downloadpfsense-dd72c4183812777245ac44491988413ceaed22e0.zip
pfsense-dd72c4183812777245ac44491988413ceaed22e0.tar.gz
Add a checkbox that disabled automatically generates negate rules for directly connected networks and VPNs
Ticket #2057 in redmine
-rw-r--r--etc/inc/filter.inc2
-rw-r--r--usr/local/www/system_advanced_firewall.php16
2 files changed, 17 insertions, 1 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index bcd9f4b..967991b 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -2045,7 +2045,7 @@ function filter_generate_user_rule($rule) {
$line = "";
/* exception(s) to a user rules can go here. */
/* rules with a gateway or pool should create another rule for routing to vpns */
- if(($aline['route'] <> "") && (trim($aline['type']) == "pass") && strstr($dst, "any")) {
+ if((($aline['route'] <> "") && (trim($aline['type']) == "pass") && strstr($dst, "any")) && (!isset($config['system']['disablenegate']))) {
/* negate VPN/PPTP/PPPoE/Static Route networks for load balancer/gateway rules */
$negate_networks = " to <negate_networks> ";
$line .= $aline['type'] . $aline['direction'] . $aline['log'] . $aline['quick'] .
diff --git a/usr/local/www/system_advanced_firewall.php b/usr/local/www/system_advanced_firewall.php
index 2b3f5dd..6983422 100644
--- a/usr/local/www/system_advanced_firewall.php
+++ b/usr/local/www/system_advanced_firewall.php
@@ -57,6 +57,7 @@ $pconfig['optimization'] = $config['filter']['optimization'];
$pconfig['maximumstates'] = $config['system']['maximumstates'];
$pconfig['maximumtableentries'] = $config['system']['maximumtableentries'];
$pconfig['disablereplyto'] = isset($config['system']['disablereplyto']);
+$pconfig['disablenegate'] = isset($config['system']['disablenegate']);
$pconfig['disablenatreflection'] = $config['system']['disablenatreflection'];
if (!isset($config['system']['enablebinatreflection']))
$pconfig['disablebinatreflection'] = "yes";
@@ -135,6 +136,11 @@ if ($_POST) {
else
unset($config['system']['disablereplyto']);
+ if($_POST['disablenegate'] == "yes")
+ $config['system']['disablenegate'] = $_POST['disablenegate'];
+ else
+ unset($config['system']['disablenegate']);
+
if($_POST['enablenatreflectionhelper'] == "yes")
$config['system']['enablenatreflectionhelper'] = "yes";
else
@@ -357,6 +363,16 @@ function update_description(itemnum) {
</td>
</tr>
<tr>
+ <td width="22%" valign="top" class="vncell">Disable Negate rules</td>
+ <td width="78%" class="vtable">
+ <input name="disablenegate" type="checkbox" id="disablenegate" value="yes" <?php if ($pconfig['disablenegate']) echo "checked"; ?> />
+ <strong><?=gettext("Disable Negate rule on policy routing rules");?></strong>
+ <br />
+ <?=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");?>
+ <br />
+ </td>
+ </tr>
+ <tr>
<td colspan="2" class="list" height="12">&nbsp;</td>
</tr>
<?php if(count($config['interfaces']) > 1): ?>
OpenPOWER on IntegriCloud