summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-03-27 03:42:24 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-03-27 03:42:24 +0000
commit793d22d83e77ea3f8d2eb0305be0ec4d79c13cef (patch)
treed81fa189fe3dfa49596aa868d5df56ab21094834
parent3314bb92ac5fa9d1fa4505cfd84a98bee1e3e08a (diff)
downloadpfsense-793d22d83e77ea3f8d2eb0305be0ec4d79c13cef.zip
pfsense-793d22d83e77ea3f8d2eb0305be0ec4d79c13cef.tar.gz
Setup outgoing load balancing on the user specified rules.
-rw-r--r--etc/inc/filter.inc32
1 files changed, 16 insertions, 16 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index a8bb226..b9cf780 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -1000,22 +1000,6 @@ function filter_rules_generate() {
$ipfrules .= "pass out quick on " . $wanif . " inet proto tcp from ($wanif) to any port www flags S/SA keep state label \"transparent proxy\"\n";
}
- /* Setup outgoing NAT load balancing */
- if (isset($config['nat']['outgoingloadbalancing']['rule'])) {
- $tmprules .= "pass in quick on " . $lanif . " route-to { ";
- $isfirst = 0;
- foreach ($config['nat']['outgoingloadbalancing']['rule'] as $rule) {
- if($rule['gatewayip'] <> "") {
- if($isfirst == 1) $tmprules .= ", ";
- $lbinf = guess_interface_from_ip($rule['gatewayip']);
- $tmprules .= " (" . $lbinf . " " . $rule['gatewayip'] . ") ";
- $isfirst = 1;
- }
- }
- $tmprules .= "} round-robin from " . $lansa ."/" . $config['interfaces']['lan']['subnet'] . " to any flags S/SA modulate state label \"outgoing nat load balancing\"\n";
- if($isfirst == 1) $ipfrules .= $tmprules;
- }
-
$ipfrules .= <<<EOD
# loopback
@@ -1394,6 +1378,22 @@ EOD;
$line .= "reply-to (" . $ri . " " . $rg . ") ";
}
+ /* Setup outgoing load balancing */
+ if (isset($config['nat']['outgoingloadbalancing']['rule'])) {
+ $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 ";
+ $line .= $tmprules;
+ }
+
if (isset($rule['protocol'])) {
if($rule['protocol'] == "tcp/udp")
$line .= "proto { tcp udp } ";
OpenPOWER on IntegriCloud