![]() ![]() |
Nov 15 2006, 08:17 AM
Post
#1
|
|
|
Its GNU/Linuxhelp.net ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Support Specialist Posts: 1,420 Joined: 3-January 04 From: Serbia and Montenegro (SCG) Member No.: 2,069 |
Hi,
I've needed to double the avaiable bandiwdth of one of our wireless links, and because we had another pair of same speed wireless units (approx 400kbyte/s~ speed). I've decided that we would go with 2 wireless links bonded together providing some sorta load balancing. Preferably double speed, and failover (though this is not working well with wireless, but these units haven't had problems with their connection for the last 4-5 months). Anyway the way you begin is quiet simple : PC1 1. Get youreself one CentOS 4.x CD1 , nomatter which version, but latest would be preferable. 2. You install the system using the minimal install 3. Once the system is installed you make sure everything is upgraded to latest version by running the following command. CODE yum upgrade 4. Let's imagine the machine we are working on has the IP address of 192.168.1.114 , first you'll need to edit your /etc/modprobe.conf , adding these 2 lines just above the aliases for your ethernet cards. CODE alias bond0 bonding options bond0 miimon=0 arp_interval=2000 arp_ip_target=192.168.1.113 mode=0 5. Now we will need to setup the interfaces correctly , you just go to /etc/sysconfig/network-scripts/, I have three interfaces one named eth0 and the other named eth1 and eth2, these two will be bonded together, and then bridged with eth2, you'll need to edit them like this in order to make the bonding work. /etc/sysconfig/network-scripts/ifcfg-eth0 CODE DEVICE=eth0 BOOTPROTO=none ONBOOT=yes MASTER=bond0 SLAVE=yes USERCTL=no /etc/sysconfig/network-scripts/ifcfg-eth1 CODE DEVICE=eth1 BOOTPROTO=none ONBOOT=yes MASTER=bond0 SLAVE=yes USERCTL=no /etc/sysconfig/network-scripts/ifcfg-eth2 CODE DEVICE=eth2 ONBOOT=yes BOOTPROTO=none /etc/sysconfig/network-scripts/ifcfg-bond0 CODE DEVICE=bond0 BOOTPROTO=none ONBOOT=yes 6. The final step before finishing the setup on the first system is to make sure that on next reboot the system actualy creates the bridged interface with the correct ip address, in order to make this happen add the following lines to your /etc/rc.d/rc.local file /etc/rc.d/rc.local CODE /usr/sbin/brctl addbr my /usr/sbin/brctl addif my bond0 /usr/sbin/brctl addif my eth2 /sbin/ifconfig bond0 0.0.0.0 /sbin/ifconfig eth2 0.0.0.0 /sbin/ifconfig my 192.168.1.114 netmask 255.255.255.0 up /sbin/route add default gw 192.168.1.249 With this the first computer is done, now let's move to the next one, in order to preserve lines here, I will only tell which files to edit nothing more. PC2 /etc/modprobe.conf CODE alias bond0 bonding options bond0 miimon=0 arp_interval=2000 arp_ip_target=192.168.1.114 mode=0 /etc/sysconfig/network-scripts/ifcfg-eth0 CODE DEVICE=eth0 BOOTPROTO=none ONBOOT=yes MASTER=bond0 SLAVE=yes USERCTL=no /etc/sysconfig/network-scripts/ifcfg-eth1 CODE DEVICE=eth1 BOOTPROTO=none ONBOOT=yes MASTER=bond0 SLAVE=yes USERCTL=no /etc/sysconfig/network-scripts/ifcfg-eth2 CODE DEVICE=eth2 ONBOOT=yes BOOTPROTO=none /etc/rc.d/rc.local CODE /usr/sbin/brctl addbr my /usr/sbin/brctl addif my bond0 /usr/sbin/brctl addif my eth2 /sbin/ifconfig bond0 0.0.0.0 /sbin/ifconfig eth2 0.0.0.0 /sbin/ifconfig my 192.168.1.113 netmask 255.255.255.0 up /sbin/route add default gw 192.168.1.249 And finally some information : After you've made the necesary configs to both pc's connect them together make sure that eth0 goes to eth0 on other pc, and eth1 goes to eth1 on other pc. You can now connect 2 test machines to both sides of the bonding bridges like this pc1---eth2---bond---my---------my---bond2---eth2---pc2 and you can check out the speed (you would get better results with linux machines). I've tested the bonding this way, I've setup a ftp server on bond2 and using wget I downloaded a 200MB file to bond, the speed was 20MB/s~ on a 2x100mbit/s line. I've also tested bonding with wireless (and in fact still working with it) 2x400kbyte/s wireless links resulted in a much more responsive 700kbyte/s wireless link (wireless aint doubled... ahh, but that's because wireless works in a strange way most of the time). NOTE : I've had a hell of time making the 2 wireless links work together nicely, in order to make them work in a bonding scenario like this, I had to enable a certain option called MAC ADDRESS CLONING, and had to use different SSID , and different CHANNEL. Sincerely Robert B -------------------- Robert Becskei
robert83@linuxhelp.net -------------------- May the source be with us! -------------------- AMD X2-3800 @ 2400Mhz 2048MB DDR 400Mhz DFI Lanparty UT4 NF4 ULTRA-D GeForce 7800GT 250GB+250GB Pioneer DVD-RW 17inch Samsung Syncmaster 757NF WinXP Pro (SP2)/ CentOS 4.3 -------------------- |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 2nd September 2010 - 08:15 PM |