diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-08-07 01:38:52 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-08-07 01:38:52 +0000 |
commit | ee998ee16fd508a9688b86df49c8fde43e4427e3 (patch) | |
tree | fe231121c289e096229b2d520203520a958e4d13 | |
parent | 088da57b992a1038d3ec413660e90da65e8fa9c0 (diff) | |
download | pfsense-ee998ee16fd508a9688b86df49c8fde43e4427e3.zip pfsense-ee998ee16fd508a9688b86df49c8fde43e4427e3.tar.gz |
Add outgoing load balancing
-rw-r--r-- | etc/inc/filter.inc | 19 |
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 */ |