Skip to content

red-bean-pasta/ipv6-download-bench

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

ipv6-download-bench

A simple Bash script that benchmarks multiple IPv6 addresses on the same server and find the fastest one for downloads.


Background

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.

How it works

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:

  1. Check for iperf3 on the client
  2. Connect to the remote server over SSH
  3. Check for iperf3 on the server
  4. If not specified via CLI arguments, detect a suitable IPv6 interface and /64 subnet on the server
  5. Start iperf3 on the server and verify that it is reachable
  6. Generate random IPv6 addresses within the selected subnet
  7. Temporarily assign the generated addresses to the selected interface
  8. Run download throughput tests from server to client
  9. Compare the results and identify the fastest address
  10. Clean up temporary resources on exit

Cleanup behavior

Whether normal exit or error, the script will:

  • remove generated IPv6 addresses
  • optionally keep the fastest address
  • stop the remote iperf3 process
  • close the SSH control connection
  • delete temporary files

Note on automation

The script may not always be fully non-interactive. You may still be prompted for:

  • SSH authentication
  • sudo password on the remote server
  • manual intervention if iperf3 is missing
  • manual firewall changes if the iperf3 port is not reachable In these cases, the script will redirect you to an SSH session to fix issues manually instead of exiting immediately.

Requirements

Client

  • Linux
  • iperf3
  • ssh

Server

  • Linux
  • iperf3
  • iproute2
  • sudo Required to add and remove temporary IPv6 addresses

Quick Start

git clone https://github.com/read-bean-pasta/ipv6-download-bench.git
cd ipv6-download-bench
chmod +x benchmark-ipv6-download.sh

Run in interactive mode:

./benchmark-ipv6-download.sh

Show available CLI options:

./benchmark-ipv6-download.sh --help

Arguments

--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

Limitations

  • 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.

About

A simple Bash script that benchmarks multiple IPv6 addresses on the same server and find the fastest one for downloads

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages