How to create LACP 802.3ad bond using systemd-networkd

Edit: the method below works but there is a KISS solution in testing thanks to @hakayova1 and @jonathon that possible solution can be found in @hakayova1 's post
If you are able to deploy the testing solution successfully please post to this thread to let the community know. Check out @jonathon’s post below
link
You can install a gnome package and use a GUI to create the bond, tested on kubuntu but should work on manjaro too. Search for the tool in the post. In kubuntu the tool was part of a bigger package. Then you run the command to start the GUI and create the bond. I hope this helps! I still use manjaro, just not as much as I did.

I would not wish what I just went through on my worst enemy :slight_smile:

Terrible and/or incomplete documentation found everywhere. Even stuff for RHEL was mostly out of date and doesn’t work on arch anyway. Archwiki points to documentation from 2005. Manjaro is relatively new and there was nothing here either. Now there is!

About me:
Experience level with linux? about 6 months. Manjaro, two weeks. Classification = N00b
Windows sysadmin for 20 years. (and glad to be leaving it for new frontiers)

Following is a step by step on how I (finally) successfully created a bond with the LACP IEEE802.3ad protocol, not using the default round robin.

My system

Manjaro KDE stable branch 4.4.38-1
Hardware asus M5A99FX pro R2.0 AMD3+ 990FX mobo
32GB RAM
AMD FX-8350 8-core Black Edition
EVGA GeForce GTX 970 4GB
nvidia graphics.

my managed switch
TL-SG3216

my dual network card
Intel PRO/1000 PT Dual-Port-Server-Adapter

Reason for creating a LAG on a desktop? >> I have a FreeNAS box and I make many file transfers and backups regularly so I wish to maximize my throughput and also have a failover in place.

resource links
AUR e1000e for the driver
systemd-networkd (comes installed)
I installed ifenslave from core (I admit I am not sure if I needed it if not using netctl)
man systemd.netdev
man systemd.network
tons of documentation (including above) leads you to Linux Ethernet Bonding kernel documentation. Which is grossly outdated (2005 or at best edited 2011) where bonding is concerned. It has some general information, but any how-to is purely historical.
Also a word of caution; using netctl or NetworkManger did not work. But in all fairness, there were some things I was doing wrong in my network files. Still NetworkManger seemed to prolong boot times even running just one NIC let alone two.

I started here but I warn you nothing on this page was of much help in my situation. Also note this is using netctl.
https://wiki.archlinux.org/index.php/Netctl#Bonding

I followed tips here, although I did not need VLANs or to enable systemd-resolved. This tutorial is for a server in the cloud and so you have to modify it to run in your office / home environs.
https://major.io/2015/08/21/using-systemd-networkd-with-bonding-on-rackspaces-onmetal-servers/

I also followed steps here, although this on its own did not get me up and running. Helpful, but vague.
https://www.reversengineered.com/2014/08/21/setting-up-bonding-in-systemd/

Make sure to disable both NetworkManager and netctl before you enable systemd-networkd
You might need to mv to a dummy directory current config files in /etc/systemd/network and/or /usr/lib/systemd/network and /run/systemd/network

Warning: If you do the following you will loose your internet connection, so either have a laptop handy or just make sure to do this step before you enable networkd

systemctl stop NetworkManager
systemctl disable NetworkManager
systemctl stop netctl
systemctl disable netctl

Do not start or enable systemd-networkd until you have followed the next steps

cd /etc/systemd/network

create the following using sudo nano

/etc/systemd/network/bond1.netdev

[NetDev]
Name=bond1
Kind=bond

[Bond]
Mode=802.3ad
MIIMonitorSec=1s
LACPTransmitRate=fast
UpDelaySec=2s
DownDelaySec=8s

note that if you name this bond0 you will run into a conflict with a hidden bond0 that defaults to round robin no matter what you set in this file link. bond1 is named that for a reason. :slight_smile:

/etc/systemd/network/bond1.network

