A simple Bash script that benchmarks multiple IPv6 addresses on the same server and find the fastest one for downloads.
Normally, different IPv6 addresses on the same server should perform the same. But in some networks, especially the ones with ISP filtering and routing quirks, performance can vary in unpredictable ways.
You may find the tool useful if:
- your network behaves inconsistently
- you suspect ISP routing or filtering issues
- you wish to optimize IPv6 performance in restricted environments If your network behaves normally, you probably won't see much difference.
The script runs on your client machine and connects to your server over SSH.
It supports both:
- Interactive mode — run the script without arguments and prompt for each configuration
- CLI mode — provide arguments for automation or repeatable runs
During execution, the script will:
- Check for
iperf3on the client - Connect to the remote server over SSH
- Check for
iperf3on the server - If not specified via CLI arguments, detect a suitable IPv6 interface and
/64subnet on the server - Start
iperf3on the server and verify that it is reachable - Generate random IPv6 addresses within the selected subnet
- Temporarily assign the generated addresses to the selected interface
- Run download throughput tests from server to client
- Compare the results and identify the fastest address
- Clean up temporary resources on exit
Whether normal exit or error, the script will:
- remove generated IPv6 addresses
- optionally keep the fastest address
- stop the remote
iperf3process - close the SSH control connection
- delete temporary files
The script may not always be fully non-interactive. You may still be prompted for:
- SSH authentication
sudopassword on the remote server- manual intervention if
iperf3is missing - manual firewall changes if the
iperf3port is not reachable In these cases, the script will redirect you to an SSH session to fix issues manually instead of exiting immediately.
- Linux
iperf3ssh
- Linux
iperf3iproute2sudoRequired to add and remove temporary IPv6 addresses
git clone https://github.com/read-bean-pasta/ipv6-download-bench.git
cd ipv6-download-bench
chmod +x benchmark-ipv6-download.shRun in interactive mode:
./benchmark-ipv6-download.shShow available CLI options:
./benchmark-ipv6-download.sh --help--help
Show this help message and exit
--host HOST
Remote server address
--user USER
Username for SSH login on the remote server
--port PORT
SSH port to connect to
--key PATH
Path to the SSH private key
If omitted, password authentication is used
--dev INTERFACE
Network interface to use when binding generated IPv6 addresses
If omitted, the script tries to detect it automatically
You may be prompted if multiple suitable interfaces are found
--address IP
Example IPv6 address used to determine the /64 prefix
If omitted, the script tries to detect it automatically
You may be prompted if multiple IPv6 prefixes are found
--number INT
Number of random IPv6 addresses to generate and test
Default: 10
--duration INT
Duration of each iperf3 test, in seconds
Default: 10
--no-test-existing
Skip testing existing IPv6 addresses
--no-keep-winner
Do not keep the IPv6 address with the best measured speed
- Download only Upload benchmarking is not currently implemented.
- Results can fluctuate Throughput may vary between runs due to changing network conditions.
- Not fully automation-friendly Certain steps may still require manual intervention for authentication, package installation, or firewall configuration.