Mail from ILUG-BOM list (Non-Digest Mode)
_______________________________________________
> A company for which me & Satya have just installed a mail server on Linux,
> is facing a bandwidth problem.
> They have a Dishnet DSL connection which is pathetic to say the least.
They
> also have an ISDN line with a router. How can we boost their bandwidth on
> the net? Can we achieve load balancing by somehow connecting the 2 modems
to
> the net & then pooling their bandwidth to present a common pipe to the
LAN?
> Please send a reply urgently.
You can't balance the load because the two interfaces have different IP
addresses. You can however simulate it by switching the default route every
second or so between the two interfaces.
Existing connections will continue to use the route they were established
using, but new connections take the default route.
You can take this a step further by switching route based on load rather
than time. I didn't get to implementing this though.
My setup used cron to switch gateways. It wasn't very effective because
cron's finest resolution is one minute, but it's proof that this concept
works.
Here's my gateway switching script:
----------
#!/bin/sh
if (grep ppp0 /proc/net/route >& /dev/null); then
if (grep ppp1 /proc/net/route >& /dev/null); then
if [ $1 = "0" ]; then
/sbin/route del default
/sbin/route add default gw `/sbin/route | grep ppp0 | head -1 |
cut -f1 -d" "` dev ppp0 >& /dev/null
else
/sbin/route del default
/sbin/route add default gw `/sbin/route | grep ppp1 | head -1 |
cut -f1 -d" "` dev ppp1 >& /dev/null
fi
else
/sbin/route del default
/sbin/route add default gw `/sbin/route | grep ppp0 | head -1 |
cut -f1 -d" "` dev ppp0 >& /dev/null
fi
else
/sbin/route del default
/sbin/route add default gw `/sbin/route | grep ppp1 | head -1 |
cut -f1 -d" "` dev ppp1 >& /dev/null
fi
----------
Watch for word wrap. Those ugly grep | head | cut filters could be replaced
with a simpler sed script, but I'll leave that to you. Pass the script a
parameter of 0 or 1 indicating ppp0 or ppp1.
--
Kiran Jonnalagadda
http://lunateks.com
_______________________________________________
Website: http://www.ilug-bom.org.in/
Linuxers mailing list
[EMAIL PROTECTED]
http://ilug-bom.org.in/mailman/listinfo/linuxers