Ubuntu setup a bonding device and enslave two real Ethernet devices

To set up a bonding device and enslave two real Ethernet devices on Ubuntu, you need to follow these steps:

  1. Install the necessary packages:
sudo apt-get update
sudo apt-get install ifenslave
  1. Load the bonding module:
sudo modprobe bonding
  1. Create a bond interface file at /etc/network/interfaces:
# Bond interface
auto bond0
iface bond0 inet static
address <IP address>
netmask <netmask>
gateway <gateway>
bond-mode balance-rr
bond-slaves eth0 eth1

Here, <IP address>, <netmask>, and <gateway> should be replaced with your network’s IP address, netmask, and gateway respectively. The bond-mode is set to balance-rr, which uses a round-robin algorithm for load balancing.

  1. Restart the networking service:
sudo /etc/init.d/networking restart
  1. Verify the bonding status:
cat /proc/net/bonding/bond0

This should show the bonding status, including the bond mode, active slave, and number of RX/TX packets transmitted through each slave.

Note: These steps are for Ubuntu 16.04 LTS and later. The exact steps may differ on other Ubuntu versions.

Leave a Comment