qbittorrent / qBittorrent

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

Remove IP filtering "feature" and non libtorrent/automatic peer blocking #13180

Open FranciscoPombal opened 4 years ago

FranciscoPombal commented 4 years ago

IP filters/blocklists are useless and possibly harmful nowadays in the BitTorrent network. We might get issue reports from users who are unknowingly blocking the only available peers with some kind of placebo blocklist or some manually banned IPs.

Libtorrent already automatically blocks "misbehaving" peers on its own. I don't think there's anything else we should do on top of that.

ghost commented 1 year ago

Libtorrent doesn't appear to be blocking Martian packets... I see a bunch in my filtered list

While running this as a .dat file...

# Bogons - Martian Packets
# https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml
# Convert IP/CIDR address to IPs range https://md5calc.com/ip/cidr-range
000.000.000.001 - 000.255.255.255 , 000 , IANA - Local Identification [RFC5735]
010.000.000.000 - 010.255.255.255 , 000 , IANA - Private Use [RFC1918]
100.064.000.000 - 100.127.255.255 , 000 , IANA - Carrier-grade NAT [RFC6598]
127.000.000.000 - 127.000.000.000 , 000 , IANA - Internet Host Loopback [RFC5735]
127.000.000.002 - 127.255.255.255 , 000 , IANA - Internet Host Loopback [RFC5735]
169.254.000.000 - 169.254.255.255 , 000 , IANA - Link Local Block [RFC5735]
172.016.000.000 - 172.031.255.255 , 000 , IANA - Private Use [RFC1918]
192.000.000.000 - 192.000.000.255 , 000 , IANA - IETF protocol assignments
192.000.002.000 - 192.000.002.255 , 000 , IANA - TEST-NET-1 [RFC5737]
192.168.000.000 - 192.168.255.255 , 000 , IANA - Private-Use Networks [RFC1918]
198.018.000.000 - 198.019.255.255 , 000 , IANA - Benchmark Tests of Network Interconnect Devices [RFC2544][RFC3330]
198.051.100.000 - 198.051.100.255 , 000 , IANA - TEST-NET-2 [RFC5737]
203.000.113.000 - 203.000.113.255 , 000 , IANA - TEST-NET-3 [RFC5737]
224.000.000.000 - 239.255.255.255 , 000 , IANA Reserved - Multicast
240.000.000.000 - 255.255.255.255 , 000 , IANA Reserved - Future use

Here are blocked IPs from qBittorrent's Blocked IPs log over 24 hours

0.0.0.62 0.11.0.0 10.0.0.138 10.0.0.18 10.0.0.2 10.0.0.3 10.10.10.1 10.111.111.1 10.228.20.1 10.42.0.1 10.8.1.224 100.100.0.144 100.64.23.234 100.75.73.33 172.16.0.1 172.16.10.6 172.16.124.104 172.16.3.254 172.17.0.1 172.18.0.1 172.20.0.1 172.24.0.1 192.168.0.1 192.168.1.1 192.168.1.254 192.168.100.2 192.168.139.128 192.168.2.1 192.168.2.104 192.168.2.2 192.168.20.1 192.168.4.1 192.168.5.1 192.168.66.1 192.168.7.3 192.168.8.1 198.18.0.1

Wikipedia says

As of November 2011, the Internet Engineering Task Force (IETF) recommends that, since there are no longer any unallocated IPv4 /8s, IPv4 bogon filters based on registration status should be removed.[5] However, bogon filters still need to check for Martian packets.

There is a legitimate reason to keep this option.

What about blocking your ISPs DNS addresses when you are on a VPN in case the connection drops.