Hey, I just edited some of the mangle rules posted in this forum in order to suit my gaming needs. Below, I’m marking steam, origin UDP traffic and other things.
/ip firewall mangle
###############################################################################
# DNS requests. Mark in two places because DNS is sent out by the router (itself) too.
add chain=prerouting action=mark-connection protocol=udp port=53 connection-state=new new-connection-mark="DNS" comment="DNS"
add chain=prerouting action=mark-packet passthrough=no connection-mark="DNS" new-packet-mark="DNS"
add chain=postrouting action=mark-connection protocol=udp port=53 connection-state=new new-connection-mark="DNS"
add chain=postrouting action=mark-packet passthrough=no connection-mark="DNS" new-packet-mark="DNS"
# Mark all VoIP traffic. We've set all our equiptment to use SIP 5060,5061 and RTP 10000-20000.
add chain=prerouting action=mark-connection protocol=udp port=3844,3846,5060,5061,5223,5228,5243,9785,16393-16402 new-connection-mark="VOIP" comment="VOIP"
add chain=prerouting action=mark-packet passthrough=no connection-mark="VOIP" new-packet-mark="VOIP"
# Mark all STEAM traffic.
add chain=prerouting action=mark-connection protocol=udp port=3478,4379,4380,28960,27000-27030 new-connection-mark="STEAM" comment="STEAM"
add chain=prerouting action=mark-packet passthrough=no connection-mark="STEAM" new-packet-mark="STEAM"
# Mark all ORIGIN traffic.
add chain=prerouting action=mark-connection protocol=udp port=3659,14000-14016,22990-23006,25200-25300 new-connection-mark="ORIGIN" comment="ORIGIN"
add chain=prerouting action=mark-packet passthrough=no connection-mark="ORIGIN" new-packet-mark="ORIGIN"
# Mark all UDP traffic. Mark different UDP streams if you want more granularity.
add chain=prerouting action=mark-connection protocol=udp connection-state=new new-connection-mark="UDP" comment="UDP"
add chain=prerouting action=mark-packet passthrough=no connection-mark="UDP" new-packet-mark="UDP"
# Ping replies. Mark in two places because ICMP is sent out by the router (itself) too.
add chain=prerouting action=mark-connection protocol=icmp connection-state=new new-connection-mark="ICMP" comment="ICMP"
add chain=prerouting action=mark-packet passthrough=no connection-mark="ICMP" new-packet-mark="ICMP"
add chain=postrouting action=mark-connection protocol=icmp connection-state=new new-connection-mark="ICMP"
add chain=postrouting action=mark-packet passthrough=no connection-mark="ICMP" new-packet-mark="ICMP"
# ACK traffic. Based on viewtopic.php?f=2&t=67965
add chain=postrouting action=mark-packet passthrough=no protocol=tcp tcp-flags=ack packet-size=0-123 new-packet-mark="ACK" comment="ACK"
add chain=prerouting action=mark-packet passthrough=no protocol=tcp tcp-flags=ack packet-size=0-123 new-packet-mark="ACK"
# Mark all new HTTP(s) connections with "HTTP" if they have not previously been marked as "HTTP_BIG".
# If the current mark of "HTTP" tranfers more than 5MB and at a rate of 200k+ then mark it as "HTTP_BIG" for the duration of the TCP session.
add chain=prerouting action=mark-connection protocol=tcp connection-mark=!"HTTP_BIG" new-connection-mark="HTTP" connection-state=new port=80,443,8080 comment="HTTP"
add chain=prerouting action=mark-connection protocol=tcp connection-mark="HTTP" new-connection-mark="HTTP_BIG" connection-bytes=500000-0 connection-rate=200k-100M
add chain=prerouting action=mark-packet passthrough=no connection-mark="HTTP_BIG" new-packet-mark="HTTP_BIG"
add chain=prerouting action=mark-packet passthrough=no connection-mark="HTTP" new-packet-mark="HTTP"
# Mark everything else that has no mark applied.
add chain=prerouting action=mark-connection connection-mark=no-mark new-connection-mark="OTHER" comment="OTHER"
add chain=prerouting action=mark-packet passthrough=no connection-mark="OTHER" new-packet-mark="OTHER"
I need a queue tree for this that can make ping times optimal when someone is downloading. I have 16/8Mbps connection. My other queue tree is not working, upload speeds are not refreshing.
Can someone please help me? Thanks!
