bpi-cm5-network-iperf3-server.sh
Bash script that installs and starts iperf3 in server mode to measure network bandwidth.
This script uses the integrated Gigabit Ethernet port of the BPI-CM5. Connect the module to a network via an Ethernet cable. The script installs iperf3 if missing and runs it in the background. To test throughput, run an iperf3 client on another machine with 'iperf3 -c <CM5_IP>'. The Amlogic A311D2 SoC natively supports Gigabit Ethernet.
bpi-cm5-network-iperf3-server.sh
#!/bin/bash
# BPI-CM5 Network Throughput Test Server
# Usage : ./network_test.sh
# Installation d'iperf3 si absent
if ! command -v iperf3 &> /dev/null
then
echo "Installation d'iperf3..."
sudo apt update
sudo apt install -y iperf3
fi
# Lancement du serveur iperf3 en arrière-plan
# -s : mode serveur
# -p 5201 : port par défaut
# -D : daemon (arrière-plan)
# -f g : format en Gbit/s
echo "Démarrage du serveur iperf3 en arrière-plan..."
iperf3 -s -p 5201 -D -f g
# Vérification du processus
if pgrep -x "iperf3" > /dev/null
then
echo "Serveur iperf3 actif sur le port 5201."
echo "Pour arrêter : pkill iperf3"
else
echo "Échec du démarrage du serveur."
fi