From 401452ec0cdf52246ce0c6623e97583f614576f9 Mon Sep 17 00:00:00 2001 From: Seth Mos Date: Sat, 30 Dec 2006 00:45:25 +0000 Subject: 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. --- etc/inc/vslb.inc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'etc/inc/vslb.inc') 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"; -- cgit v1.1