How to achieve 2-gigabit total throughput on Linux using the bonding driver?

Solution 1:

It is unlikely you will achieve 2 gigabit without cooperation at the switch level and even then it might be hard with only a single IP source/destination combination. Most teams are set up for IP hashing which allocates a single NIC path to each source/destination. As such you'll only get 1 gigabit. There are round-robin schemes but you can often find out of order packet arrival that make it undesirable unless both the host and destination support that scheme.

Solution 2:

You will need Port Aggregation at the switch ports (the two ports of the access switch that are wired to the 2 gigabit ports on your machine need to be aggregated). But, once that is achieved, you should be getting close to a 2Gbps path (limited by the machine's capabilities).

With port aggregation on the switch matching the logical 2Gbps port of the bonding driver you would be using a multiplexed redundant path with just one IP address on the machine.

There are some interesting notes i came across looking this up now, here .

There is a dark side to this wonderful feature of the Linux bonding driver–it only works with network interfaces that allow the MAC address to be changed when the interface is open. The balance-alb mode depends on swift ARP trickery to fool the kernel into thinking the two physical interfaces are one by rewriting the MAC address on the fly. So the driver for the interface must support this, and many of them don't.

But that's not all the bonding driver can do. The mode option gives you seven choices, and you don't have to worry about interface compatibility. However you do need to consider what your switches support. The balance-rr, balance-xor and broadcast modes need switch ports grouped together. This goes by all sorts of different names, so look for "trunk grouping", "etherchannel", "port aggregation", or some such. 802.3ad requires 802.3ad support in the switch.