summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-03-18 18:45:41 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-03-18 18:45:41 +0000
commit007be4f3aa7e349e9fb536fc4ec3df09af246933 (patch)
tree5fb7968cc99f3bbd96205298e9ab990b0835843f
parenta3900bf025adafa8c2cec7dcf201c14f6161c9dc (diff)
downloadpfsense-007be4f3aa7e349e9fb536fc4ec3df09af246933.zip
pfsense-007be4f3aa7e349e9fb536fc4ec3df09af246933.tar.gz
* Remove return gateway from the rules section
* Add a gateway option to the optional interfaces * Use new gateway in filter.inc when creating the rules if its defined
-rw-r--r--etc/inc/filter.inc5
-rw-r--r--etc/inc/pfsense-utils.inc2
-rwxr-xr-xusr/local/www/firewall_rules_edit.php9
-rwxr-xr-xusr/local/www/interfaces_opt.php15
4 files changed, 16 insertions, 15 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index be55b55..d5e5e66 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -1350,7 +1350,8 @@ EOD;
$line .= "on \$" . $interface . " ";
}
- if($rule['returngateway'] <> "") {
+ $return_gateway = $config['interfaces'][$rule['interface']]['gateway'];
+ if($return_gateway <> "") {
$return_interface = filter_translate_type_to_real_interface($interface);
$line .= "reply-to (" . $return_interface . " " . $rule['returngateway'] . ") ";
}
@@ -1674,4 +1675,4 @@ function create_firewall_outgoing_rules_to_itself() {
return $rule;
}
-?>
+?> \ No newline at end of file
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index dea186f..616481d 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -938,4 +938,4 @@ function make_dirs($path, $mode = 0755)
return is_dir($path) || (make_dirs(dirname($path), $mode) && safe_mkdir($path, $mode));
}
-?>
+?> \ No newline at end of file
diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php
index 116390b..3cf431c 100755
--- a/usr/local/www/firewall_rules_edit.php
+++ b/usr/local/www/firewall_rules_edit.php
@@ -833,15 +833,6 @@ Hint: the difference between block and reject is that with reject, a packet (TCP
</td>
</tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Return gateway</td>
- <td width="78%" class="vtable">
- <input name="returngateway" value="<?php echo $pconfig['returngateway'] ?>">
- <p><strong>Leave blank for default. Enter the next-hop gateway for the return path.
- </strong>
- </td>
- </tr>
-
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
diff --git a/usr/local/www/interfaces_opt.php b/usr/local/www/interfaces_opt.php
index 4626051..f323f4b 100755
--- a/usr/local/www/interfaces_opt.php
+++ b/usr/local/www/interfaces_opt.php
@@ -45,6 +45,7 @@ $pconfig['descr'] = $optcfg['descr'];
$pconfig['bridge'] = $optcfg['bridge'];
$pconfig['ipaddr'] = $optcfg['ipaddr'];
$pconfig['subnet'] = $optcfg['subnet'];
+$pconfig['gateway'] = $optcfg['gateway'];
$pconfig['bandwidth'] = $optcfg['bandwidth'];
$pconfig['bandwidthtype'] = $optcfg['bandwidthtype'];
@@ -128,7 +129,8 @@ if ($_POST) {
$optcfg['enable'] = $_POST['enable'] ? true : false;
$optcfg['bandwidth'] = $_POST['bandwidth'];
$optcfg['bandwidthtype'] = $_POST['bandwidthtype'];
-
+ $optcfg['gateway'] = $_POST['gateway'];
+
write_config();
$retval = 0;
@@ -184,7 +186,7 @@ function ipaddr_change() {
<tr>
<td width="22%" valign="top" class="vtable">&nbsp;</td>
<td width="78%" class="vtable">
-<input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked"; ?> onClick="enable_change(false)">
+ <input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked"; ?> onClick="enable_change(false)">
<strong>Enable Optional <?=$index;?> interface</strong></td>
</tr>
<tr>
@@ -203,7 +205,7 @@ function ipaddr_change() {
<tr>
<td width="22%" valign="top" class="vncellreq">Bridge with</td>
<td width="78%" class="vtable">
-<select name="bridge" class="formfld" id="bridge" onChange="enable_change(false)">
+ <select name="bridge" class="formfld" id="bridge" onChange="enable_change(false)">
<option <?php if (!$pconfig['bridge']) echo "selected";?> value="">none</option>
<?php $opts = array('lan' => "LAN", 'wan' => "WAN");
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
@@ -239,6 +241,13 @@ function ipaddr_change() {
if (isset($optcfg['wireless']))
wireless_config_print();
?>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Gateway</td>
+ <td width="78%" class="vtable">
+ <input name="gateway" value="<?php echo $pconfig['gateway']; ?>">
+ </td>
+ </tr>
+
<tr>
<td colspan="2" valign="top" height="16"></td>
</tr>
OpenPOWER on IntegriCloud