DEV Community

Cover image for Solved: change /etc/network/interfaces bond mode followed by systemctl restart networking not suffucient? Reboot is.
Darian Vance
Darian Vance

Posted on • Originally published at wp.me

Solved: change /etc/network/interfaces bond mode followed by systemctl restart networking not suffucient? Reboot is.

🚀 Executive Summary

TL;DR: Changing a Linux network bond’s mode via systemctl restart networking is often insufficient because the kernel’s bonding driver retains its initial configuration. To apply bond mode changes live without a full system reboot, directly update the kernel’s bonding parameters through sysfs or by bouncing the specific bond interface.

🎯 Key Takeaways

  • The systemctl restart networking command only affects user-space scripts and does not instruct the Linux kernel’s loaded bonding driver to change its fundamental mode.
  • The most professional and least disruptive method for live bond mode changes is to write the new mode directly to /sys/class/net/bondX/bonding/mode via sysfs.
  • Regardless of the live application method, the /etc/network/interfaces file must always be updated to ensure bond mode changes persist across reboots.

Changing a network bond’s mode should be simple, but the Linux kernel often holds onto old configurations. Learn why a networking service restart isn’t enough and how to apply bond changes live without a full server reboot.

That Awful Moment: When “systemctl restart networking” Isn’t Enough

I remember it like it was yesterday. 2 AM, a tight maintenance window for our primary database cluster, prod-db-01. The task seemed simple: change the bond mode from active-backup (mode 1) to LACP (mode 4) for better throughput. I confidently edited /etc/network/interfaces, ran systemctl restart networking, and… nothing. The bond was stubbornly stuck in its old mode. My change window was closing, and the thought of telling my manager we needed to reboot a critical production database for a ‘simple’ network tweak sent a cold shiver down my spine. We’ve all been there, staring at a terminal, wondering why the simple things are suddenly so hard.

So, What’s Actually Going On Here?

This is a classic case of the disconnect between user-space services and the Linux kernel. When you run systemctl restart networking (or /etc/init.d/networking restart on older systems), you’re just re-running the scripts that read config files and manage interfaces. You are not telling the kernel’s bonding driver—which is already loaded and running with its initial parameters—to change its fundamental behavior. The kernel module is holding onto that old state for dear life.

A reboot works because it’s the ultimate reset. On startup, the kernel loads the bonding driver from scratch and configures it using the parameters it finds in your config file. But you don’t need to go that far.

The Fixes: From a Tap to a Sledgehammer

Here are three ways to solve this, ranging from a quick tap to the big red button.

Solution 1: The “Quick & Dirty” Interface Bounce

This is the most common approach. Instead of restarting the entire networking service, you just target the specific bond interface. You force it to tear itself down and then bring it back up, which makes it re-read its configuration from /etc/network/interfaces during the ‘up’ phase.

Be warned: This will cause a brief network interruption on that interface, usually just a few seconds, but that could be enough to disrupt a sensitive application. Use with caution on production systems.

# First, make sure your /etc/network/interfaces file has the new mode
# For example, changing to LACP (802.3ad)
# bond-mode 4

# Then, bounce the interface
ifdown bond0
ifup bond0
Enter fullscreen mode Exit fullscreen mode

Pro Tip: Always run these commands from a console session (like an iDRAC, iLO, or VM console), not an SSH session. If ifup bond0 fails for some reason, you’ll be locked out of your own server. Don’t ask me how I know.

Solution 2: The “Surgical Strike” via Sysfs

This is my preferred method for live changes. It’s the most professional and causes the least disruption. Instead of tearing anything down, we’re going to talk directly to the kernel driver through its filesystem interface (sysfs) and tell it to change the parameter on the fly.

This changes the running configuration but does not make it permanent. You MUST also update /etc/network/interfaces so the change persists after the next reboot.

# To change a live bond (bond0) to LACP (mode 4)
echo 4 > /sys/class/net/bond0/bonding/mode
Enter fullscreen mode Exit fullscreen mode

You can verify the change immediately:

cat /proc/net/bonding/bond0
Enter fullscreen mode Exit fullscreen mode

You’ll see the “Bonding Mode” line reflect the new setting. It’s clean, instant, and usually has no noticeable packet loss.

Here’s a quick reference for the bonding modes:

Mode Number Mode Name Common Use Case
0 balance-rr Round-robin. Simple load balancing.
1 active-backup Failover. Only one slave is active.
4 802.3ad (LACP) Dynamic Link Aggregation. Requires switch support.
6 balance-alb Adaptive Load Balancing. Doesn’t require switch support.

Solution 3: The “Big Red Button” (The Reboot)

Let’s be honest. Sometimes, you just need it to work, no questions asked. The reboot is the ultimate “turn it off and on again.” It’s guaranteed to apply your changes from /etc/network/interfaces because the entire system state is wiped clean and rebuilt from config files on disk.

I call this the “Planned Maintenance” option. If you’re already in a scheduled downtime window and can’t afford any surprises from a finicky live change, a clean reboot is often the safest, albeit loudest, choice. There’s no shame in it when reliability is your top priority.

Just make sure your changes are saved correctly first!


Darian Vance

👉 Read the original article on TechResolve.blog


☕ Support my work

If this article helped you, you can buy me a coffee:

👉 https://buymeacoffee.com/darianvance

Top comments (0)