I’m stressing my brains for the past hour as to why the outdoing packages are marked by the firewall, since only incoming packages should be.
Here is my firewall setting:
So what I do here(if I understand that correctly):
mark ALL connections from WAN to local network
remark all connections going to 10.10.10.130 with ‘Wifi130-DL-conn’
mark HTTP packages with ‘Wifi-http-high’
mark ALL other with ‘Wifi-other-high’
I then start a download of a file over HTTP and I see increase in ‘Wifi-other-high’ mantle rule. When I look at a log file, I see this:
11:56:40 firewall OTHER forward: in:Local out:Public, src-mac 08:00:27:10:15:6a, proto TCP (ACK),
info 10.10.10.130:3071->193.2.1.XX:80, NAT (10.10.10.130:3071->192.168.50.121:3071)->193.2.1.XX:80,
len 40
11:56:40 firewall OTHER forward: in:Local out:Public, src-mac 08:00:27:10:15:6a, proto TCP (ACK),
info 10.10.10.130:3071->193.2.1.XX:80, NAT (10.10.10.130:3071->192.168.50.121:3071)->193.2.1.XX:80,
len 40
193.2.1.XX is the server’s IP from where I’m downloading. Why is outgoing traffic being logged and marked? According to mangle rules, only traffic going out the Local interface should get marked.
If you use connection mark, that is exactly what happens. All packets belonging to that connection will be marked, incoming and outgoing.
e.g. in rule nr. 0, packets going out via Local will get a “All-Download” connection mark, and so will all the response packages of that connection (established state, don’t know about related…).
Now, in rule nr. 1, all packages that have the “All-Download” connection mark, incoming and outgoing, will get a packet mark “All-Download-Pkg”.
To have only a “All-Download-Pkg” packet mark on downloading packets, you should mark the packets directly in the first rule:
0 chain=forward action=action=mark-packet new-packet-mark=All-Download-Pkg passthrough=yes out-interface=Local