Skip to content
Search AlmaLinux

    Browse this documentation

    AlmaLinux 10: bond failover and the price of a loop

    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.

    Here eth1/eth2 each attach to a bridge holding only a dummy port (vmbr3/vmbr4), which keeps carrier up without any loop:

    Terminal window
    sudo nmcli device set eth1 managed no
    sudo nmcli device set eth2 managed no
    sudo ip link add bond0 type bond mode active-backup miimon 100
    sudo ip link set eth1 down && sudo ip link set eth2 down
    sudo ip link set eth1 master bond0
    sudo ip link set eth2 master bond0
    sudo ip link set eth1 up && sudo ip link set eth2 up
    sudo ip link set bond0 up
    cat /proc/net/bonding/bond0 | head -6
    Ethernet Channel Bonding Driver: v6.12.0-211.64.1.el10_2.x86_64
    Bonding Mode: fault-tolerance (active-backup)
    Currently Active Slave: eth1
    MII Status: up
    Terminal window
    sudo ip link set eth1 down
    sleep 3
    grep -E "Currently Active Slave|MII Status" /proc/net/bonding/bond0
    bond0: (slave eth1): link status definitely down, disabling slave
    bond0: (slave eth2): making interface the new active one
    Currently Active Slave: eth2
    MII Status: up

    After eth1 returns, no automatic failback occurs and eth2 stays active — default active-backup behaviour.

    AlmaLinux 10.2: Active Slave moved to eth2 after eth1 went down

    Terminal window
    sudo ip link add link bond0 name bond0.100 type vlan id 100
    ip -d link show bond0.100 | head -2
    bond0.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.

    Terminal window
    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 bond0
    sudo nmcli con add type ethernet con-name bond0-p2 ifname eth2 master bond0
    sudo nmcli con add type vlan con-name bond0.100 ifname bond0.100 dev bond0 id 100
    sudo nmcli con up bond0 && sudo nmcli con up bond0.100

    The test uses ip link to exclude NetworkManager interference; production must persist the configuration with nmcli or configuration management or it is lost on reboot.

    ModeSwitch action
    active-backupSame VLAN on both ports, no aggregation config
    802.3ad (LACP)LACP port group with matching rate/period
    balance-albUsually nothing

    VLAN: the switch port must be a trunk allowing the VLAN ID; an access port carries one VLAN.

    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):

    bond active-backup failover (AlmaLinux 10.2)
    文字版(命令与输出) / Text transcript
    # 1. create active-backup bond over two vNICs
    nmcli device set ens19 managed no; nmcli device set ens20 managed no
    ip link add bond0 type bond mode active-backup miimon 100
    ip link set ens19 master bond0; ip link set ens20 master bond0
    ip link set bond0 up
    # 2. active slave and MII status
    Bonding Mode: fault-tolerance (active-backup)
    Currently Active Slave: ens19
    MII Status: up
    # 3. failover: take the active link down
    ip link set ens19 down
    Currently Active Slave: ens20
    MII Status: up
    # 4. bring it back (no automatic failback)
    ip link set ens19 up
    Currently Active Slave: ens20
    Commands and output are real; the player loads on demand, so asciinema-player is not fetched until you click play.
    • Two ports on one bridge: loop and complete loss of connectivity (observed here);
    • NM reclaiming slaves: run nmcli device set ... managed no first;
    • 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”
    Terminal window
    sudo ip link add bond0 type bond mode active-backup miimon 100
    sudo ip link set eth1 master bond0 && sudo ip link set eth2 master bond0
    sudo ip link set bond0 up
    grep "Active Slave" /proc/net/bonding/bond0
    sudo ip link set eth1 down && sleep 3
    grep -E "Active Slave|MII Status" /proc/net/bonding/bond0
    sudo ip link add link bond0 name bond0.100 type vlan id 100
    ip -d link show bond0.100 | grep 802.1Q

    Checks:

    1. The active slave changes between the two reads
    2. MII Status remains up
    3. dmesg shows new active one
    4. 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.