Linux Load Balancing / Connection Teaming

Status
Not open for further replies.

allajunaki

Journeyman
hey guys I have multiple dial-up connections to Internet (11 and counting, Dont ask me how!). In windows I can team up connections using a proxy called MidPoint, allows 8 parellel conncetions.

Now in Linux using ip tables append command i was able to get a round robin load distribution, I made a script which will check which connections are active and add those to ip tables:
here is the script.

Code:
echo "Abi's gateway system"
#Delete the default route
`ip route delete default`

#creating the command string
cmd="ip route append scope global "

#check for 11 Active connections (ppp0-ppp10)
for ((net=0;net<=10;net=net+1))
do
        if [ `ifconfig ppp$net | wc -l` -lt 1 ]
	then
		echo "ppp$net is not connected"
	else 
		if [ `ip route | grep "dev ppp$net " | wc -l` -eq 1 ]
		then
			z=`ifconfig ppp$net |grep "inet" | tr -s " " | cut -d " " -f3 | cut -d ":" -f2`
			cmd=$cmd"nexthop via $z dev ppp$net weight 1 "
			echo "ppp$net is added to router"
	
		fi
	fi
done
`$cmd`
echo "Updated"

While this is fine, in order to make a better script i want to know how to findout how many requests are active on one connection so that i can dynamically balance the connections loads using weight option.
So is there any command in Linux which will fetch me the loads?

Also i wnat to know if its possible to suspend the script for xxx seconds? i can use crond to execute periodically, but i'm better off implementing a timing mechanism in the script itself.
Thx in advance
abi a.k.a allajunkai
 

freshseasons

King of my own Castle
Messege Posted July ....hmmm now its Septembet...Knock Knock any linux Fans here....!!!!!
:) Onemore thing So Soory i dont have Any Answer for you....What the hell ..I dont even understand your question !!!!! :oops:
 
OP
A

allajunaki

Journeyman
Dude this was not posted in July...! July is my joining date....
This msg was posted on August 31th, well apparently all the guys with GNU / Linux signatures have gone hiding....
 

GNUrag

FooBar Guy
allajunaki said:
well apparently all the guys with GNU / Linux signatures have gone hiding....
Nope... at least i am not hiding anywhere... I just dont know the answer to your question... heck, i've never ever heard of such a thing...
 
OP
A

allajunaki

Journeyman
Ok i found a solution, i can use netstat to see which are the gateways that are loaded and then adjust the waits accordingly...
I will script the code a lil later, as i have just downloaded Compiled and Installed 2.6.8.1 Kernel.... (Not RedHat but a generic Source which i customized it got it from www.kernel.org .....)
Anyways GNURag Cool Signature... Kind of true...
 
Status
Not open for further replies.
Top Bottom