Linux has a bonding driver that provides a method for aggregating multiple network interfaces into a single logical interface. Behavior of bonded interfaces depends on selected bonding mode.
For more details on the supported modes please check Documentation/networking/bonding.txt in Linux's kernel sources.
First you will need to load the bonding kernel module. You'll need to specify at least the mode you want the bonding to be created in.
modprobe bonding mode=balance-alb miimon=100
After that you need to set some IP address to the new bonding interface and bring is up
ip addr add 10.1.1.2/16 dev bond0 ip link set bond0 up
And the last step is to add the network interfaces to the new virtual bonding interface.
ip link set eth0 master bond0 ip link set eth1 master bond0
echo balance-alb > /sys/class/net/bond0/bonding/mode ip addr add 10.1.1.2/16 dev bond0 ip link set bond0 up echo 100 > /sys/class/net/bond0/bonding/miimon echo +eth0 > /sys/class/net/bond0/bonding/slaves echo +eth1 > /sys/class/net/bond0/bonding/slaves
xmit_hash_policy option sets the balancing algorithm used.
The default value is layer2.
libteam provides an alternative to bonding driver. The main difference is that Team driver kernel part contains only essential code and the rest of the code (link validation, LACP implementation, decision making, etc.) is run in userspace as a part of teamd daemon.
More information can be found at: libteam.org
* Originally written by User lamerix