How can I identify download traffic and set a mark so that I can route those packets using the fwmark through another link ?
The iptables modules connbytes, connlimit and length can be used to identify downloads. Here the setup is use:
I use queuing disciplines to prioritize downloads and other traffic.
About sending through another link: I am not ready to answer this, but it would be done with iproute2 (assuming you mean another IP link). However it will only work downstream, since you can not control where upstream traffic reaches you.
I was inspired by @Ganwell solution to this, and managed to solve this on top of adding in a
Here's my solution to this question with an actual shell script: