Forums

cofredric
cofredric
Offline
Resolved
0 votes
I Use bittorrent alot and would like the main gateway to automatically block bad peers bluetack_level1 how do I go about doing this. I mean I would like to do all sorts of lists that peerguardian uses or could I just run peerguardian (pgl)
Saturday, November 22 2014, 03:16 AM
Share this post:
Responses (4)
  • Accepted Answer

    cofredric
    cofredric
    Offline
    Thursday, January 29 2015, 04:52 AM - #Permalink
    Resolved
    0 votes
    I like this ipset idea
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, November 22 2014, 04:52 PM - #Permalink
    Resolved
    0 votes
    I assumed you were using Transmission on the server for your torrents. It is probably the most common implementation.

    If you want to try some scripting, the list can be used. Have a search on the forum for ipset. The main script you will find is a bit OTT, but the level1 blocklist could be fed into something similar. From the level1 list you'd need to strip everything up to the first IP. You should be able to do this easily with sed by matching between the start of the line and the : and deleting it (match would be something like ^.*: ) This will leave you with a list of IP ranges and perhaps IP's. Feed this list into an ipset set type bitmap:ip and then use the ipset list to block traffic to external high ports in your FORWARD chain.
    The reply is currently minimized Show
  • Accepted Answer

    cofredric
    cofredric
    Offline
    Saturday, November 22 2014, 04:20 PM - #Permalink
    Resolved
    0 votes
    I want to use my own system not the router. I am running the router under a very small install that and I want to limit the whole network not just one spot

    is there no way to block this list on the folks using my wifi so anyone coming in and downloading on my bandwidth is unable to connect and or is connection is blocked from this list and many more I use.
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, November 22 2014, 09:04 AM - #Permalink
    Resolved
    0 votes
    I use a script like this in cron.weekly:
    #!/bin/bash

    cd /usr/src

    if [ -e bt_level1.gz ]; then
    rm bt_level1.gz > /dev/null &2>1
    fi

    wget -q -O bt_level1.gz "http://list.iblocklist.com/?list=bt_level1&fileformat=p2p&archiveformat=gz"
    sleep 120
    if [ -e bt_level1.gz ]; then
    gzip -d bt_level1.gz
    sleep 60
    mv -f bt_level1 /home/transmission/.config/transmission-daemon/blocklists
    service transmission-daemon restart > /dev/null
    fi
    It is not perfect and I have not checked it for a while to make sure it is still running cleanly but I get no errors reported from cron.

    Note I have a legacy transmission set up so my transmission config is held in a different directory structure. do a "locate transmission-daemon"to find yours.

    [edit]
    Hit quote on this post to see the code indentation.
    [/edit]
    The reply is currently minimized Show
Your Reply