Ethernet Bonding on Ubuntu Server

Share Button

If you work with critical Server and create fault tolerant systems to increase the availability, I think after having redundant Power Supplies and a Raid 5 at least, Ethernet bonding is the next most important option to implement. The Linux Kernel uses a module called ifenslave and it provides you with 7 modes to configure the bond.

balance-rr or 0
Round-robin policy transmits packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance.

active-backup or 1
Active-backup policy only one slave in the bond is active. A different slave becomes active if, and only if, the active slave fails. The bond’s MAC address is externally visible on only one port to avoid confusing the switch.

balance-xor or 2
XOR policy transmit based on the selected transmit hash policy. The default policy is a simple [source MAC address XOR'd with destination MAC address] modulo slave count This mode provides load balancing and fault tolerance.

broadcast or 3
Broadcast policy transmits everything on all slave interfaces. This mode provides fault tolerance.

802.3ad or 4
IEEE 802.3ad Dynamic link aggregation. Creates aggregation groups that share the same speed and duplex settings. Utilises all slaves in the active aggregator according to the 802.3ad specification. Additional Switch configuration and support required.

balance-tlb or 5
Adaptive transmit load balancing channel bonding that does not require any special switch support. The outgoing traffic is distributed according to the current load on each slave. Incoming traffic is received by current slave. If the receiving slave fails another slave takes over the MAC address of the failed receiving slave.

balance-alb or 6
Adaptive load balancing includes balance-tlb plus receive load balancing (rlb) for IPv4 traffic, and does not require any special switch support. The receive load balancing is achieved by ARP negotiation. The bonding driver intercepts the ARP replies sent by local system on their way out and overwrites the source hardware address with the unique hardware address of one of the slaves in the bond such that different peers use different hardware addresses for the server.

Enjoy the demonstration in the Video Clip:

About Michael St. John

Michael St. John is a System Engineer in Albuquerque, NM. I am working with Linux since 1994 and started with the Linux Distribution Slackware. I used Slackware till I needed and more flexible and easier way to maintain my systems and I looked into Debian/Ubuntu and loved Ubuntu right away. I don't have to worry any longer about solving dependencies or compiling code every time an update was available to patch exploits or bugs and that when Ubuntu 8.04 was just released and the rest is history.
This entry was posted in Command Line, Networking, Server, Virtualization and tagged , , , , , , , , . Bookmark the permalink.

7 Responses to Ethernet Bonding on Ubuntu Server

  1. Matteo says:

    Thanks a lot: just as tutorials should be: brief, precise and that works the first time!

  2. Michael says:

    Thanks a lot…That is my goal…I am trying to be precise, short and functional….good to know I accomplished my goal…

  3. kdawg says:

    very, very, very nice, i made this work once before through some happy accident. i looked for hours with no good directions, until i found your video. like the other person said brief and precise, and worked the first time.

    THANKS!

  4. Anonymous says:

    You video about Ethernet bonding is pretty good. I try to set up my server Ubuntu 9.1 using two Gi NIC card everything look ok on the server but I have problem when I try to login using ssh command from another computer. If I use ssh from the server it self to another; I have no problems conneting to it. Do you have any advice about what can be wrong ?

    Thanks

    Esmelin

    esmelin@ihdea.org

  5. Michael says:

    what bonding protocol are you using and how is it wired? Do you have openssh-server installed? Do you have a firewall running on that box? Do you see login attempts in the log (daemon.log/messages)

  6. Dredger says:

    Hi Michael,

    Great video… Just what I have been looking for! I realize that it is a couple years old now, but I hope that you don’t mind me asking a few questions on the subjet.

    Firstly, if you have both eth0 and eth1 both being external WAN connections, and you create the bond0 static IP of .25 where does the gateway of .1 come in? Is there a master connection of the two connections, or is it that you have another server on the network that filters all the traffic… Proxy, firewall or something? If so can I just do it all on the same box if I don’t have multiple boxes available? Would I use 127.0.0.1 or the same static IP that I gave the bond as the gateway? (Sorry I am a novice at this stuff…)

    Secondly, I am trying to do this on an old PC in the office that I have decomissioned and want to try use for bonding and proxy to get a bit of extra speed out of our Internet connections… Ubuntu 11.01 32bit is dog slow to boot and do anything on there. Would you advise downloading an earlier version of Ubuntu, and if so which, or do I install without the Unity Gui enabled? (I am presuming that that can be done – Haven’t tried it).

    Thirdly, do I have to use ethernet ports, or can I use usb 3G dongles in a bond too? Is it just a matter of specifying the connections that are to be added to the bond?

    Lastly, for my setup I want to use our ADLS line and 3G bonded together to start, but will need a way to manage the amount of data that is used on each of them. Can I set a maximum data limit (Hard Coded) for downloading on eth0 and then a seperate limit on the 3G? Example, I have 30GB of ADSL data available per month and 60GB on the 3G connecltion. If I use option 5 or 6 would I need to have equal cap on each connection?

    Thanks for all the posts and Video’s that you do. They are a great source of information and a learning channel for peope like me.

    Dredger.

    • MSJ says:

      Thanks for your post. I am happy to help!

      Firstly, when you create the bond0 you specify the gateway address right there and the system. Depending on the protocoll you chose for the bond0, if it’s active/passive then yes there is a master/slave relationship. I suggest that you read through the bond protocolls and determine whats best for your given situation. Remember that when you use 803.2ad that the switch needs to be able to do this as well and the switch needs to be configured for that too. You can put all of that on one box if you have enought RAM, Processing power and disk space. If I understand this correctly that you would like to squeeze all traffic thru this machine than everybody on the network needs to use this machine as their gateway.

      Secondly, the bonding will not give you extra speed just redundancy unless you use 803.2ad (Link Aggregation) I would recommand to download a Ubuntu server edition and no GUI if you like to save ressources. Ubuntu 10.04LTS would be just fine. I would not go older than that because they will run out of support/mainenace soon and with 10.04LTS you still have a couple of years.

      Thirdly, I personally have never tried it with something else that ethernet port but as long those devices has been recognized and they are functioning I am pretty sure that you can make that work too. Just use their respective device name instead of eth(x).

      Lastly, I think if you use an Active/Passive failover configuration that should get you to your goal. I am not aware of anything that will automatically failover after reaching a certain throughput. I am pretty sure that there is something out there that fit your needs.

      If you like to try something that includes most of your goals I like to recommend Smoothwall. Check it out.

      I hope I answered all your questions to your satisfation.

Leave a Reply