[Match]
Name=bond1

[Network]
BindCarrier=enp1s0f0 enp1s0f1

You will need to find out what to put in for BindCarrier= discover what the interfaces are calling themselves on your system to put them in the .network file
use ip link or ifconfig to discover their names

/etc/systemd/network/enp1s0f0.network

[Match]
Name=enp1s0f0

[Network]
Bond=bond1

make sure that Name= the first of your two (or more) interfaces from BindCarrier=
now do the same for your second (and 3-8 if your a real coolio with that many physical NICs)

/etc/systemd/network/enp1s0f1.network

[Match]
Name=enp1s0f1

[Network]
Bond=bond1

/etc/systemd/network/Management.network

[Match]
Name=bond1

[Network]
DHCP=yes
UseDNS=true
Address=10.101.1.25/24
Gateway=10.101.1.1
DNS=8.8.8.8

this will of course vary with your network and you might have to figure out what set up you have. Log into the router that handles your DHCP to find out the info is one way. Google is your friend here. (I might change my DNS in near future to openDNS)

#If you are viewing this you probably already know this, but it is worth mentioning. IEEE802.3ad LACP requires you to have a managed switch and configuring your switch is beyond the scope of this article. If you do not have a managed switch, you want to look into round robin.

Okay, “Hold onto your butts” :grin:

systemctl enable systemd-networkd
sytemctl start systemd-networkd

Now go ahead and save anything you have running and reboot
sudo reboot

to see if the service is up and acting as it should

cat /proc/net/bonding/bond1

hopefully you will see

Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2 (0)
MII Status: up
MII Polling Interval (ms): 1000
Up Delay (ms): 2000
Down Delay (ms): 8000

802.3ad info
LACP rate: fast
Min links: 0
Aggregator selection policy (ad_select): stable

Slave Interface: enp1s0f1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: (redacted)
Slave queue ID: 0
Aggregator ID: 1
Actor Churn State: none
Partner Churn State: none
Actor Churned Count: 0
Partner Churned Count: 0

Slave Interface: enp1s0f0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: (redacted)
Slave queue ID: 0
Aggregator ID: 1
Actor Churn State: none
Partner Churn State: none
Actor Churned Count: 0
Partner Churned Count: 0

I did not specify for 802.3ad to use layer2 for transmit hash policy, it just used it. Which is good, cause that is what my flavor of switch uses. Depending on your managed switch this could be Layer 3+4.
Yes, I redacted my HW addr for this public article. You will however see your MAC displayed.

#Troubleshoot
In my case after using netctl and NetworkManager this took hours of testing and research. The above just worked, and like most. I like it when things work. However if it didn’t, here are some things that could help from my experience.

Disable other services that have to do with networks like systemctl disable NetworkManager-wait-online.service

when I disabled this my boot time was cut from 3 minutes to about 30 seconds

You may need to mv or rm /etc/modprobe.d/bonding.conf if it causes a conflict

I hope this helps. It was a long couple days for me. The documentation certainly is lacking and extremely out of date. Watch out for references to init.d and using sysconfig or sysfs those will not work on modern linux distros like manjaro. I can hear the grumbling, yes maybe they work fine. I am only relaying what did work for me.

Please refrain from bashing systemd, I am new to linux and am just plain tired of reading about the downfall of init.d I am sure that systemd was chosen for a reason… of course it has bugs so does everything. I could tell you about how much better DOS was from windows 10… but I won’t. lol

If you notice anything I missed or if I perhaps did something horribly incorrect then please let me know. Help me to help others and pass it along.

7 Likes

