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 link
In 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
ip addr
1: lo:
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
cat /proc/net/bonding/bond0
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
Comments
Alex
2016-07-28
Worked just fine on CentOS 7 x64.
Thanks for the tutorial.
Martin
2016-03-22
@Mzcktyler
You have to add LAG on sg200, assign ports to the LAG (ie. LAG 2 KVM-01-VIRT Enabled Link Up GE1, GE2, GE3 )
Tekops
2015-08-01
If you are using OEL 7/7.1 it is much easier and faster to use nmtui. Make sure your interfaces are all configured, then your switch has all the ports in the same etherchannel group, then in nmtui create a new "bond0" interface and add the ethernet ports, set the static IP, gateway, DNS, search, etc. Once you save it; it activates and immediately begins working. I recommend doing this from the console or a port that is not in the "bond".
-David
Shib
2015-03-27
I'm getting a different "Aggregator ID" for the 2nd interface. What could be the reason? And how to fix that?
Mzcktyler
2015-01-29
Hi, it doesn't work on my centos 7, my cisco sg200 shows link down and I can't ping address on my network..
I also tried with team0 config type, same issue
Any idear ?
Thanks