LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-09-2005, 09:12 AM   #1
pxumsgdxpcvjm
Member
 
Registered: Aug 2005
Posts: 235

Rep: Reputation: 30
Unhappy HELP:Load balancing 2 NICs (with a twist!)


The peculiar Problem

Background:
PC running Ubuntu 5.10, 224Mb RAM
2 NICs eth0, eth1

eth0 config
Static IP : 10.21.153.09
netmask: 255.255.255.0
Gateway: 10.21.153.1
nameservers
202.144.105.4
202.144.10.50

eth1 config
DHCP
usually
ip 192.168.1.2(netmask 255.255.255.0)
gateway ip 192.168.1.1
nameserver 192.168.1.1

Tests:
eth0 alone works, i am able to download stuff
eth1 alone works, i am able to download stuff

"simultaneously"/"together" is the problem
1 machine cannot have 2 default gateways ??

i want to use whichever/or both(if available)
and not have to manually switch connections

==================================
i looked at
http://lartc.org/howto/lartc.rpdb.multiple-links.html

but alas could not make head/tail of it :-(
(my case is a little different)

I cannot go for a h/w soln., (dont have money !)
I need a s/w soln. one that works on 1 computer(mine)(don't have another machine)


i switched to ubuntu from WinXP,
confidant that i would be able to do it
(that....and the fact that you cannot do it in WinXP )

please .... please
could you tell me a soln. and how to apply it to my
case...............................

merci !
 
Old 11-09-2005, 11:29 AM   #2
pxumsgdxpcvjm
Member
 
Registered: Aug 2005
Posts: 235

Original Poster
Rep: Reputation: 30
No One here wants to help me??

guyz !!!

is there no one that can help me with this ???
 
Old 11-09-2005, 07:19 PM   #3
born4linux
Senior Member
 
Registered: Sep 2002
Location: Philippines
Distribution: Slackware, RHEL&variants, AIX, SuSE
Posts: 1,127

Rep: Reputation: 49
http://www.ssi.bg/~ja/#routes

and check out the nano howto. also, take a look at the mpaht2.sh script.
 
Old 11-10-2005, 09:43 AM   #4
pxumsgdxpcvjm
Member
 
Registered: Aug 2005
Posts: 235

Original Poster
Rep: Reputation: 30
Failover Works !, Load Balancing Doesn't ?????

wow hey thanks for replying !!
since no one seemed to reply i tried the soln. listed in
http://lartc.org/howto/lartc.rpdb.multiple-links.html

heres what i did

vi /etc/iproute2/rt_tables
added
3 t1
4 t2

then

ip route add 10.21.153.1 dev eth0 src 10.21.153.09 table t1
ip route add default via 10.21.153.1 table t1
ip route add 192.168.1.1 dev eth1 src 192.168.1.2 table t2
ip route add default via 192.168.1.1 table t2
ip route add 10.21.153.1 dev eth0 src 10.21.153.09
ip route add 192.168.1.1 dev eth1 src 192.168.1.2
ip route add default via 10.21.153.1
ip rule add from 10.21.153.09 table t1
ip rule add from 192.168.1.2 table t2

====optional============
ip route add 127.0.0.1 dev lo table t1
ip route add 192.168.1.1 dev eth1 table t1
ip route add 127.0.0.0/8 dev lo table t1
ip route add 127.0.0.1 dev lo table t2
ip route add 10.21.153.1 dev eth0 table t2
ip route add 127.0.0.0/8 dev lo table t2
====optional============

the resulting o/p from cmd
route<enter>
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.1 * 255.255.255.255 UH 0 0 0 eth1
10.21.153.1 * 255.255.255.255 UH 0 0 0 eth0
localnet * 255.255.255.0 U 0 0 0 eth0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
default 10.21.153.1 0.0.0.0 UG 0 0 0 eth0


To test the failover i did
ifconfig eth0 down

then reloaded a website
it did'nt find it
reloaded again
the second connection kicked in <woohoo>
the website loaded nicely

but
again going back to the point before disabling eth0
i started a download
the speed with which it downloaded
was only 256kbps(30KBps)
but i am trying to load balance 2x256kbps


that i am afraid is not happening

guyz please help me accomplish this:

1> provide failover connection to 2 different ISPs
2> provide loadbalancing between these 2 connections

Last edited by pxumsgdxpcvjm; 11-12-2005 at 12:21 PM.
 
Old 11-12-2005, 12:18 PM   #5
pxumsgdxpcvjm
Member
 
Registered: Aug 2005
Posts: 235

Original Poster
Rep: Reputation: 30
hellooo ??
hey people!
the above setup has not solved my problem

could you please...pretty please take a look
at what i am doing wrong ???

thanx
 
Old 12-06-2005, 06:48 AM   #6
pxumsgdxpcvjm
Member
 
Registered: Aug 2005
Posts: 235

Original Poster
Rep: Reputation: 30
Netsane: Still Basic Failover

I guess Netsane will be easier for most folks

http://freshmeat.net/projects/netsane/
http://muse.linuxmafia.org/netsane/
.....(only for load balancing 2 Internet connections)

if u know ur way around linux

try manual method like
http://imbezol.criticaldamage.com/loadbalance.php


I tried Netsane and it does work(mostly)
but its useless for things like Bittorrent

as i understand route through a particular device are cached
so they always go over the same device so
in short almost all of bittorrent ends up going over 1 link

but if you have 2 downloads(http) from different websites
then load balancing occurs

i am still waiting for how to implement load balancing
(which helps bittorrent too) in taking advantage of
2 connections

hopefully an expert will come along
 
Old 12-06-2005, 03:40 PM   #7
pxumsgdxpcvjm
Member
 
Registered: Aug 2005
Posts: 235

Original Poster
Rep: Reputation: 30
If you do not wish to muck around with iptables
(or for that matter any HOWTOs on TLDP.org)

let your firewall handle the load balancing

shorewall does this
(but apparantly iptables 1.3.1 which is in ubuntu 5.10
has 'shitting me' CONNMARK, so upgrade or patch)

http://www.shorewall.net/MultiISP.html
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
outbound web traffic load balancing across multiple nics univaco Linux - Networking 5 01-21-2009 01:25 PM
load balancing nics... roofy Linux - Networking 8 12-22-2005 11:24 AM
Setup Dual nics for load balancing/failover thistleair Linux - Networking 4 05-11-2005 02:15 PM
Load Balancing otisthegbs Linux - Networking 4 02-10-2005 02:16 PM
how to do load balancing? yenonn Linux - Networking 2 07-27-2004 09:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration