summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-08-07 01:38:52 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-08-07 01:38:52 +0000
commitee998ee16fd508a9688b86df49c8fde43e4427e3 (patch)
treefe231121c289e096229b2d520203520a958e4d13 /etc/inc
parent088da57b992a1038d3ec413660e90da65e8fa9c0 (diff)
downloadpfsense-ee998ee16fd508a9688b86df49c8fde43e4427e3.zip
pfsense-ee998ee16fd508a9688b86df49c8fde43e4427e3.tar.gz
Add outgoing load balancing
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/filter.inc19
1 files changed, 17 insertions, 2 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index f22c1a9..a7693b1 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -1342,8 +1342,23 @@ function generate_user_filter_rule($rule, $ngcounter) {
/* if user has selected a custom gateway, lets work with it */
if($rule['gateway'] <> "") {
- $int = guess_interface_from_ip($rule['gateway']);
- $line .= " route-to (" . $int . " " . $rule['gateway'] . ") ";
+ $foundlb = 0;
+ foreach($config['load_balancer']['lbpool'] as $lb) {
+ if($lb['name'] == $rule['gateway']) {
+ $servers = "";
+ /* XXX: when slbd writes out helper file,
+ * simply read in and feed to route-to
+ */
+ foreach($lb['servers'] as $server) {
+ $servers .= $server . " ";
+ }
+ $line .= " route-to (" . $int . " " . $servers . ") ";
+ }
+ }
+ if($foundlb == 0) {
+ $int = guess_interface_from_ip($rule['gateway']);
+ $line .= " route-to (" . $int . " " . $rule['gateway'] . ") ";
+ }
}
/* Setup outgoing load balancing */
OpenPOWER on IntegriCloud