summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-08-09 23:18:55 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-08-09 23:18:55 +0000
commit350b6521f8b67017a2a35b0d733b758dab4b3aa7 (patch)
tree96f3d0de84c12a5ed80e664b67a8682af400fe8e /etc
parente8972a8aa4c4251e13c407911614d4ef66643854 (diff)
downloadpfsense-350b6521f8b67017a2a35b0d733b758dab4b3aa7.zip
pfsense-350b6521f8b67017a2a35b0d733b758dab4b3aa7.tar.gz
Correct load balancing behavior
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/filter.inc30
1 files changed, 7 insertions, 23 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 590fae2..6f8ba61 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -1355,20 +1355,22 @@ function generate_user_filter_rule($rule, $ngcounter) {
}
/* iterate through $lbs and setup items accordingly */
foreach($lbs as $server) {
- $gateway .= $server . " ";
if($foundlb == 1)
$line .= ", ";
/* we are seperating the monitor address from the gateway
* using the | character
*/
- if(stristr($rule['gateway'], "|") == true) {
- $split_ip = split("\|", $rule['gateway']);
+ if(stristr($server, "|") == true) {
+ $split_ip = split("\|", $server);
$rule['gateway'] = $split_ip[0];
- $gateway .= $split_ip[0] . " ";
+ $gateway = $split_ip[0];
}
/* deterimine interface from gateway address */
$int = guess_interface_from_ip($gateway);
$line .= "(" . $int . " " . $gateway . ") ";
+ if($int == "") {
+ $line = "# error resolving load balancing {$gateway}";
+ }
$foundlb = 1;
}
$line .= "} ";
@@ -1381,24 +1383,6 @@ function generate_user_filter_rule($rule, $ngcounter) {
}
}
- /* Setup outgoing load balancing */
- if ($config['nat']['outgoingloadbalancing']['rule'] <> "" and
- isset($config['nat']['outgoingloadbalancing']['enable'])
- and $rule['interface'] == "lan") {
- $tmprules = " route-to { ";
- $isfirst = 0;
- foreach ($config['nat']['outgoingloadbalancing']['rule'] as $rules) {
- if($rules['gatewayip'] <> "") {
- if($isfirst == 1) $tmprules .= ", ";
- $lbinf = guess_interface_from_ip($rules['gatewayip']);
- $tmprules .= " (" . $lbinf . " " . $rules['gatewayip'] . ") ";
- $isfirst = 1;
- }
- }
- $tmprules .= "} round-robin sticky-address ";
- $line .= $tmprules;
- }
-
if (isset($rule['protocol'])) {
if($rule['protocol'] == "tcp/udp")
$line .= "proto { tcp udp } ";
@@ -2336,4 +2320,4 @@ function return_vpn_subnet($adr) {
return " # error - {$adr['network']} ";
}
-?>
+?> \ No newline at end of file
OpenPOWER on IntegriCloud