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.
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
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