Results 1 to 1 of 1

Thread: How to block torrent peer on Linux (iptables)?

  1. #1
    One IP address is using multiple connections to download single torrent (qBittorrent):
    multiple peer connections.gif

    I have multiple connections from one IP enabled (https://www.libtorrent.org/reference...ections_per_ip), because i want to allow one person to download multiple torrents, assuming that this setting apply on all torrents, not on just one... Setting is recommended to be enabled (As i have it). UPDATE: later i have disabled this and i have not seen single IP doing multiple connections per torrent, but is allowed to download multiple torrents. So that is the desired state IMO.

    I wanted to block the IP:port combination, but i doubt it would be effective (but still i wanted to try). I have been unable to find such connection using netstat -a|grep -E "1.2.3.4|4.3.2.1" and various iptables rules applied on WireGuard server/client (INPUT/FORWARD iptables chain, tcp, udp...) does not block it:
    sudo iptables -A INPUT -p udp --dport 123 -s 1.2.3.4 -m string --string "uTP" --algo kmp -j DROP
    sudo iptables -A INPUT -p udp --sport 123 -s 1.2.3.4 -m string --string "uTP" --algo kmp -j DROP
    sudo iptables -A INPUT -p tcp --sport 123 -s 1.2.3.4 -j DROP -m comment --comment "Duplicate torrent peer"
    sudo iptables -A INPUT -p udp --sport 123 -s 1.2.3.4 -j DROP -m comment --comment "Duplicate torrent peer"
    So my question is how to display connection of that peer IP on Linux and if i can, then how i can block one of the peer connections?
    Last edited by postcd; 03-21-2024 at 12:47 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •