How to Set aria2 BitTorrent Port Range?

Configuring the network ports for BitTorrent traffic in aria2 is essential for optimizing download speeds, ensuring proper port forwarding, and navigating firewall restrictions. By default, aria2 utilizes a specific range of ports to establish connections with peers in the BitTorrent network. This article provides a quick overview of the exact command-line flag used to define this port range, along with practical examples of how to implement it in your download workflows.

The BitTorrent Port Range Flag

To specify the listening port range for BitTorrent connections in aria2, you use the --bt-port flag. This option allows you to define a single port or a range of ports that aria2 will attempt to bind to for incoming BitTorrent traffic.

Syntax and Usage

The basic syntax for the flag requires you to pass either a single port number or a pair of port numbers separated by a hyphen.

aria2c --bt-port=<PORT>|<START>-<END> [URL|MAGNET]

Practical Examples

aria2c --bt-port=6881-6889 "magnet:?xt=urn:btih:..."
aria2c --bt-port=50000 "magnet:?xt=urn:btih:..."

Important Considerations