AlmaLinux 10: bond failover and the price of a loop
Test scope
Section titled “Test scope”In an AlmaLinux 10.2 VM (kernel 6.12.0-211.64.1.el10_2): three virtio NICs (eth0 management, eth1/eth2 on two isolated bridges), an active-backup bond via ip link, failover verified through /proc, and an 802.1Q VLAN on the bond. Log: plans/content-expansion/evidence/logs/alma-bonding-vlan.log.
No real switch: LACP and trunk configuration were not tested.
The price first: two ports on one bridge loop
Section titled “The price first: two ports on one bridge loop”The first attempt attached eth1 and eth2 to the same vmbr2 before bonding — the VM became unreachable immediately. Both NICs sat in one L2 domain, so the bond’s broadcasts left one port and returned through the other, creating a loop and a broadcast storm.
Bond ports must live in different L2 domains (separate bridges, separate switches, or an LACP port group on one switch). This is not theory; it takes the host off the network.
The correct setup: two isolated bridges
Section titled “The correct setup: two isolated bridges”Here eth1/eth2 each attach to a bridge holding only a dummy port (vmbr3/vmbr4), which keeps carrier up without any loop:
sudo nmcli device set eth1 managed nosudo nmcli device set eth2 managed nosudo ip link add bond0 type bond mode active-backup miimon 100sudo ip link set eth1 down && sudo ip link set eth2 downsudo ip link set eth1 master bond0sudo ip link set eth2 master bond0sudo ip link set eth1 up && sudo ip link set eth2 upsudo ip link set bond0 upcat /proc/net/bonding/bond0 | head -6Ethernet Channel Bonding Driver: v6.12.0-211.64.1.el10_2.x86_64Bonding Mode: fault-tolerance (active-backup)Currently Active Slave: eth1MII Status: upMeasured failover
Section titled “Measured failover”sudo ip link set eth1 downsleep 3grep -E "Currently Active Slave|MII Status" /proc/net/bonding/bond0bond0: (slave eth1): link status definitely down, disabling slavebond0: (slave eth2): making interface the new active oneCurrently Active Slave: eth2MII Status: upAfter eth1 returns, no automatic failback occurs and eth2 stays active — default active-backup behaviour.

Tag 802.1Q on the bond
Section titled “Tag 802.1Q on the bond”sudo ip link add link bond0 name bond0.100 type vlan id 100ip -d link show bond0.100 | head -2bond0.100@bond0: <BROADCAST,MULTICAST> ... state DOWN ... vlan protocol 802.1Q id 100 <REORDER_HDR>The interface starts DOWN; ip link set bond0.100 up is required before traffic flows.
Persistent nmcli configuration
Section titled “Persistent nmcli configuration”sudo nmcli con add type bond con-name bond0 ifname bond0 bond.options "mode=active-backup,miimon=100"sudo nmcli con add type ethernet con-name bond0-p1 ifname eth1 master bond0sudo nmcli con add type ethernet con-name bond0-p2 ifname eth2 master bond0sudo nmcli con add type vlan con-name bond0.100 ifname bond0.100 dev bond0 id 100sudo nmcli con up bond0 && sudo nmcli con up bond0.100The test uses ip link to exclude NetworkManager interference; production must persist the configuration with nmcli or configuration management or it is lost on reboot.
Switch side
Section titled “Switch side”| Mode | Switch action |
|---|---|
| active-backup | Same VLAN on both ports, no aggregation config |
| 802.3ad (LACP) | LACP port group with matching rate/period |
| balance-alb | Usually nothing |
VLAN: the switch port must be a trunk allowing the VLAN ID; an access port carries one VLAN.
Playable failover recording
Section titled “Playable failover recording”The recording below comes from the AlmaLinux 10.2 VM and shows the full order of events — build the bond, read the active slave, take a link down, switch, bring it back (the .cast is 827 bytes and never autoplays):
文字版(命令与输出) / Text transcript
# 1. create active-backup bond over two vNICsnmcli device set ens19 managed no; nmcli device set ens20 managed noip link add bond0 type bond mode active-backup miimon 100ip link set ens19 master bond0; ip link set ens20 master bond0ip link set bond0 up
# 2. active slave and MII statusBonding Mode: fault-tolerance (active-backup)Currently Active Slave: ens19MII Status: up
# 3. failover: take the active link downip link set ens19 downCurrently Active Slave: ens20MII Status: up
# 4. bring it back (no automatic failback)ip link set ens19 upCurrently Active Slave: ens20Common traps
Section titled “Common traps”- Two ports on one bridge: loop and complete loss of connectivity (observed here);
- NM reclaiming slaves: run
nmcli device set ... managed nofirst; - VLAN not brought up: the interface exists but carries nothing;
- One-sided LACP: the link never comes up.
Practice: failover, VLAN, and optionally reproduce the loop
Section titled “Practice: failover, VLAN, and optionally reproduce the loop”sudo ip link add bond0 type bond mode active-backup miimon 100sudo ip link set eth1 master bond0 && sudo ip link set eth2 master bond0sudo ip link set bond0 upgrep "Active Slave" /proc/net/bonding/bond0sudo ip link set eth1 down && sleep 3grep -E "Active Slave|MII Status" /proc/net/bonding/bond0sudo ip link add link bond0 name bond0.100 type vlan id 100ip -d link show bond0.100 | grep 802.1QChecks:
- The active slave changes between the two reads
MII Statusremains updmesgshowsnew active one- The VLAN interface reports
802.1Q id 100
常见问题
Why does bonding two ports on one bridge kill connectivity?
Both NICs share one L2 domain, so the bond broadcasts loop between the ports, creating a broadcast storm and MAC flapping; the host drops off the network.
Does active-backup need switch configuration?
No, only both ports in the same VLAN; use 802.3ad with LACP when you need aggregated bandwidth.
Is bond testing in a VM meaningful?
Yes. virtio NICs have real carrier and the kernel bonding driver behaves as on bare metal; the only missing piece is a peer switch, so LACP cannot be validated.
Next steps
Section titled “Next steps”- Network triage: Five layers of network troubleshooting
- Static IP: nmcli static IP
- Firewall: firewalld rich rules