Introduction #
iPerf3 is a powerful network testing tool for measuring bandwidth and network performance. This guide explains how to test your LAN speed using iPerf3.
Prerequisites #
- Two computers on the same LAN (one as the server, one as the client)
- Stable network connection
- Administrator access (required on some operating systems)
Step 1: Install iPerf3 #
For Windows: #
- Download iPerf3 from the official website: https://iperf.fr/iperf-download.php
- Choose the Windows version (zip file)
- Extract the zip file to your preferred folder (e.g.
C:\iperf3)
For Linux (Debian/Ubuntu): #
sudo apt-get update
sudo apt-get install iperf3
For macOS (using Homebrew): #
brew install iperf3
Step 2: Set Up the iPerf3 Server #
- Open a terminal or command prompt on the computer acting as the server.
- Run the following command:
Windows:
cd C:\iperf3
iperf3.exe -s
Linux/macOS:
iperf3 -s
The server will now listen for incoming connections on the default port 5201.
Step 3: Run the iPerf3 Client #
On the second computer (client), run:
Basic Command:
iperf3 -c <SERVER_IP>
Replace <SERVER_IP> with the server’s IP address.
Example:
iperf3 -c 192.168.1.100
Step 4: Advanced Testing Options #
1. Change test duration (default is 10 seconds) #
iperf3 -c <SERVER_IP> -t 30 # 30 seconds
2. Reverse mode (server sends to client) #
iperf3 -c <SERVER_IP> -R
3. Use multiple streams (parallel testing) #
iperf3 -c <SERVER_IP> -P 4 # 4 parallel connections
4. Change buffer size #
iperf3 -c <SERVER_IP> -l 8K # 8KB buffer
5. Use UDP instead of TCP (default is TCP) #
iperf3 -c <SERVER_IP> -u -b 100M # UDP with 100Mbps target
Step 5: Interpreting the Results #
After the test finishes, you will see output like this:
[ ID] Interval Transfer Bitrate
[ 4] 0.00-10.00 sec 1.10 GBytes 944 Mbits/sec sender
[ 4] 0.00-10.00 sec 1.10 GBytes 944 Mbits/sec receiver
- Transfer: Total amount of data transferred during the test
- Bitrate: Transfer speed in megabits per second (Mbps)
Tips and Troubleshooting #
-
Firewall: Make sure port
5201is open on the server firewall. -
Inconsistent results:
- Close other applications using the network.
- Run the test multiple times.
-
Error “connection refused”:
- Ensure the iPerf3 server is running.
- Double-check the server IP address.
-
Lower-than-expected speeds:
- Check your network cables (use CAT5e or better).
- Confirm that all devices support the expected LAN speeds (e.g. 1Gbps).
Example Automation Script (Linux/macOS) #
Create a file called network_test.sh with the following content:
#!/bin/bash
SERVER_IP="192.168.1.100"
DURATION=20
PARALLEL=4
echo "Running TCP test..."
iperf3 -c $SERVER_IP -t $DURATION -P $PARALLEL
echo -e "\nRunning UDP test..."
iperf3 -c $SERVER_IP -t $DURATION -u -b 100M
Run the script:
chmod +x network_test.sh
./network_test.sh
Conclusion #
With iPerf3, you can accurately measure your LAN performance. This tool is useful for:
- Verifying network speed
- Troubleshooting network issues
- Testing before and after network configuration changes
For best results, run the test multiple times under different network conditions (peak vs. off-peak hours).
–