I just used this to set up on a new install of ManjaroKDE.
Notes:
You should install e1000e-dkms from AUR , (if you have the same NIC card as I do, otherwise find your hardware(s) driver and install dkms) this will ensure (in theory) that your NIC driver(s) do not get screwy during a kernel update.
To install dkms you need to look for dkms in the AUR.
You then need linux-headers use uname -a to see what kernel you are running. Look up your kernel headers in AUR and install them. Then install your NIC(s) dkms driver versions… hopefully a member of our Linux community has been so kind as to build them. :slight_smile:
other stuff from my original tutorial.
netctl is not installed by default on your system, so you do not need to disable it or stop it (cause, unless you installed it. It doesn’t exist)
I did not have to move or remove files in directories mentioned. They didn’t interfere with the bond.
I did not have to rm /etc/modprobe.d/bonding.conf I think that was only there from when I was trying to do this using netctl.
Bonding will fail until you reboot FYI
Setting DNS from 8.8.8.8 to openDNS works fine.

3 posts were split to a new topic: LACP 802.3ad bond has “extra” IP addresses

Seeing as this thread was bumped, I take it that Network Manager’s 802.3ad “virtual bond” setup won’t do the job?

@jonathon I hope I am not guilty of failing to adhere to KISS … :wink: A year ago I was either to new to manjaro and didn’t know the GUI option existed or at that time it did not exist. I googled the heck out of this one and could not find any articles that mentioned the GUI solution at the time. I am unable to confirm or deny if I did try the GUI back then and found it not to work. It seems logical that I would have tried it first, given how many years I used winblows and thus had used GUI for 95% of my systems management.

If someone if able to use the GUI to create a bond that reads this article please do us a favour and let us know! I can’t do in in a VM and the bond is on my main machine used for work. Thanks

I will try this soon. When I first read your tutorial, about a week ago, I did check the Network Manager’s GUI and did not see a Bond tab there as displayed above. I suspect that this must be a very recent implementation.

1 Like

This is how my Network Manager looks. The tabs and wording are different, and I don’t have a Bond tab.

1 Like

I can get @jonathon’s dialog by issuing the command below:

$ nm-connection-editor

Having already applied @ben2ben’s settings in his tutorial above, bond1 readily shows in the list of available connections with appropriate settings. Therefore, it does work as a GUI for this purpose. Detailed instructions can be found here. Defining the bond as bond0 results in a non-functional bond as indicated above; however naming it as bond1 is enough to make it work.
After setting the bond via this tool, I stopped systemd-networkd.service via systemctl, disabled it and re-enabled and started NetworkManager. The bond is functional right now. However, I didn’t reboot the system yet to see if it will survive that test due to an ongoing file operation.

@hakayova1 Thanks so much for the link and update on this issue. Like yourself, I do not see a bond tab in the settings GUI. I will try your method, hopefully soon. I have a lot on my plate the next couple weeks. If a more KISS solution in GUI is viable, I will edit the post above to reflect that the GUI solution is available after issuing the command nm-connection-editor.

Cheers

You have to click the + icon and add a new Bond connection (rather than edit an existing Ethernet connection).

1 Like

I am sorry if I made it look like I was trying to modify an existing connection. I was trying to add a bond since the beginning. However, clicking the + icon does not give me the option to add a bond in regular Network Manager window, at least in my case. The available options are different, and I cannot list them now, since I am at work. Only the nm-connection-editor allows me to add a bond.

1 Like

I’ve seen similar under GNOME where options don’t exist in gnome-settings but are available with nm-connection-editor.

1 Like

@jonathon hey thanks. I just spun up a new machine and wow was bonding easier. The KDE desktop doesn’t offer a + for adding a bond but after installing nm-connection-editor the gnome based GUI made things quite easy. I should mention that I just had success with this on kubuntu. I have not tried it on manjaro. I still run manjaro on my desktop but for my workstation I had to switch because of update fatigue. I suspect that this method should work on manjaro as well. Perhaps yaourt nm-connection-editor should get you there. In the ubuntu repo the package was network-manager-gnome so you might search for that… Best of luck all. Perhaps someone will use the cli method outlined in this post… it is a great learning experience. Although not very KISS. lol :wink:

1 Like

Forum kindly sponsored by