I am having two ISP connection (Link1 and Link2), I want to route all downloads traffic which are of size more than 1MB through Link2.
I have created a routing table Link2 and routing all packets which has got mark 2.
ip route add default via 192.168.1.253 table link2 ip rule add fwmark 2 table link2
It works when I simply use it with any http packets for example
iptables -t mangle -A PREROUTING -p tcp -s 192.168.1.81 --dport 80 -j MARK --set-mark 2 (works)
Now when I am trying to mark if the download size is more that 1MB it is not working as expected.
iptables -t mangle -A PREROUTING -p tcp -s 192.168.1.81 --dport 80 -m connbytes --connbytes 1048576: --connbytes-dir both --connbytes-mode bytes -j MARK --set-mark 2 (not working)
Can anyone please tell me if anything I am missing here.