i found a way i might be able to help you. i have discovered the magic that is the command line.
goto a new terminal window in winbox.
type in: ip firewall
copy and paste this sucker in your command line, and hit enter.
add action=reject chain=forward comment=“tcp connection limit” connection-limit=60,32 disabled=no protocol=
tcp reject-with=tcp-reset
this is the tcp connection limit rule i have, it limits every ip address to 60 tcp connections, it helps keep bit torrent under control, also viruses and crap.
type / to get back to the root and hit enter.
for my filter i have setup first type in: ip firewall, hit enter, type mangle, then copy and paste this sucker:
add action=mark-connection chain=prerouting comment=“http mark” disabled=no dst-port=80 new-connection-mark=
http_conn passthrough=yes protocol=tcp
add action=mark-packet chain=prerouting comment=“” connection-mark=http_conn disabled=no new-packet-mark=
http_conn passthrough=no
add action=mark-connection chain=prerouting comment=“p2p mark” disabled=no new-connection-mark=p2p_conn p2p=
all-p2p passthrough=yes
add action=mark-packet chain=prerouting comment=“” connection-mark=p2p_conn disabled=no new-packet-mark=
p2p_conn passthrough=no
add action=mark-connection chain=prerouting comment=“smtp mark” disabled=no dst-port=25 new-connection-mark=
smtp_conn passthrough=yes protocol=tcp
add action=mark-packet chain=prerouting comment=“” connection-mark=smtp_conn disabled=no new-packet-mark=
smtp_conn passthrough=no
add action=mark-connection chain=prerouting comment=“pop mark” disabled=no dst-port=110 new-connection-mark=
pop_conn passthrough=yes protocol=tcp
add action=mark-packet chain=prerouting comment=“” connection-mark=pop_conn disabled=no new-packet-mark=
pop_conn passthrough=no
add action=mark-connection chain=prerouting comment=“other connections” disabled=no new-connection-mark=
other_conn passthrough=yes
add action=mark-packet chain=prerouting comment=“” connection-mark=other_conn disabled=no new-packet-mark=
other_conn passthrough=no
add action=mark-connection chain=prerouting comment=“sip mark” connection-type=sip disabled=no
new-connection-mark=sip_conn passthrough=yes
add action=mark-packet chain=prerouting comment=“” disabled=no new-packet-mark=sip_conn packet-mark=sip_conn
passthrough=yes
this marks all traffic accordingly as 1 of the following:
sip, http, pop, smtp, other, p2p.
type / to get back to the root and hit enter.
now for the queue tree, this is easy to setup in winbox, but for a nice copy and paste to the command line type in
type queue, hit enter, type tree, hit enter.
copy and paste this sucker in there and hit enter:
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=sip packet-mark=sip_conn parent=
global-total priority=1 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=http packet-mark=http_conn parent=
global-total priority=2 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=pop packet-mark=pop_conn parent=
global-total priority=3 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=smtp packet-mark=smtp_conn parent=
global-total priority=4 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=other packet-mark=other_conn parent=
global-total priority=5 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=p2p packet-mark=p2p_conn parent=
global-total priority=8 queue=default
this will build your queue rules for you.
i have it set up as following
sip priority 1
http priority2
pop priority 3
smtp priority4
other priority 5
p2p priority 8
i have found that a lot of p2p gets classed in the other catagory, but thats ok because so long as http and mail flows unabaited im happy.
once you see what the rules look like in winbox after you make them here, maybe you can get an idea how to build modify the rules yourself.
hope this helps.