summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@xs4all.nl>2006-12-30 00:45:25 +0000
committerSeth Mos <seth.mos@xs4all.nl>2006-12-30 00:45:25 +0000
commit401452ec0cdf52246ce0c6623e97583f614576f9 (patch)
treeadd4578ddf1dc26e1e2d4be102d13b0d53389ad3 /etc
parent1cea5083d5e51bb46509225c937f0114089af019 (diff)
downloadpfsense-401452ec0cdf52246ce0c6623e97583f614576f9.zip
pfsense-401452ec0cdf52246ce0c6623e97583f614576f9.tar.gz
Merge in new (outbound) load balancing configuration code from HEAD.
* assign interfaces to pool instead of manual IP configuration * Only show interfaces with a gateway * Offer list of monitor IPs including interface gateways. This code is tested for outbound load balancing on a carp cluster and works for me (smos). The server side needs testing. Which I don't know how to. Let's give it a run for a snapshot or 2.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/filter.inc6
-rw-r--r--etc/inc/vslb.inc10
-rwxr-xr-xetc/rc.newwanip6
3 files changed, 14 insertions, 8 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 1163d7a..d53c21f 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -1410,13 +1410,13 @@ function generate_user_filter_rule($rule, $ngcounter) {
foreach ($config['load_balancer']['lbpool'][$i]['servers'] as $lbsvr) {
$lbsvr_split=split("\|", $lbsvr);
if ($lbsvr_split[1] == $server)
- $gateway = $lbsvr_split[0];
+ /* deterimine interface gateway */
+ $int = convert_friendly_interface_to_real_interface_name($lbsvr_split[0]);
+ $gateway = get_interface_gateway($int);
}
}
if($foundlb == 1)
$routeto .= ", ";
- /* determine interface from gateway address */
- $int = guess_interface_from_ip($gateway);
$routeto .= "( {$int} {$gateway} ) ";
if($int == "") {
$line = "# error resolving load balancing {$gateway}";
diff --git a/etc/inc/vslb.inc b/etc/inc/vslb.inc
index dfd54f8..6dddff0 100644
--- a/etc/inc/vslb.inc
+++ b/etc/inc/vslb.inc
@@ -112,12 +112,12 @@ function slbd_configure() {
$lbsvr_split=split("\|", $lbsvr);
$svrtxt .= "\t:{$svrcnt}={$lbsvr_split[1]}:\\\n";
$svrcnt++;
+
/* Add static routes to the monitor IPs */
- $next_hop = exec_command("/sbin/route -n get {$lbsvr_split[1]} | /usr/bin/grep gateway |/usr/bin/awk '{ print \$2; };'");
- if ($next_hop != $lbsvr_split[0]) {
- mwexec("/sbin/route delete -host {$lbsvr_split[1]} 1>/dev/null 2>&1");
- mwexec("/sbin/route add -host {$lbsvr_split[1]} {$lbsvr_split[0]} 1> /dev/null 2>&1");
- }
+ $int = convert_friendly_interface_to_real_interface_name($lbsvr_split[0]);
+ $gateway = get_interface_gateway($int);
+ mwexec("/sbin/route delete -host {$lbsvr_split[1]} 1>/dev/null 2>&1");
+ mwexec("/sbin/route add -host {$lbsvr_split[1]} {$gateway} 1> /dev/null 2>&1");
}
$slbdconf .= "\t:service-port=666:\\\n";
$slbdconf .= "\t:method=round-robin:\\\n";
diff --git a/etc/rc.newwanip b/etc/rc.newwanip
index 90555a1..aa9b5ee 100755
--- a/etc/rc.newwanip
+++ b/etc/rc.newwanip
@@ -112,6 +112,12 @@ enable_rrd_graphing();
/* restart packages */
exec("/etc/rc.start_packages");
+/* reload slbd */
+/* if ($config['load_balancer']['lbpool']['type'] == "gateway") */
+slbd_configure();
+log_error("Configuring slbd");
+
+
return 0;
?> \ No newline at end of file
OpenPOWER on IntegriCloud