1. Hey Guest Did you know you can win an Honor 10 phone worth ₹33,000 and an additional ₹70,000 in paytm vouchers, just by replying to some threads and taking part in the discussions happening in the Honor Hub?

    What are you waiting for? Start commenting and start winning! Remember to read the instructions posted here.

    Dismiss Notice

Linux Load Balancing / Connection Teaming

Discussion in 'Open Source' started by allajunaki, Aug 31, 2004.

Thread Status:
Not open for further replies.
  1. allajunaki

    allajunaki New Member

    Joined:
    Jul 20, 2004
    Messages:
    143
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Somewhere In my room....
    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
     
  2. freshseasons

    freshseasons King of my own Castle

    Joined:
    May 7, 2004
    Messages:
    1,407
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    EVERYWHERE
    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:
     
  3. OP
    OP
    allajunaki

    allajunaki New Member

    Joined:
    Jul 20, 2004
    Messages:
    143
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Somewhere In my room....
    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....
     
  4. GNUrag

    GNUrag FooBar Guy

    Joined:
    Jun 22, 2004
    Messages:
    1,246
    Likes Received:
    5
    Trophy Points:
    0
    Location:
    Interwebs
    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...
     
  5. OP
    OP
    allajunaki

    allajunaki New Member

    Joined:
    Jul 20, 2004
    Messages:
    143
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Somewhere In my room....
    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...
     
Thread Status:
Not open for further replies.

Share This Page