In the process of upgrading Ethernet to 10Gbps speed connectivity in the local network, you might face some limitations due to the available PCI slots on your machine that only support up to 2.5Gbps Ethernet. In this article, we will discuss how to bond two Realtek R8152 2.5Gbps Ethernet adapters using Link Aggregation Control Protocol (LACP) on a Linux system to achieve a network speed boost.
Understanding Link Aggregation Control Protocol (LACP)
LACP, defined in IEEE 802.3ad, is a protocol that allows you to combine multiple Ethernet ports into a single logical link, enabling higher bandwidth, load balancing, and redundancy. It is a standard protocol that allows for automatic negotiation between switches and network devices, so no manual configuration is needed on the switch side in most cases.
Requirements
- Two Realtek R8152 Ethernet adapters
- A Linux system with kernel version 3.9 or later
- Ethernet cables
Configuration
To bond the two Realtek R8152 adapters, follow these steps:
Installing the Required Packages
First, you need to install the required packages for managing network interfaces on your Linux system. For Ubuntu-based distributions, you can use the following command:
sudo apt-get install ifenslave ethtool
Enabling and Configuring the Adapters
Let's assume the two Realtek R8152 adapters are named eth1 and eth2. You can enable and configure them by editing the /etc/network/interfaces file. Here's what you should add:
auto eth1
iface eth1 inet manual
up ifconfig eth1 up
down ifconfig eth1 down
auto eth2
iface eth2 inet manual
up ifconfig eth2 up
down ifconfig eth2 down
Bonding the Adapters
Now you need to create a new bonding interface called bond0. Edit the /etc/network/interfaces file again, and add the following:
auto bond0
iface bond0 inet manual
slaves eth1 eth2
bond_mode balance-rr
bond_miimon 100
bond_downdelay 200
bond_updelay 200
This configuration sets the bonding mode to balance-rr (round-robin), which is suitable for a two-port setup. The bond_miimon value sets the minimum link monitoring interval in milliseconds. The bond_downdelay and bond_updelay parameters specify how long to wait for the link state to change before marking the interface as up or down.
Enabling the Bonding Interface
Enable and configure the bonding interface by restarting the network service:
sudo systemctl restart networking
Testing the Setup
Use the following command to check the status of the bonding interface:
cat /proc/net/bonding/bond0