CentOS 7 LACP Network Bonding← Back
I wanted to enable LACP bonding on my HP MicroServer Gen8. This configuration allows load balancing and fault tolerance. When transferring data to the server it will only be received via 1 NIC meaning a 1Gbps limit per connection, but 2 connections can transfer at 1Gbps each. When receiving data it will load balance over both NICs meaning you can achieve up to 2Gbps on a single connection. This post will also work on RHEL 7.
NB: While making these changes you will need to be logged into the server from either the console or ILO as the network connection WILL go down.
- Disable NetworkManager
systemctl stop NetworkManager systemctl disable NetworkManager yum erase NetworkManager*
- Take note of the names of your NICs and their MAC addresses
ip linkIn my case they are called eno1 and eno2 so you will need to substitute your own values accordingly in the following steps.
- Setup your switch ports as an LACP trunk. You'll need to consult your documentation on how to do that.
- Edit /etc/modprobe.d/bond.conf
alias bond0 bonding options bond0 miimon=100 mode=4 lacp_rate=1
- Edit /etc/sysconfig/network-scripts/ifcfg-eno1
DEVICE=eno1 NM_CONTROLLED=no BOOTPROTO=none NAME=eno1 ONBOOT=yes SLAVE=yes MASTER=bond0
- Edit /etc/sysconfig/network-scripts/ifcfg-eno2
DEVICE=eno2 NM_CONTROLLED=no BOOTPROTO=none NAME=eno2 ONBOOT=yes SLAVE=yes MASTER=bond0
- Edit /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0 NAME=bond0 IPADDR=10.1.1.5 NETMASK=255.255.255.0 GATEWAY=10.1.1.1 DNS1=10.1.1.1 DNS2=10.1.1.2 #IPV6INIT=yes ONBOOT=yes USERCTL=no
- Restart your server so that the bonding module is loaded with the correct options during boot.
- Check that the bond0 interface is up
mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eno1: mtu 1500 qdisc mq master bond0 state UP qlen 1000 link/ether a0:1d:48:c7:12:64 brd ff:ff:ff:ff:ff:ff 3: eno2: mtu 1500 qdisc mq master bond0 state UP qlen 1000 link/ether a0:1d:48:c7:12:64 brd ff:ff:ff:ff:ff:ff 4: bond0: mtu 1500 qdisc noqueue state UP link/ether a0:1d:48:c7:12:64 brd ff:ff:ff:ff:ff:ff inet 10.1.1.5/24 brd 10.1.1.255 scope global bond0 valid_lft forever preferred_lft forever inet6 fe80::a21d:48ff:fec7:1264/64 scope link valid_lft forever preferred_lft forever
- View the status of your bonded interfaces
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011) Bonding Mode: IEEE 802.3ad Dynamic link aggregation Transmit Hash Policy: layer2 (0) MII Status: up MII Polling Interval (ms): 100 Up Delay (ms): 0 Down Delay (ms): 0 802.3ad info LACP rate: fast Min links: 0 Aggregator selection policy (ad_select): stable Active Aggregator Info: Aggregator ID: 1 Number of ports: 2 Actor Key: 17 Partner Key: 10 Partner Mac Address: 88:51:fb:8d:3b:30 Slave Interface: eno1 MII Status: up Speed: 1000 Mbps Duplex: full Link Failure Count: 0 Permanent HW addr: a0:1d:48:c7:12:64 Aggregator ID: 1 Slave queue ID: 0 Slave Interface: eno2 MII Status: up Speed: 1000 Mbps Duplex: full Link Failure Count: 0 Permanent HW addr: a0:1d:48:c7:12:65 Aggregator ID: 1 Slave queue ID: 0