Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Easy torrent shaper for home use

    Scheduled Pinned Locked Moved Traffic Shaping
    9 Posts 3 Posters 4.7k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      senser
      last edited by

      The idea may be obvious but it wasn't to me and after a lot of trial and error and even some thinking and reading I came up with a fairly simple and effective torrent shaping solution. If you're interested, read on. :)

      Idea
      For inbound traffic (LAN interface(s)) you want the default queue to be the high priority queue. This way, you only need to create a single, low priority rule for your incoming torrent port.

      For outbound traffic (WAN) you want the default queue to be the low priority queue. This way all those randomly initiated torrent connections will be low priority. Now just add some rules in the Floating rules table to make dns, http, icmp etc. a high priority.[1]

      Implementation
      I currently use two queues for incoming and three queues for outgoing traffic:

      Incoming Parent: HFSC (LAN interface)
      Bandwidth: 6912Kbit/s (adjust all these to your downstream speed)
      Upperlimit: - - 6912Kbit/s
      Realtime: - - 6912Kbit/s
      Shared: - - 6912Kbit/s

      Incoming "qDefault"
      Options: Default
      Bandwidth: 30%
      Upperlimit: - - 95%
      Realtime: 80% 2000 60%
      Shared: - - 30%

      Incoming "qLow"
      Options: RED, ECN
      Bandwidth: 40%
      Upperlimit: 80% 50 70%
      Realtime: - - -
      Shared: - - 40%

      Outgoing Parent: HFSC (WAN interface)
      Bandwidth: 736Kbit/s (adjust to your upstream speed)

      Outgoing "qACK" [2]
      Options: RED, ECN
      Bandwidth: 5Kbit/s
      Upperlimit: - - -
      Realtime: 8Kb 20 5Kb
      Shared: - - 5Kb

      Outgoing "qHigh"
      Options: RED, ECN
      Bandwidth: 50%
      Upperlimit: 95% 100 90%
      Realtime: 75% 2000 60%
      Shared: - - 50%

      Outgoing "qDefault"
      Options: Default, RED, ECN
      Bandwidth: 20%
      Upperlimit: 70% 100 60%
      Realtime: - - -
      Shared: - - 20%

      Note: If you decide to use Explicit Congestion Notification (ECN) make sure to also enable it in your OS (Win, Linux, Mac…).

      Result
      All available bandwidth is saturated dynamically at all times. I can watch HD streams while sharing files via torrent, without using any bandwidth limits in my torrent application.

      Thanks for reading.
      PS: I never had such a good internet experience before - I have only just used my modem. Thx pfSense team!

      1. I chose high priority for these (outgoing): ICMP, 20-23, 53, 123, 80, 443, 465, 993, 1935, 43, 843
      2. Use pftop's queue-monitor to monitor the saturation of the"qACK" queue. My settings are optimized for DSL 6000 and may not work well for your setup. You don't want to see any drops here.

      We use the mighty pf, we cannot be fooled.

      1 Reply Last reply Reply Quote 0
      • S
        st4t1c
        last edited by

        is there a chance for you to screenshot and/or describe how you made the LAN/WAN rules regarding your traffic shapers?

        i'm looking for an easy way to configure this as well.

        thanks a lot!

        1 Reply Last reply Reply Quote 0
        • S
          senser
          last edited by

          sure, see attachment (sorry for the mess, once a shot was pasted I couldn't move it anymore). note that I have tweaked the values - I have learned a bit more about the possibilities of m1,d and m2 since my initial post.

          easy_torrent.jpg
          easy_torrent.jpg_thumb

          We use the mighty pf, we cannot be fooled.

          1 Reply Last reply Reply Quote 0
          • S
            st4t1c
            last edited by

            thanks a lot!

            i'll try these settings today and report back on findings!

            p.s i suppose in "LAN" instead of 100mbit/s i should use 1gbit/sec (which is my network) or it doesnt really matter?

            edit: i've included everything, and i got noticable difference in internet experience!…but seems like qHigh on LAN is dropping packets like crazy...should it be like that?

            edit2: does floating rules have "quick" enabled?

            1 Reply Last reply Reply Quote 0
            • S
              senser
              last edited by

              you would need to tweak the values for qHigh and probably qAck too…you don't want to see drops there, only in the qLow queues. and yeah, for Gbit LAN you would set it to 1000Mbit (you also want to assign local traffic into the qLink queue, I have only shown the browsing/torrent-relevant rules).

              We use the mighty pf, we cannot be fooled.

              1 Reply Last reply Reply Quote 0
              • S
                st4t1c
                last edited by

                how is it possible to assign qLink queue to LAN->LAN traffic?…i was positive that LAN->LAN traffic is not filtered if its on the same LAN...

                i know i'm probably asking too much, but your situation is too similar to what i want to accomplish, its daunting not to ask further questions!

                1 Reply Last reply Reply Quote 0
                • S
                  senser
                  last edited by

                  You're probably right. I guess it depends on the setup. I am using a transparent firewall and everything is getting filtered (public AP on one side (OPT1) and my PC's on LAN). In my case I have to assign traffic into qLink to not queue it into the default queues.

                  We use the mighty pf, we cannot be fooled.

                  1 Reply Last reply Reply Quote 0
                  • S
                    st4t1c
                    last edited by

                    i have the same setup, and so far no matter what queues i force packets into, i see them populating the "LAN" queue…:(((

                    can you please share a little info and some screenshot on how you made lan traffic go through "qlink" and the internet traffic to the other queues?

                    1 Reply Last reply Reply Quote 0
                    • FurryFennecF
                      FurryFennec
                      last edited by

                      For some reason ports will NOT show in any rules I create. Not sure what to do to get them to work correctly.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post
                      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.