linux-network-bonding-2.5gbe.sh

BIOSTAR EdgeComp MS-U320: Fanless Intel Wildcat Lake Industrial Mini PC · File : linux-network-bonding-2.5gbe.sh · Language : bash · Use case : Configurer le bonding réseau pour agréger les deux ports Ethernet 2.5GbE pour la redondance.

Aggregates the two 2.5GbE Ethernet ports in active-backup mode for high availability.

Uses native Linux iproute2 tools. Intel I226-V and I226-LM controllers must be detected. Replace 'enp1s0' and 'enp2s0' with actual interface names obtained via 'ip a'. Active-backup mode ensures automatic failover if a cable is unplugged.

linux-network-bonding-2.5gbe.sh

#!/bin/bash
# Installer les outils si nécessaire
# sudo apt install ifenslave ethtool

# Créer l'interface bond0
sudo ip link add bond0 type bond

# Configurer le mode (1 = active-backup pour redondance)
sudo ip link set bond0 type bond mode active-backup

# Ajouter les interfaces physiques (vérifiez les noms avec 'ip a')
# Intel I226-V et I226-LM apparaissent souvent comme enp1s0 et enp2s0
sudo ip link set enp1s0 down
sudo ip link set enp2s0 down
sudo ip link set enp1s0 master bond0
sudo ip link set enp2s0 master bond0

# Activer le bond
sudo ip link set bond0 up

# Configurer l'IP
sudo ip addr add 192.168.1.10/24 dev bond0

echo "Bonding configuré. Vérifiez avec 'cat /proc/net/bonding/bond0'"

← Back to the board