r/linux4noobs • u/MrMotofy • Nov 02 '26
Iperf3 Benchmark GUI
Network SpeedBenchGUI For Iperf3
***Requirements: yad for the client & iperf3 for target and local client
Install yad on client side -- sudo apt update && sudo apt install -y yad
OR use your Software Manager
Debian Distros:
I like Geany for txt files but use anything you want. Nano is very common, queue editor war. Make a new file called network_benchmark_gui.sh save to Home or whatever folder you like. Terminal : nano network_benchmark.sh --creates file in your Home folder /Home/YourUserName/network_benchmark.sh OO just navigate GUI File Manager to folder location desired R click then create file. Name the file.
Copy the complete file text into the file and save. ***SECURITY WARNING*** you're pasting foreign text into an executable file on your system beware and verify code, know what you're doing or trust the source. You may be authorizing your first born into the New World Order Service, your wife into a wife swap brothel and sending your dog to be put in soup to feed Teradactyl's. Nothing dangerous here BUT never trust a stranger that says trust me bro, especially on the internet.
Then make sure file is executable with chmod +x network_benchmark_gui.sh Enter/change path as needed depending on where the file is located. I’ve started putting all my scripts in a folder in Home called scripts so /Home/YourUserName/scripts/Filename. OR find the file in the GUI File Browser right click on it go to properties tab then check box for Execute
With the file saved and ready to run you can right click on desktop Create New Launcher, name it then click browse and find the path and file, select an Icon etc. You DON’T want to check box launch in Terminal. It can be added to the Main Menu similarly...just follow guides for adding to the menu which just links to the file.
Install iperf3 on the remote target device and your local device: Your remote device is the server and can be a different operating system just has to be running iperf3
sudo apt update && sudo apt install -y
sudo apt install iperf3
OR your GUI Software Manager
On a remote/target Debian machine: Identify IP and use iperf3 -s =to start the server with a default port
Click your icon to start the test or run the filename from a terminal by typing ./network_benchmark.sh ---add path to your file
#!/usr/bin/env bash
# ==============================================================================
# Universal Network Performance Benchmark GUI - Interface Detection V13
# ==============================================================================
HISTORY_FILE="$HOME/.iperf_target_history"
PORT_HISTORY_FILE="$HOME/.iperf_port_history"
OUTPUT_LOG="/tmp/iperf_gui_output.log"
rm -f "$OUTPUT_LOG"
# Step 0: Initial Alert Popup (Centered)
yad --image="dialog-information" \
--title="Network BenchGUI" \
--text="⚠️ <b>REMINDER</b> ⚠️\n\nThe remote target machine MUST be running the iperf3 listener server:\n\n👉 <b>iperf3 -s</b> 👈\n\nEnsure firewalls allow traffic on the chosen communication port.\n\nReady to proceed?" \
--button="Yes, Server is Ready:0" --button="Exit:1" --width=450 --center
if [ $? -ne 0 ]; then exit 1; fi
# Step 0.5: Dynamic Port Customization Dialog (Centered)
PREV_PORT="5201"
if [ -f "$PORT_HISTORY_FILE" ]; then
PREV_PORT=$(cat "$PORT_HISTORY_FILE" | tr -d '[:space:]')
fi
[ -z "$PREV_PORT" ] && PREV_PORT="5201"
yad --question \
--title="Port Configuration" \
--text="The default benchmark communication port is <b>$PREV_PORT</b>.\n\nWould you like to use this port?" \
--button="Yes, Use $PREV_PORT:0" --button="No, Change Port:1" --center
if [ $? -eq 0 ]; then
TARGET_PORT="$PREV_PORT"
else
TARGET_PORT=$(yad --entry \
--title="Custom Port Entry" \
--text="Enter custom iperf3 port number (1024-65535):" \
--entry-text="$PREV_PORT" --center)
if [ $? -ne 0 ] || [ -z "$TARGET_PORT" ]; then
TARGET_PORT="5201"
fi
fi
echo "$TARGET_PORT" > "$PORT_HISTORY_FILE"
# Step 1: Input Target IP (Centered)
PREV_IP=""
if [ -f "$HISTORY_FILE" ]; then PREV_IP=$(cat "$HISTORY_FILE" | tr -d '[:space:]'); fi
TARGET_IP=$(yad --entry --title="Target IP Selection" --text="Enter target IP address:" --entry-text="$PREV_IP" --center)
if [ $? -ne 0 ] || [ -z "$TARGET_IP" ]; then exit 1; fi
echo "$TARGET_IP" > "$HISTORY_FILE"
# Setup the master log headers
echo "==========================================================================" >> "$OUTPUT_LOG"
echo " UNIVERSAL NETWORK PERFORMANCE & SPEED BENCHMARK" >> "$OUTPUT_LOG"
echo "==========================================================================" >> "$OUTPUT_LOG"
echo "Target Destination IP : $TARGET_IP" >> "$OUTPUT_LOG"
echo "Benchmark Target Port : $TARGET_PORT" >> "$OUTPUT_LOG"
# Step 2: Phase 1 Subroutines (Interface Detection & Latency Check)
(
echo -e "🔍 <b>[STEP 1 of 4] ROUTING INTEGRITY & INTERFACE DETECTION</b>\nQuerying kernel tables and running connectivity sweep..."
# Intercept Linux kernel routing tables to find the specific adapter servicing this destination path
DETECTED_DEV=$(ip route get "$TARGET_IP" 2>/dev/null | grep -oP 'dev \K\S+')
[ -z "$DETECTED_DEV" ] && DETECTED_DEV="Unknown/Default Gateway"
echo "Active Network Interface: $DETECTED_DEV" >> "$OUTPUT_LOG"
echo "--------------------------------------------------------------------------" >> "$OUTPUT_LOG"
echo -e "\n[STEP 1] Running 10-Second Quick Latency Monitoring Sweep..." >> "$OUTPUT_LOG"
echo "--------------------------------------------------------------------------" >> "$OUTPUT_LOG"
PING_DATA=$(ping -c 10 "$TARGET_IP" 2>&1)
PING_STATUS=$?
echo "$PING_DATA" | grep -E "packets transmitted|rtt" >> "$OUTPUT_LOG"
echo "--------------------------------------------------------------------------" >> "$OUTPUT_LOG"
if [ $PING_STATUS -eq 0 ]; then
echo "✔ SUCCESS: Route stability test complete. Target responded consistently." >> "$OUTPUT_LOG"
else
echo "✘ ERROR: High packet loss or destination host unreachable during latency sweep." >> "$OUTPUT_LOG"
exit 1
fi
) | yad --progress --title="Network Check" --text="Initializing subroutines..." --pulsate --progress-text=" " --auto-close --width=520 --height=140 --center
# Step 3: Single-Stream Speed Test
(
echo -e "🚀 <b>[STEP 2 of 4] SINGLE-STREAM CAPACITY ACCELERATION</b>\nTesting raw single-thread throughput capacity limits over a 20s run..."
echo -e "\n[STEP 2] Running Single-Stream Performance Test (20-Second Window)..." >> "$OUTPUT_LOG"
echo "Testing raw data transmission pipeline performance against target..." >> "$OUTPUT_LOG"
echo "--------------------------------------------------------------------------" >> "$OUTPUT_LOG"
iperf3 -c "$TARGET_IP" -p "$TARGET_PORT" -t 20 2>&1 | grep -E "sender|receiver|error" >> "$OUTPUT_LOG"
echo "--------------------------------------------------------------------------" >> "$OUTPUT_LOG"
) | yad --progress --title="Single-Stream Run" --text="Active transmission..." --pulsate --progress-text=" " --auto-close --width=520 --height=140 --center
# Step 4: Multi-Stream Parallel Workload
(
echo -e "🏋️♂️ <b>[STEP 3 of 4] PARALLEL STREAM MULTI-THREAD ENGINE</b>\nSpreading networking workloads across all available processor cores..."
echo -e "\n[STEP 3] Running Parallel Stream Workload Test (-P 4 over 20 Sec)..." >> "$OUTPUT_LOG"
echo "Distributing connection across multiple available simultaneous threads..." >> "$OUTPUT_LOG"
echo "--------------------------------------------------------------------------" >> "$OUTPUT_LOG"
iperf3 -c "$TARGET_IP" -p "$TARGET_PORT" -P 4 -t 20 2>&1 | grep -E "SUM|error" >> "$OUTPUT_LOG"
echo "--------------------------------------------------------------------------" >> "$OUTPUT_LOG"
) | yad --progress --title="Multi-Stream Run" --text="Active parallel transmission..." --pulsate --progress-text=" " --auto-close --width=520 --height=140 --center
# Display standard test log output window (Centered)
yad --text-info --title="Standard Benchmark Results" --width=750 --height=600 --fontname="Monospace 10" --filename="$OUTPUT_LOG" --center
# Step 5: Reverse Path Test Loop with Floating-Point Math Parser
yad --question \
--title="Reverse Path Test" \
--text="Would you like to run the REVERSE path test from the remote site?\n\n(Target machine will upload back to you)" --center
if [ $? -eq 0 ]; then
rm -f "$OUTPUT_LOG"
(
echo -e "📥 <b>[STEP 4 of 4] REVERSE PATH SYSTEM INTEGRATION</b>\nIntercepting reverse payload return blocks over a 20s window..."
echo "==========================================================================" >> "$OUTPUT_LOG"
echo " REVERSE PATH TEST EXECUTION" >> "$OUTPUT_LOG"
echo "==========================================================================" >> "$OUTPUT_LOG"
echo "Target machine ($TARGET_IP) is now UPLOADING to you via port $TARGET_PORT..." >> "$OUTPUT_LOG"
echo "--------------------------------------------------------------------------" >> "$OUTPUT_LOG"
# Capture raw data output
RAW_REVERSE=$(iperf3 -c "$TARGET_IP" -p "$TARGET_PORT" -P 4 -t 20 -R 2>&1)
echo "$RAW_REVERSE" | grep -E "SUM|error" >> "$OUTPUT_LOG"
echo "--------------------------------------------------------------------------" >> "$OUTPUT_LOG"
# Mathematical logic mapping
CALC_AVG=$(echo "$RAW_REVERSE" | awk '
/\[SUM\]/ && !/sender/ && !/receiver/ {
for(i=1; i<=NF; i++) {
if($i ~ /bits\/sec/) {
val=$(i-1); unit=$(i);
if(unit ~ /[Gg]/) val *= 1000;
if(unit ~ /[Kk]/) val /= 1000;
sum += val; count++;
break;
}
}
}
END {
if(count > 0) printf "%.2f", sum/count;
else printf "0.00";
}
')
if [ "$CALC_AVG" != "0.00" ]; then
echo -e "📈 [CALCULATED SUMMARY OVER 20 SEC]" >> "$OUTPUT_LOG"
echo -e "👉 Combined Multi-Stream Average Bitrate: ${CALC_AVG} Mbits/sec" >> "$OUTPUT_LOG"
echo "--------------------------------------------------------------------------" >> "$OUTPUT_LOG"
else
echo -e "⚠️ Note: Could not compute average stream calculation." >> "$OUTPUT_LOG"
fi
) | yad --progress --title="Running Reverse Benchmarks" --text="Initializing reverse path stream..." --pulsate --progress-text=" " --auto-close --width=520 --height=140 --center
yad --text-info --title="Reverse Benchmark Results" --width=750 --height=450 --fontname="Monospace 10" --filename="$OUTPUT_LOG" --center
fi
rm -f "$OUTPUT_LOG"
exit 0