I have been following a guide in the forum as well as on youtube to setup Queue Tree QOS. Everything is working, I just don’t quite understand passthrough completely.
Aim:
To split overall bandwidth to: hotspot (higher priority and bandwidth) and office downloads (lower priority and bandwidth).
Within each, further split the type of packets into: http browsing (highest priority), Youtube & Netflix (middle priority), all other downloads (mid-low priority) and Torrent (lowest priority).
The only point of confusion is whether:
A. I have setup the PASSTHROUGH = YES/NO correctly in my mangle rules, and whether
B. My rule ordering is correct, specifically between 5 to 8. Happy for other errors to be corrected as well.
The Mangle rules I have setup:
Mark Connection > fwd > In Interface List = WAN > Dst. Address List = HOTSPOT VLAN > Mark Conn = con.hotspot.dw > Passthrough = YES
Mark Connection > fwd > In Interface List = WAN > Dst. Address List = OFFICE VLAN > Mark Conn = con.office.dw > Passthrough = YES
Mark Connection > fwd > Out Interface List = WAN > Mark Conn = con.all.up > Passthrough = YES
Mark Packet > fwd > Conn Mark = con.hotspot.dw (#1) > Mark Packet = pk.hotspot.dw > Passthrough = YES
Mark Packet > fwd > Pk Mark = pk.hotspot.dw (#4) > L7 Protocol = Torrent > Mark Packet = pk.hotspot.p2p.dw > Passthrough = NO
Mark Packet > fwd > Pk Mark = pk.hotspot.dw (#4) > L7 Protocol = Youtube & Netflix > Mark Packet = pk.hotspot.video.dw > Passthrough = NO
Mark Packet > fwd > Pk Mark = pk.hotspot.dw (#4) > Prot = tcp > Port = 80,443 > Connection Bytes = 0-10M > Mark Packet = pk.hotspot.httpbrowsing.dw > Passthrough = NO
Mark Packet > fwd > Pk Mark = pk.hotspot.dw (#4) > Prot = tcp > Mark Packet = pk.hotspot.other.dw > Passthrough = NO
Mark Packet > fwd > Conn Mark = con.office.dw (#2) > Mark Packet = pk.office.dw > Passthrough = YES
10-13. Same as 5-8, but for office.
Mark Packet > fwd > Conn Mark = con.all.up (#3) > Mark Packet = pk.all.up > Passthrough = NO
Unfortunately I have to travel a long way to attend a Mikrotik training session, so I am trying to do as much as I can based on forums and guides before I attend one.
If a rule/line is matching and the Passthrough is NOT marked for that line then the rest of the lines are skipped in Mangle.
If a rule/line is matching and the Passthrough is marked then the next line is processed. If that line or an later line is also matching then the value is overwritten if that was the same on the previous matched line.
So Passthrough = NO and rule/line matches then processing is Mangle ready for that chain. If Passthrough = YES then just carry on till the last rule/line in the chain if not stopped by later a Passthrough = NO. The Chain in your setup is FWD (forward).
passthrough (yes|no; Default: yes)
whether to let the packet to pass further (like action passthrough) into firewall or not (property only valid some actions).
The clarification I need is, and I should have been clearer on this, whether the PASSTHROUGH=NO in Packet Marking Rules 5-8 stops Packet Marking Rule 9 from processing.
It shouldn’t, since Packet Marking Rule 9 is based on a different connection mark than Packet Rules 5-8. Is this correct?
Passthrough only matters if a packet matches a rule. It basically asks the question: “If a packet matches this rule, should I continue scanning?”
So, if a packet matches a rule and passthrough=no then it stops at that rule and uses that packet mark.
If it matches a rule and passthrough=yes then it continues scanning down the list of mangle rules for another rule that matches a more specific criteria. If it matches the second rule, it uses the packet mark of the second rule. If it doesn’t match another rule, it uses the mark of the first rule.
The way you setup passthrough is correct. Because traffic from office vlan has a different connection mark that doesn’t match with any of the first rules (hotspot 5-8) it will not be affected by the passthrough settings of those first rules.
So, if a packet matches a rule early on in the mangle rules BUT… will also need to be processed again by lets say 10 mangle rules later, then the first rule that packet is involved in MUST have passthrough=yes??