Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Channel Bonding Guide
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Ma3oxuct
Guru
Guru


Joined: 18 Apr 2003
Posts: 523

PostPosted: Wed Jul 04, 2007 8:48 pm    Post subject: Channel Bonding Guide Reply with quote

If you do not know what channel bonding is or, if you don't know howto set it up,
then this guide is for you.

Here is the problem I was faced with:
I purchased a Gigabit switch so that I could more quickly transfer files from one
computer to another. One of the computers already had a gigabit adapter. The
other, however, held one 100 megabit Ethernet card. I had two more 100 megabit
adapters lying around, so I decided to put those in and see if I could do some
magic.

Called "Link aggregation" in some circles, the Linux kernel calls
it "Channel Bonding". The basic concept is that you force multiple
interface to use one ip address. If your hardware (in my case, the pci bus) is fast
enough, you can triple your transfer speed with three Ethernet cards. More generally,
if you have x cards, you can theoretically achieve x times faster transfer rates.

The set up procedure is very simple. First, you have to enable some stuff in your kernel:
Code:
Device Drivers  --->
  Network device support  --->
    <M>   Bonding driver support

Documentation in the kernel says:
Documentation/networking/bonding.txt wrote:
It is recommended that you configure the
driver as module since it is currently the only way to pass parameters
to the driver or configure more than one bonding device.

It is therefore probably best to compile the driver as module.

The next step is to emerge ifenslave:
Code:
emerge ifenslave

You might want to do:
Code:
modprobe bonding

Add something like this to /etc/conf.d/net:
Code:
# vi /etc/conf.d/net
slaves_bond0="eth0 eth1 eth2"
config_bond0="dhcp"
# If you have a static ip:
#config_bond0=("x.x.x.x netmask x.x.x.x")
#routes_bond0=("default via x.x.x.x")

You have to create the appropriate init script get bond0 to load on startup:
Code:
cd /etc/init.d
ln -s net.lo net.bond0
rc-update add net.bond0 default
rc-update del net.eth0

Finally, you can get away from re-booting:
Code:
/etc/init.d/bond0 start

If everything is configured right, you should see something like this:
Code:
# ifconfig
bond0     Link encap:Ethernet  HWaddr 00:0C:41:EB:E1:AD
          inet addr:10.1.1.2  Bcast:10.1.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:3917188 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4498609 errors:0 dropped:0 overruns:13 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:357088636 (340.5 Mb)  TX bytes:2106234583 (2008.6 Mb)

eth0      Link encap:Ethernet  HWaddr 00:0C:41:EB:E1:AD
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:985711 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1217796 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:90923683 (86.7 Mb)  TX bytes:1710807693 (1631.5 Mb)
          Interrupt:12 Base address:0x9800

eth1      Link encap:Ethernet  HWaddr 00:0C:41:EB:E1:AD
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:1972849 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2121123 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:197553777 (188.4 Mb)  TX bytes:3043069241 (2902.0 Mb)
          Interrupt:11 Base address:0x9000

eth2      Link encap:Ethernet  HWaddr 00:0C:41:EB:E1:AD
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:958644 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1159706 errors:0 dropped:0 overruns:13 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:68612232 (65.4 Mb)  TX bytes:1647327537 (1571.0 Mb)
          Interrupt:10


Last edited by Ma3oxuct on Thu Jul 05, 2007 4:22 pm; edited 1 time in total
Back to top
View user's profile Send private message
no_hope
Guru
Guru


Joined: 23 Jun 2003
Posts: 482

PostPosted: Thu Jul 05, 2007 3:44 pm    Post subject: Reply with quote

Interesting. Any benchmarks to share?
Back to top
View user's profile Send private message
Ma3oxuct
Guru
Guru


Joined: 18 Apr 2003
Posts: 523

PostPosted: Fri Jul 06, 2007 1:34 pm    Post subject: Reply with quote

no_hope wrote:
Interesting. Any benchmarks to share?


Unfortunately not :(. The problem is that my motherboard's (where I put all three of the eth interfaces) pci bus does not handle speeds greater than 3 megabyte per second. I know bonding works though since I see the three lights blinking in round robin on my switch during transfers.

I set bonding up at work on a fast machine, but I don't have a giga-bit switch to benchmark on.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks 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