Page 3 of 3 FirstFirst 123
Results 21 to 30 of 30

Thread: How Do You Block Torrents By Using Squid Or Firewall? Is There A Better Way?

  1. #21
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: How Do You Block Torrents By Using Squid Or Firewall? Is There A Better Way?

    Blocking torrents is not easy as basically the torrent clients are designed to evade such attempts on your part.

    You have been given some good advice in your thread, I would point you at this thread.

    http://serverfault.com/questions/270...-p2p-protocols

    I believe the best solution is to use a proxy server for web access, ie something like squid.

    So, if you are on a low budget, configure a hardware firewall (which is nothing but an inexpensive box with two network cards) and install a firewall specific distro + squid.

    You would then configure the firewall to allow as much internal traffic as you wish, but restrict outbound traffic to http and https (ports 80 and 443) which would be proxied by squid.

    Yes it can still be abused.

    http://www.linuxhomenetworking.com/w...ess_with_Squid

    http://www.linuxjunkies.org/html/Ban...ing-HOWTO.html
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  2. #22
    Join Date
    Jan 2006
    Beans
    63

    Re: How Do You Block Torrents By Using Squid Or Firewall? Is There A Better Way?

    Quote Originally Posted by vhinz View Post
    Block torrents? As simple as managing network bandwidth. simultaneous downloads especially large files (mostly movies) from torrents can bring network to its knees.


    Not if you install 10 MBit switches on the client side

    Your core switches should always be a step above your client switches to prevent any single client from "bringing the network to its knees".

  3. #23
    Join Date
    Aug 2008
    Location
    WA
    Beans
    2,186
    Distro
    Ubuntu

    Re: How Do You Block Torrents By Using Squid Or Firewall? Is There A Better Way?

    I have used connection limits to slow torrents to a crawl..

    I had transparent bridge and the version of brctl control that it had on the box allowed for setting connection limits, both global and individual. I had a global limit of 100 per internal IP address, and this managed to throttle torrents quite effectively. (I don't think anyone was able to pull over 30k / second)

    http://www.bandwidtharbitrator.com/m...=article&sid=4

    BTW -- The neteq is a linux based transparent bridge device and it does an excellent job of providing very fine grained control over your network traffic.
    Last edited by iponeverything; January 12th, 2010 at 08:30 AM.

  4. #24
    Join Date
    Jul 2009
    Beans
    571
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How Do You Block Torrents By Using Squid Or Firewall? Is There A Better Way?

    @iponeverything:

    http://www.bandwidtharbitrator.com/m...=article&sid=4

    Your link above doesn't work.
    It's OK, everything we know will become obsolete at some time.

  5. #25
    Join Date
    Jul 2009
    Beans
    571
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How Do You Block Torrents By Using Squid Or Firewall? Is There A Better Way?

    Please take a look at my POST #10 here at: http://ubuntuforums.org/showthread.php?t=1576228

    I can't block torrents but I can hamper their speeds.

    It's the simplest way I know! Thanks UbuntuForums and all the good and patient people who helped me out.
    It's OK, everything we know will become obsolete at some time.

  6. #26
    Join Date
    Aug 2008
    Location
    Victoria, BC Canada
    Beans
    1,741

    Re: How Do You Block Torrents By Using Squid Or Firewall? Is There A Better Way?

    Those 2 DNS servers are public and anyone can use them.

    I have them in my other DNS list in BIND9, along with a lot of other around the planet.

  7. #27
    Join Date
    Mar 2007
    Beans
    125

    Re: How Do You Block Torrents By Using Squid Or Firewall? Is There A Better Way?

    Quote Originally Posted by AlexanderDGreat View Post
    Please take a look at my POST #10 here at: http://ubuntuforums.org/showthread.php?t=1576228

    I can't block torrents but I can hamper their speeds.

    It's the simplest way I know! Thanks UbuntuForums and all the good and patient people who helped me out.
    As bittorrents are very complex and they are using various ports. Thus the best way to block them out is to install squid on your server and only allow the http, https and IMAP ports and deny all other ports using the "http_access deny all".
    Now the torrents should not be able to function more.
    Love my Ubuntu!

  8. #28
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: How Do You Block Torrents By Using Squid Or Firewall? Is There A Better Way?

    I know this post is old, but I thought I'd pass along a different solution.

    Most torrent traffic occurs on so-called "high" ports, ones numbered from 1024-65535. Ports below this can only be opened by software running (at least initially) with root permissions like SMTP (port 25) and HTTP servers (80). Ordinary users can run software like torrent clients that listen on the high ports.

    At one site I consult to, we've simply blocked all traffic originating on a client computers' high ports from connecting to any remote's high ports like this:

    Code:
    iptables -A FORWARD -p tcp -s 10.10.0.0/16 --sport 1024:65535 -d ! 10.10.0.0/16 --dport 1024:65535 -j REJECT
    iptables -A FORWARD -p udp -s 10.10.0.0/16 --sport 1024:65535 -d ! 10.10.0.0/16 --dport 1024:65535 -j REJECT
    These allow machines within our network (10.10.0.0/16) to carry out high-port communication with each other, but forbids them from connecting to high ports on remotes.

    These rules will block most torrent traffic and other bandwidth gobblers like streaming radio and gaming. They may also block some legitimate traffic as well. We log all packets that match this rule (by adding two identical rules above these with "-j LOG" instead of "-j REJECT") just in case. Usually the IT department will hear complaints if a legitimate service (like, e.g. GoToMyPC) is blocked.
    Last edited by SeijiSensei; October 8th, 2011 at 02:31 PM.

  9. #29
    Join Date
    Nov 2011
    Beans
    10

    Re: How Do You Block Torrents By Using Squid Or Firewall? Is There A Better Way?

    Quote Originally Posted by SeijiSensei View Post
    I know this post is old, but I thought I'd pass along a different solution.

    Most torrent traffic occurs on so-called "high" ports, ones numbered from 1024-65535. Ports below this can only be opened by software running (at least initially) with root permissions like SMTP (port 25) and HTTP servers (80). Ordinary users can run software like torrent clients that listen on the high ports.

    At one site I consult to, we've simply blocked all traffic originating on a client computers' high ports from connecting to any remote's high ports like this:

    Code:
    iptables -A FORWARD -p tcp -s 10.10.0.0/16 --sport 1024:65535 -d ! 10.10.0.0/16 --dport 1024:65535 -j REJECT
    iptables -A FORWARD -p udp -s 10.10.0.0/16 --sport 1024:65535 -d ! 10.10.0.0/16 --dport 1024:65535 -j REJECT
    These allow machines within our network (10.10.0.0/16) to carry out high-port communication with each other, but forbids them from connecting to high ports on remotes.

    These rules will block most torrent traffic and other bandwidth gobblers like streaming radio and gaming. They may also block some legitimate traffic as well. We log all packets that match this rule (by adding two identical rules above these with "-j LOG" instead of "-j REJECT") just in case. Usually the IT department will hear complaints if a legitimate service (like, e.g. GoToMyPC) is blocked.
    Hi SeijiSensei

    I am have a similar problem but am new to linux. Where would I put the code you recomend?

  10. #30
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: How Do You Block Torrents By Using Squid Or Firewall? Is There A Better Way?

    Quote Originally Posted by adtf01 View Post
    Hi SeijiSensei

    I am have a similar problem but am new to linux. Where would I put the code you recomend?
    You will have to learn iptables for those commands to work.

    http://bodhizazen.net/Tutorials/iptables
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

Page 3 of 3 FirstFirst 123

Tags for this Thread

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
  •