Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

My PC has 2 wired cards. Both gigalan. It also has 2 wireless cards. One broadcom with proprietary drivers and ralink with open software (which works much better than broadcom). My cellphone can share its connection wirelessly to my PC. But I also have a wired connection. So I have multiple connections that I can use to have internet. How can I merge 2 or more connections together and balance them to enjoy one unified internet experience that it is the sum of all internet connections connected to it.

For example if I have a modem with an internet connection of 1024KB/Sec and another one that offers 512KB/Sec and one small one that offers 128KB/Sec, after load balancing and merging all connections (Bonding or Teaming), I could download at a speed of 1664KB/Sec using all 3 internet connections as one for example.

This question has always intrigued me.

Just to add some links:

Project for Teaming

Teaming Added to Kernel 3.3

Many Enhancements for Teaming in Kernel 3.5

Enhancements to Teaming in Kernel 3.6

Support for Bonding on IPv6 in Kernel 3.7

Bonding Network Interface (Planned)

share|improve this question
2  
Seems rather beyond the scope of Ask Ubuntu :) This is pretty complex networking stuff. IMO it's rarely worth it, by the time you take into account lost packets due to a link being down (even temporarily), reordering packets due to some links being slower than others, and such things. I don't know of a "black box" solution that'll do this, could be an interesting project. – Caesium Nov 27 '11 at 17:43
2  
Well the question is about if this can be done in ubuntu and if yes how. – Luis Alvarado Nov 27 '11 at 17:47
I created an answer in the 2 internet connections on a single PC post. Linking documents for bounding in Ubuntu. – Lucio Feb 25 at 19:58
@Lucio I could mark the question as duplicate or you can move your answer here and I can mark it as accepted. You would also need to be ready for when 13.04 comes out since it will include in Network Manager the bonding options (Only wired bonding slaves right now). – Luis Alvarado Feb 25 at 20:50

3 Answers

I do something like that at work using Ubuntu 11.04. We run the Shorewall firewall configuration tool, which besides being excellent at its job, provides some rudimentary multiple ISP routing tools which might fit your needs. You can find some docs about it here: http://www.shorewall.net/MultiISP.html .

What it comes down to though, is you cant use multiple ISPs for a single connection... things are that simple. The best you can do is try to direct new connections evenly between the different providers.

It is a complex problem. You will probably end up beating your head against the wall (I certainly did) before you are done debugging every problem. So, as other posters have suggested, you might be wise to carefully consider how strong your desire is.

share|improve this answer
Nice link. Very nice tutorial. – Luis Alvarado Feb 8 '12 at 5:08
Let see also this: debuntu.org/2006/02/23/… – Postadelmaga Aug 31 '12 at 15:29

You could do it by using the package ifenslave that attaches and detaches slave network interfaces to a bonding device.

  1. Install:

    sudo apt-get install ifenslave
    
  2. Load bonding kernel module

    sudo modprobe bondingle
    
  3. Configure your interfaces:

    sudo vi /etc/network/interfaces
    

    Example config, to combine eth0 and eth1 as slaves to your bonding interface:

    #eth0 is manually configured, and slave to the "bond0" bonded NIC
    auto eth0
    iface eth0 inet manual
    bond-master bond0
    
    #eth1 ditto, thus creating a 2-link bond.
    auto eth1
    iface eth1 inet manual
    bond-master bond0
    
    # bond0 is the bonded NIC and can be used like any other normal NIC.
    # bond0 is configured using static network information.
    auto bond0
    iface bond0 inet static
    address 192.168.1.10
    gateway 192.168.1.1
    netmask 255.255.255.0
    # bond0 uses standard IEEE 802.3ad LACP bonding protocol 
    bond-mode 802.3ad
    bond-miimon 100
    bond-lacp-rate 1
    bond-slaves none
    
  4. Restart Network:

    sudo restart networking
    
  5. Bringing up/down bounded interface:

    ifup bond0
    ifdown bond0
    

    There are several bonding modes as an example we use:

    bond-mode active-backup
    

    Description of active-backup bonding mode:

    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 (network adapter) to avoid confusing the switch. This mode provides fault tolerance. The primary option affects the behavior of this mode.

    Source and more info at the Ubuntu community help wiki.

Bonding, means combining several network interfaces (NICs) to a single link, providing either high-availability, load-balancing, maximum throughput, or a combination of these. Source

share|improve this answer
+1 because is one of the reasons for my question. Will still wait for a way to create a virtual network master connection that is the sum of all slave (real) connections. Something like bonding that comes in the latest kernel version. – Luis Alvarado Nov 26 '12 at 13:08
-1 - bonding works in LANs as it's operating at Layer 2. The question is about load balancing two independent WANs. – gertvdijk Dec 29 '12 at 12:33
@gertvdijk I don't agree check my update answer to find out that bonding does also load balancing. – pl1nk Dec 31 '12 at 14:33
@pl1nk This is Layer 2 load balancing for two NICs in the same L2 network. This is not the same as multi-ISP load balancing! – gertvdijk Dec 31 '12 at 14:50
@gertvdijk - I don't think that this question has to do with multi-ISP load balancing. – pl1nk Dec 31 '12 at 15:07
show 2 more comments

There is already a thread on it: LINK

Check if you can use it for your requirement.

share|improve this answer
For what I read is not the same. In that question they want to use 2 networks together which for me is fairly easy to do with 2 network card connected to the same PC for each network. Different IP ranges for each and done. What am asking here is using 2 or more internet connections and merging them together. Its a whole different ball game altogether. There are some ways like a router with 2 or more connections and load balancing on it (not my case. Am not resource friendly in my country). There are 2 more i think but are more related to how the network functions at the OS level. – Luis Alvarado Jul 20 '11 at 1:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.