I want to make the router prioritize any other traffic over uTorrent. If I’m streaming netflix or youtube, I want to be able to leave the torrents running in the background without them eating up my bandwidth. I also want my computer (192.168.12.96) to have priority over the others on the network. this translates into four traffic priorities:
- My PC, non-torrent
- Other PCs on the network, non-torrent
- My PC, torrent
- Other PCs on the network, torrent
All of the PCs on the network use uTorrent set to port 6881.
I’ve tried doing this with mangle rules and queues, but I got stuck at the queues. All of the rules were set to prerouting. If I omitted to specify a property, it was left on the default value.
Firstly, I created four rules to detect torrent traffic on my PC:
src. address: 192.168.12.96
protocol: tcp
src. port: 6881
src. address: 192.168.12.96
protocol: udp
src. port: 6881
dst. address: 192.168.12.96
protocol: tcp
dst. port: 6881
dst. address: 192.168.12.96
protocol: udp
dst. port: 6881
They are all set to mark packets with the same mark “torrentPC”. The rest of the values were left unchanged. The first two work - they detect any outgoing uTorrent traffic. However, the last two aren’t detecting any inbound traffic (while it exists). Why is that? Is uTorrent not using the same protocol/port for inbound traffic? How do I formulate it so it detects it?
Secondly, I needed to detect torrent traffic on the rest of the network. It’s the same rules as the above, just all the addresses were changed to 192.168.12.0/24 and packet mark was set to “!torrentPC”. It should mark it with “torrentGlobal”. I think this worked - if I remove the packet mark rule it starts to detect my own torrent traffic. But only the outbound.
Thirdly, I need to mark the rest of the traffic on my PC:
src. address: 192.168.12.96
packet mark: !torrentPC
dst. address: 192.168.12.96
packet mark: !torrentPC
This detected no traffic what so ever (loading a few youtube videos should have triggered it, but it didn’t). I have no idea why.
Finally, I need to mark the rest of the traffic. Now, this was a bit tricky, but I barely managed to specify it as:
src. address: !192.168.12.96
packet mark: !torrentGlobal
dst. address: !192.168.12.96
packet mark: !torrentGlobal
This should exclude the any traffic connected to my PC, and then also exclude any packets marked with torrentGlobal which should be what I want. However, this seems very clunky. If I wanted to add more rules I might be unable to formulate them if i needed to exclude or include multiple addresses/ports/protocols
Is there another way to somehow mark the traffic between 192.168.12.96:6881 and any other computer on any protocol and going either way? I needed to create four rules to do that, but I’m sure there’s a simpler way. Or a way to detect traffic between 192.168.12.0/24, but not 192.168.12.96, on a specific port, but regardless of protocol, or excluding a specific one?
How do I make this work? What am I doing wrong?
P.S. Note that my provided didn’t let me us this router directly, I had to put theirs into bridge mode and connect it that way. This makes it impossible to filter mangle rule by an interface for some reason.
P.P.S. The router is CRS125-24G-1S-2HnD running version 6.39.2 (stable).