Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Load balancing between 2 nics
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Joe23
n00b
n00b


Joined: 11 Jan 2004
Posts: 21

PostPosted: Sun Jan 11, 2004 1:13 am    Post subject: Load balancing between 2 nics Reply with quote

Hey there,
I came across a really wierd problem.
I have 2 nics installed, both are connected to the same switch and both are on the same network (same mask and same default gateway).
I've edited /etc/conf.d/net :
iface_eth1="242.141.11.9 netmask 255.255.255.192"
iface_eth0="242.141.11.11 netmask 255.255.255.192"

gateway="eth0/242.141.11.1"
gateway="eth1/242.141.11.1"

I also installed a ftp deamon (glftpd) and configured the required configuration there to support load balancing.
Im trying to reach a point where if a user is downloading/uploading a file from the server it'll once send the file via eth0 and then via eth1 and so on..
When i look at 'ifconfig' i can see that both nics are in use (i can see the amount of data grow there) but the problem is (i know you've been waiting for this already) that one send is about x4 faster than the other ! ive tried to switch IPs between the nics and the problem is still there, this time, on the other nic. which means it's *not* a nic problem.

what could be the problem ?
When i do 'netstat -rn' here is the output:
Destination Gateway Genmask Flags MSS Window irtt Iface
242.141.11.0 0.0.0.0 255.255.255.192 U 0 0 0 eth0
242.141.11.0 0.0.0.0 255.255.255.192 U 0 0 0 eth1
0.0.0.0 242.141.11.1 0.0.0.0 UG 0 0 0 eth1

I find this output sort of wierd because to me it looks like the default route is only to eth1 ! am i wrong ?

Please, i need advice, this is driving me crazy :)

Joe.
Back to top
View user's profile Send private message
adaptr
Watchman
Watchman


Joined: 06 Oct 2002
Posts: 6730
Location: Rotterdam, Netherlands

PostPosted: Sun Jan 11, 2004 1:26 am    Post subject: Reply with quote

If you want to use 2 NICs to increase bandwidth, you have to use channel bonding - normal TCP/IP can't work this way.
For one, there is ever only one default gateway for a machine, no matter how many networks it belongs to.

You'll have to rebuild the kernel with EQL/ line bonding turned on, this allows you to make a single virtual NIC out of two.

Normal config after that.

In almost any situation, connecting 2 NICs to the same switch on the same subnet just doesn't make much sense...
Back to top
View user's profile Send private message
Joe23
n00b
n00b


Joined: 11 Jan 2004
Posts: 21

PostPosted: Sun Jan 11, 2004 6:00 am    Post subject: Reply with quote

Any idea where i can read more about enabling channel bonding?
Ive never done it before.

thanks!
Back to top
View user's profile Send private message
Paidhi
n00b
n00b


Joined: 11 Jun 2002
Posts: 47
Location: Vienna, Austria

PostPosted: Sun Jan 11, 2004 11:00 am    Post subject: Reply with quote

Hi,

there is a description in the Kernel-Documentation:
/usr/src/linux/Documentation/networking/bonding.txt

-Markus-
_________________
Unix _IS_ userfriendly. It's just selective about who it's friends are.
Back to top
View user's profile Send private message
fleed
l33t
l33t


Joined: 28 Aug 2002
Posts: 756
Location: London

PostPosted: Sun Jan 11, 2004 11:06 am    Post subject: Reply with quote

Also note that channel bonding only works if the other side of your connection supports it. Your ISP would need to provide support for it. I think if you don't want anything too fancy/expensive, then load balancing should work fine. Maybe you should try using a client such as prozilla which is able to download using multiple connections to the ftp server. That way the second connection might be made on the second interface.
Back to top
View user's profile Send private message
Joe23
n00b
n00b


Joined: 11 Jan 2004
Posts: 21

PostPosted: Sun Jan 11, 2004 2:28 pm    Post subject: Reply with quote

First of all, thanks for all your help.
I have full control over the switch to whom the pc is connected to.
Like i said, both nics are connected to the same switch.
If i define channel bonding (box side) do i have to change any special configuration in the switch side ? like trunking the 2 ports?
It makes sense that i do... but then again, what if i was connecting the pc into a hub which has no managment at all ?
*sigh*

I remind you, this is a LAN connection so my ISP doesn't have to support anything, it's for internal office use. i just want the PC to be 200mbit instead of 100mbit.

Joe
Back to top
View user's profile Send private message
ctacat
n00b
n00b


Joined: 17 Feb 2003
Posts: 12

PostPosted: Sun Jan 11, 2004 6:47 pm    Post subject: Reply with quote

To do channel bonding, you NEED to trunk 2 ports on the switch. If your switch can't do that, you can't use the 2 NICs to double transfer rates.

However, there is another possibility. It's not actually doubling transfer rates, but it's better than nothing. If you have a DNS server on your LAN (and you have control of it...), you can use round-robin capability of such a DNS server (at least with bind...).

If you have chance, this config can look like double transfer rate in the best case (two computers accessing the same server with same amount of data to transfer, and the DNS returns a different IP address to each computer).
Back to top
View user's profile Send private message
Joe23
n00b
n00b


Joined: 11 Jan 2004
Posts: 21

PostPosted: Sun Jan 11, 2004 8:18 pm    Post subject: Reply with quote

thanks everyone ! you all helped alot !
i now know what needs to be one :)
cheers!

Joe
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum