qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
26.96k stars 3.88k forks source link

Feature Request: NAT64 Support for IPv6-only Networks #14690

Open starcraft66 opened 3 years ago

starcraft66 commented 3 years ago

Right now, BitTorrent in general is a bit hard to use in IPv6-only networks because many peers reported by trackers are only accessible via IPv4 and are reported as literal IPv4 addresses which means they cannot be translated to a mapped v6 prefix via DNS64.

Most IPv6-only networks have a NAT64 service deployed that allows access to the IPv4 world via a /96 IPv6 prefix that maps the entire IPv4 internet. I think qBittorrent could utilize a NAT64 gateway to bridge the gap between the IPv4 and IPv6 BitTorrent worlds. By rewriting IPv4 addresses received from torrent trackers (and from other sources) as an IPv6 address in the NAT64 prefix, qBittorrent could download and upload to and from IPv4 peers via a NAT64 gateway while only having IPv6 internet access.

This NAT64 prefix could either be automatically detected by querying the ipv4only.arpa zone (hard) or hard-coded via a checkbox and text field in a settings pane (easy).

The auto-detection workflow could look something like the following:

  1. Detect if deluge is currently running IPv6 only (get addresses, if no IPv4 -> IPv6 only)
  2. Resolve ipv4only.arpa AAAA record and extract the first available NAT64 prefex (See RFC8880)
  3. Configure the client to translate any IPv4 peer addresses to IPv6 peer addresses

Optionally, this logic could also be applied to the IP address of torrent trackers but those ususally use DNS names and can therefore be transparently translated to IPv6 via DNS64.

FranciscoPombal commented 3 years ago

You also probably want to post this to https://github.com/arvidn/libtorrent.

tiagogaspar8 commented 2 years ago

I'll open an issue there